summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2014-04-05 09:58:23 -0400
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2014-04-07 18:36:24 +0100
commite503e04794b480cc01fe2336bcd90394f521a136 (patch)
tree88ad5be54b80a80a4a0d1115f3171036acede245
parente9f7f9d8ee00e997939cbd60ab36c628b0cc7f9b (diff)
TpTestsSimpleConn: Stop using tp_svc_dbus_properties_*()
We are about to stop exporting TpSvcDBusProperties iface so they would be no-op.
-rw-r--r--tests/dbus/self-handle.c24
-rw-r--r--tests/lib/simple-conn.c41
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
-}