Expose the TpTestContactListConnection's manager.
authorTravis Reitter <travis.reitter@collabora.co.uk>
Tue, 5 Oct 2010 17:59:06 +0000 (10:59 -0700)
committerTravis Reitter <travis.reitter@collabora.co.uk>
Wed, 6 Oct 2010 16:08:45 +0000 (09:08 -0700)
tests/lib/telepathy/contactlist/conn.c
tests/lib/telepathy/contactlist/conn.h

index 2e0677a..b078817 100644 (file)
@@ -39,6 +39,7 @@ enum
 {
   PROP_ACCOUNT = 1,
   PROP_SIMULATION_DELAY,
+  PROP_MANAGER,
   N_PROPS
 };
 
@@ -73,6 +74,10 @@ get_property (GObject *object,
       g_value_set_string (value, self->priv->account);
       break;
 
+    case PROP_MANAGER:
+      g_value_set_object (value, self->priv->list_manager);
+      break;
+
     case PROP_SIMULATION_DELAY:
       g_value_set_uint (value, self->priv->simulation_delay);
       break;
@@ -120,6 +125,14 @@ finalize (GObject *object)
       object);
 }
 
+TpTestContactListManager *
+tp_test_contact_list_connection_get_manager (TpTestContactListConnection *self)
+{
+  g_return_val_if_fail (TP_TEST_IS_CONTACT_LIST_CONNECTION (self), NULL);
+
+  return self->priv->list_manager;
+}
+
 static gchar *
 get_unique_connection_name (TpBaseConnection *conn)
 {
@@ -442,6 +455,12 @@ tp_test_contact_list_connection_class_init (
       G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB);
   g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec);
 
+  param_spec = g_param_spec_object ("manager", "TpTestContactListManager",
+      "TpTestContactListManager object that owns this channel",
+      TP_TEST_TYPE_CONTACT_LIST_MANAGER,
+      G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+  g_object_class_install_property (object_class, PROP_MANAGER, param_spec);
+
   param_spec = g_param_spec_uint ("simulation-delay", "Simulation delay",
       "Delay between simulated network events",
       0, G_MAXUINT32, 1000,
index 0d46d67..bc03dee 100644 (file)
@@ -17,6 +17,8 @@
 #include <telepathy-glib/contacts-mixin.h>
 #include <telepathy-glib/presence-mixin.h>
 
+#include "contact-list-manager.h"
+
 G_BEGIN_DECLS
 
 typedef struct _TpTestContactListConnection TpTestContactListConnection;
@@ -57,6 +59,9 @@ GType tp_test_contact_list_connection_get_type (void);
   (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TEST_TYPE_CONTACT_LIST_CONNECTION, \
                               TpTestContactListConnectionClass))
 
+TpTestContactListManager *tp_test_contact_list_connection_get_manager (
+    TpTestContactListConnection *self);
+
 gchar *tp_test_contact_list_normalize_contact (TpHandleRepoIface *repo,
     const gchar *id, gpointer context, GError **error);