diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-04-16 18:14:44 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-04-30 19:19:43 +0100 |
commit | 2e07d043286d90064679b066118877d26bae1f58 (patch) | |
tree | b61e623c0bbbec6cec38a8d0594b0efa69e37fbf /tests/lib | |
parent | 3d6e83e8fcb0bb43c45ff19df0003f42ee8b534f (diff) | |
download | telepathy-glib-2e07d043286d90064679b066118877d26bae1f58.tar.gz |
TpAccountChannelRequest: test that properties get through to the request
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/simple-channel-dispatcher.c | 25 | ||||
-rw-r--r-- | tests/lib/simple-channel-dispatcher.h | 7 |
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/lib/simple-channel-dispatcher.c b/tests/lib/simple-channel-dispatcher.c index d3cb44b7c..ca4ac83c8 100644 --- a/tests/lib/simple-channel-dispatcher.c +++ b/tests/lib/simple-channel-dispatcher.c @@ -124,6 +124,16 @@ create_channel (TpTestsSimpleChannelDispatcher *self, GHashTable *hints, DBusGMethodInvocation *context) { + tp_clear_pointer (&self->last_request, g_hash_table_unref); + self->last_request = g_boxed_copy (TP_HASH_TYPE_STRING_VARIANT_MAP, request); + tp_clear_pointer (&self->last_hints, g_hash_table_unref); + self->last_hints = g_boxed_copy (TP_HASH_TYPE_STRING_VARIANT_MAP, request); + self->last_user_action_time = user_action_time; + g_free (self->last_account); + self->last_account = g_strdup (account); + g_free (self->last_preferred_handler); + self->last_preferred_handler = g_strdup (preferred_handler); + if (tp_asv_get_boolean (request, "CreateChannelFail", NULL)) { /* Fail to create the channel */ @@ -193,6 +203,16 @@ ensure_channel (TpTestsSimpleChannelDispatcher *self, GHashTable *hints, DBusGMethodInvocation *context) { + tp_clear_pointer (&self->last_request, g_hash_table_unref); + self->last_request = g_boxed_copy (TP_HASH_TYPE_STRING_VARIANT_MAP, request); + tp_clear_pointer (&self->last_hints, g_hash_table_unref); + self->last_hints = g_boxed_copy (TP_HASH_TYPE_STRING_VARIANT_MAP, request); + self->last_user_action_time = user_action_time; + g_free (self->last_account); + self->last_account = g_strdup (account); + g_free (self->last_preferred_handler); + self->last_preferred_handler = g_strdup (preferred_handler); + if (self->priv->old_handler != NULL) { /* Pretend that the channel already exists */ @@ -381,6 +401,11 @@ tp_tests_simple_channel_dispatcher_dispose (GObject *object) g_free (self->priv->old_handler); + tp_clear_pointer (&self->last_request, g_hash_table_unref); + tp_clear_pointer (&self->last_hints, g_hash_table_unref); + tp_clear_pointer (&self->last_account, g_free); + tp_clear_pointer (&self->last_preferred_handler, g_free); + if (G_OBJECT_CLASS (tp_tests_simple_channel_dispatcher_parent_class)->dispose != NULL) G_OBJECT_CLASS (tp_tests_simple_channel_dispatcher_parent_class)->dispose (object); } diff --git a/tests/lib/simple-channel-dispatcher.h b/tests/lib/simple-channel-dispatcher.h index 42ba45f71..4512e99d0 100644 --- a/tests/lib/simple-channel-dispatcher.h +++ b/tests/lib/simple-channel-dispatcher.h @@ -29,6 +29,13 @@ struct _TpTestsSimpleChannelDispatcherClass { struct _TpTestsSimpleChannelDispatcher { GObject parent; + /* so regression tests can verify what was asked for */ + GHashTable *last_request; + gchar *last_account; + gint64 last_user_action_time; + gchar *last_preferred_handler; + GHashTable *last_hints; + TpTestsSimpleChannelDispatcherPrivate *priv; gboolean refuse_delegate; |