diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2014-04-05 09:58:23 -0400 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-04-08 19:54:34 +0100 |
commit | 85b7b60f41387929ef7dd07a1577bb74f022b3dc (patch) | |
tree | 88ad5be54b80a80a4a0d1115f3171036acede245 | |
parent | 37af5ebfeb0514f6fafcd2aec16aa28ae028d455 (diff) |
TpTestsSimpleConn: Stop using tp_svc_dbus_properties_*()
We are about to stop exporting TpSvcDBusProperties iface so they
would be no-op.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77144
Reviewed-by: Simon McVittie
-rw-r--r-- | tests/dbus/self-handle.c | 24 | ||||
-rw-r--r-- | tests/lib/simple-conn.c | 41 |
2 files changed, 21 insertions, 44 deletions
diff --git a/tests/dbus/self-handle.c b/tests/dbus/self-handle.c index 44d81c6fe..464cd7423 100644 --- a/tests/dbus/self-handle.c +++ b/tests/dbus/self-handle.c @@ -97,6 +97,21 @@ swapped_counter_cb (gpointer user_data) ++*times; } +static GDBusMessage * +got_all_counter_filter (GDBusConnection *connection, + GDBusMessage *message, + gboolean incoming, + gpointer user_data) +{ + guint *times = user_data; + + if (incoming && + !tp_strdiff (g_dbus_message_get_member (message), "GetAll")) + ++*times; + + return message; +} + static void test_self_handle (Fixture *f, gconstpointer unused G_GNUC_UNUSED) @@ -211,6 +226,7 @@ test_change_inconveniently (Fixture *f, guint contact_times = 0, got_all_times = 0; gboolean ok; GQuark features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; + guint filter_id; /* This test exercises what happens if the self-contact changes * between obtaining its handle for the first time and having the @@ -221,9 +237,9 @@ test_change_inconveniently (Fixture *f, g_signal_connect_swapped (f->client_conn, "notify::self-contact", G_CALLBACK (swapped_counter_cb), &contact_times); - g_signal_connect_swapped (f->service_conn, - "got-all::" TP_IFACE_CONNECTION, - G_CALLBACK (swapped_counter_cb), &got_all_times); + filter_id = g_dbus_connection_add_filter (f->dbus, + got_all_counter_filter, + &got_all_times, NULL); tp_proxy_prepare_async (f->client_conn, features, tp_tests_result_ready_cb, &f->result); @@ -275,6 +291,8 @@ test_change_inconveniently (Fixture *f, g_assert_cmpstr (tp_contact_get_identifier (after), ==, "myself@example.org"); + g_dbus_connection_remove_filter (f->dbus, filter_id); + g_object_unref (after); } diff --git a/tests/lib/simple-conn.c b/tests/lib/simple-conn.c index efa20c0dd..9acea0a9d 100644 --- a/tests/lib/simple-conn.c +++ b/tests/lib/simple-conn.c @@ -24,11 +24,8 @@ #include "room-list-chan.h" #include "util.h" -static void props_iface_init (TpSvcDBusPropertiesClass *); - G_DEFINE_TYPE_WITH_CODE (TpTestsSimpleConnection, tp_tests_simple_connection, TP_TYPE_BASE_CONNECTION, - G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, props_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION, NULL)) /* type definition stuff */ @@ -40,14 +37,6 @@ enum N_PROPS }; -enum -{ - SIGNAL_GOT_ALL, - N_SIGNALS -}; - -static guint signals[N_SIGNALS] = {0}; - struct _TpTestsSimpleConnectionPrivate { gchar *account; @@ -296,13 +285,6 @@ tp_tests_simple_connection_class_init (TpTestsSimpleConnectionClass *klass) TP_CONNECTION_STATUS_DISCONNECTED, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DBUS_STATUS, param_spec); - - signals[SIGNAL_GOT_ALL] = g_signal_new ("got-all", - G_OBJECT_CLASS_TYPE (klass), - G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, - 0, - NULL, NULL, NULL, - G_TYPE_NONE, 0); } void @@ -416,26 +398,3 @@ tp_tests_simple_connection_ensure_room_list_chan (TpTestsSimpleConnection *self, return chan_path; } - -static void -get_all (TpSvcDBusProperties *iface, - const gchar *interface_name, - GDBusMethodInvocation *context) -{ - GHashTable *values = tp_dbus_properties_mixin_dup_all (G_OBJECT (iface), - interface_name); - - tp_svc_dbus_properties_return_from_get_all (context, values); - g_hash_table_unref (values); - g_signal_emit (iface, signals[SIGNAL_GOT_ALL], - g_quark_from_string (interface_name)); -} - -static void -props_iface_init (TpSvcDBusPropertiesClass *iface) -{ -#define IMPLEMENT(x) \ - tp_svc_dbus_properties_implement_##x (iface, x) - IMPLEMENT (get_all); -#undef IMPLEMENT -} |