[Pkg-telepathy-commits] [telepathy-glib-1] 137/212: TpTestsSimpleConn: Stop using tp_svc_dbus_properties_*()

Simon McVittie smcv at debian.org
Wed May 14 12:09:06 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository telepathy-glib-1.

commit 85b7b60f41387929ef7dd07a1577bb74f022b3dc
Author: Xavier Claessens <xavier.claessens at collabora.com>
Date:   Sat Apr 5 09:58:23 2014 -0400

    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
---
 tests/dbus/self-handle.c | 24 +++++++++++++++++++++---
 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 44d81c6..464cd74 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 at 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 efa20c0..9acea0a 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
-}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-glib-1.git



More information about the Pkg-telepathy-commits mailing list