[Bug 33471] Implement FileTransfer.FileURI
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Wed Jan 26 12:08:47 CET 2011
https://bugs.freedesktop.org/show_bug.cgi?id=33471
--- Comment #2 from Will Thompson <will.thompson at collabora.co.uk> 2011-01-26 03:08:46 PST ---
+ props = tp_dbus_properties_mixin_make_properties_hash (object,
+ TP_IFACE_CHANNEL, "ChannelType",
+ TP_IFACE_CHANNEL, "Interfaces",
+ TP_IFACE_CHANNEL, "TargetHandle",
+ TP_IFACE_CHANNEL, "TargetID",
+ TP_IFACE_CHANNEL, "TargetHandleType",
+ TP_IFACE_CHANNEL, "Requested",
+ TP_IFACE_CHANNEL, "InitiatorHandle",
+ TP_IFACE_CHANNEL, "InitiatorID",
+ TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "State",
+ TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "ContentType",
+ TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "Filename",
+ TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "Size",
+ TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "ContentHashType",
+ TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "ContentHash",
+ TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "Description",
+ TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "Date",
+ TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "AvailableSocketTypes",
+ TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "TransferredBytes",
+ TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "InitialOffset",
+ GABBLE_IFACE_CHANNEL_TYPE_FILETRANSFER_FUTURE, "FileCollection",
+ NULL);
+
+ /* FileURI is immutable only for outgoing transfers */
+ if (self->priv->initiator == base_conn->self_handle)
+ {
+ tp_dbus_properties_mixin_fill_properties_hash (object,
props,
+ GABBLE_IFACE_CHANNEL_TYPE_FILETRANSFER_FUTURE,
"FileURI",
+ NULL);
+ }
+
+ g_value_take_boxed (value, props);
+ }
The indentation is wrong.
+ assert props[cs.FT_FILE_URI] == self.file.uri
assertEquals. You could change all the assertions in that section while you're
at it.
The test should also test not specifying the URI, in both directions.
+ if (self->priv->file_uri != NULL)
+ {
+ g_set_error (error, TP_ERRORS, TP_ERROR_NOT_AVAILABLE,
+ "FileURI has already be set");
+ return FALSE;
+ }
These should all be InvalidArgument. NotAvailable is temporary.
+ # Check it has the right value now
+ uri = ft_props.Get(cs.CHANNEL_TYPE_FILE_TRANSFER + '.FUTURE',
'FileURI')
+ assertEquals(self.file.uri, uri)
+
You should also test setting it after it's been set, and after the file has
been accepted.
+ g_assert (self->priv->file_uri == NULL); /* construct only */
I think this comment is a bit misleading, but okay.
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the telepathy-bugs
mailing list