[folks/next: 19/20] Update test CMs for telepathy-glib 0.99.11
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks/next: 19/20] Update test CMs for telepathy-glib 0.99.11
- Date: Wed, 7 May 2014 09:55:28 +0000 (UTC)
commit a2cc5768990a3d1c1d2b4447cbe131e32a74a1e4
Author: Simon McVittie <simon mcvittie collabora co uk>
Date: Wed May 7 10:52:34 2014 +0100
Update test CMs for telepathy-glib 0.99.11
tests/folks/Makefile.am | 1 +
tests/lib/telepathy/Makefile.am | 2 +
tests/lib/telepathy/contactlist/Makefile.am | 2 +
tests/lib/telepathy/contactlist/contacts-conn.c | 221 ++++++-------
tests/lib/telepathy/contactlist/contacts-conn.h | 4 +-
tests/lib/telepathy/contactlist/echo-chan.h | 1 +
tests/lib/telepathy/contactlist/my-conn-proxy.c | 365 ++++++++++++++++++++
tests/lib/telepathy/contactlist/my-conn-proxy.h | 128 +++++++
tests/lib/telepathy/contactlist/room-list-chan.h | 1 +
.../telepathy/contactlist/simple-account-manager.h | 2 +-
tests/lib/telepathy/contactlist/simple-account.h | 1 +
tests/lib/telepathy/contactlist/simple-conn.c | 42 ++--
tests/telepathy/Makefile.am | 1 +
13 files changed, 628 insertions(+), 143 deletions(-)
---
diff --git a/tests/folks/Makefile.am b/tests/folks/Makefile.am
index 9fda574..5917ef2 100644
--- a/tests/folks/Makefile.am
+++ b/tests/folks/Makefile.am
@@ -20,6 +20,7 @@ AM_VALAFLAGS = \
AM_CPPFLAGS = \
$(test_cppflags) \
$(TP_GLIB_CFLAGS) \
+ $(TP_GLIB_DBUS_CFLAGS) \
-I$(top_srcdir)/tests/lib/key-file \
-I$(top_srcdir)/tests/lib/telepathy \
-I$(top_srcdir)/tests/lib/telepathy/contactlist \
diff --git a/tests/lib/telepathy/Makefile.am b/tests/lib/telepathy/Makefile.am
index 648249e..23704f1 100644
--- a/tests/lib/telepathy/Makefile.am
+++ b/tests/lib/telepathy/Makefile.am
@@ -55,6 +55,7 @@ libtpf_test_la_CFLAGS = \
$(GLIB_CFLAGS) \
$(GEE_CFLAGS) \
$(TP_GLIB_CFLAGS) \
+ $(TP_GLIB_DBUS_CFLAGS) \
$(NULL)
libtpf_test_la_LIBADD = \
@@ -64,6 +65,7 @@ libtpf_test_la_LIBADD = \
$(GLIB_LIBS) \
$(GEE_LIBS) \
$(TP_GLIB_LIBS) \
+ $(TP_GLIB_DBUS_LIBS) \
$(NULL)
BUILT_SOURCES = \
diff --git a/tests/lib/telepathy/contactlist/Makefile.am b/tests/lib/telepathy/contactlist/Makefile.am
index 566fb38..a4a4df3 100644
--- a/tests/lib/telepathy/contactlist/Makefile.am
+++ b/tests/lib/telepathy/contactlist/Makefile.am
@@ -28,6 +28,8 @@ libtp_test_contactlist_la_SOURCES = \
contacts-conn.c \
contacts-conn.h \
debug.h \
+ my-conn-proxy.c \
+ my-conn-proxy.h \
room-list-chan.c \
room-list-chan.h \
simple-account.c \
diff --git a/tests/lib/telepathy/contactlist/contacts-conn.c b/tests/lib/telepathy/contactlist/contacts-conn.c
index 787aea3..a418cb7 100644
--- a/tests/lib/telepathy/contactlist/contacts-conn.c
+++ b/tests/lib/telepathy/contactlist/contacts-conn.c
@@ -19,33 +19,36 @@
#include <telepathy-glib/telepathy-glib-dbus.h>
#include "debug.h"
+#include "my-conn-proxy.h"
static void init_aliasing (gpointer, gpointer);
static void init_avatars (gpointer, gpointer);
static void init_contact_info (gpointer, gpointer);
+static void init_presence (gpointer, gpointer);
static void conn_avatars_properties_getter (GObject *object, GQuark interface,
GQuark name, GValue *value, gpointer getter_data);
G_DEFINE_TYPE_WITH_CODE (TpTestsContactsConnection,
tp_tests_contacts_connection,
TP_TESTS_TYPE_SIMPLE_CONNECTION,
+ G_IMPLEMENT_INTERFACE (TP_TYPE_PRESENCE_MIXIN, init_presence)
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_ALIASING1,
init_aliasing);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_AVATARS1,
init_avatars);
- G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_PRESENCE1,
- tp_presence_mixin_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_LOCATION1, NULL)
G_IMPLEMENT_INTERFACE (
TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_CAPABILITIES1, NULL)
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_INFO1,
init_contact_info)
- G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_LIST1,
- tp_base_contact_list_mixin_list_iface_init);
- G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_GROUPS1,
- tp_base_contact_list_mixin_groups_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CLIENT_TYPES1,
NULL);
+ /* We don't really implement this one, but the proxy-preparation test
+ * wants to be able to add interfaces at runtime like Gabble does.
+ * It can be any interface we don't really need (implementation detail:
+ * it's PowerSaving1). */
+ G_IMPLEMENT_INTERFACE (TP_TESTS_TYPE_SVC_CONNECTION_INTERFACE_LATER,
+ NULL);
);
/* type definition stuff */
@@ -183,11 +186,26 @@ finalize (GObject *object)
G_OBJECT_CLASS (tp_tests_contacts_connection_parent_class)->finalize (object);
}
+static GVariant *
+_tp_g_variant_new_boxed (GType gtype,
+ gpointer boxed)
+{
+ GValue value = G_VALUE_INIT;
+ GVariant *variant;
+
+ g_value_init (&value, gtype);
+ g_value_set_boxed (&value, boxed);
+ variant = dbus_g_value_build_g_variant (&value);
+ g_value_unset (&value);
+
+ return variant;
+}
+
static void
tp_tests_contacts_connection_fill_contact_attributes (TpBaseConnection *base,
const gchar *dbus_interface,
TpHandle contact,
- TpContactAttributeMap *attributes)
+ GVariantDict *attributes)
{
TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (base);
TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base,
@@ -204,9 +222,8 @@ tp_tests_contacts_connection_fill_contact_attributes (TpBaseConnection *base,
alias = tp_handle_inspect (contact_repo, contact);
}
- tp_contact_attribute_map_take_sliced_gvalue (attributes, contact,
- TP_IFACE_CONNECTION_INTERFACE_ALIASING1 "/alias",
- tp_g_value_slice_new_string (alias));
+ g_variant_dict_insert (attributes,
+ TP_IFACE_CONNECTION_INTERFACE_ALIASING1 "/alias", "s", alias);
return;
}
@@ -219,9 +236,8 @@ tp_tests_contacts_connection_fill_contact_attributes (TpBaseConnection *base,
if (a != NULL && a->token != NULL)
{
- tp_contact_attribute_map_take_sliced_gvalue (attributes, contact,
- TP_IFACE_CONNECTION_INTERFACE_AVATARS1 "/token",
- tp_g_value_slice_new_string (a->token));
+ g_variant_dict_insert (attributes,
+ TP_IFACE_CONNECTION_INTERFACE_AVATARS1 "/token", "s", a->token);
}
return;
@@ -235,9 +251,9 @@ tp_tests_contacts_connection_fill_contact_attributes (TpBaseConnection *base,
if (location != NULL)
{
- tp_contact_attribute_map_take_sliced_gvalue (attributes, contact,
+ g_variant_dict_insert_value (attributes,
TP_IFACE_CONNECTION_INTERFACE_LOCATION1 "/location",
- tp_g_value_slice_new_boxed (TP_HASH_TYPE_LOCATION, location));
+ _tp_g_variant_new_boxed (TP_HASH_TYPE_LOCATION, location));
}
return;
@@ -251,10 +267,10 @@ tp_tests_contacts_connection_fill_contact_attributes (TpBaseConnection *base,
if (caps != NULL)
{
- tp_contact_attribute_map_take_sliced_gvalue (attributes, contact,
+ g_variant_dict_insert_value (attributes,
TP_IFACE_CONNECTION_INTERFACE_CONTACT_CAPABILITIES1 "/capabilities",
- tp_g_value_slice_new_boxed (
- TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, caps));
+ _tp_g_variant_new_boxed (
+ TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, caps));
}
return;
@@ -268,9 +284,9 @@ tp_tests_contacts_connection_fill_contact_attributes (TpBaseConnection *base,
if (info != NULL)
{
- tp_contact_attribute_map_take_sliced_gvalue (attributes, contact,
+ g_variant_dict_insert_value (attributes,
TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO1 "/info",
- tp_g_value_slice_new_boxed (TP_ARRAY_TYPE_CONTACT_INFO_FIELD_LIST,
+ _tp_g_variant_new_boxed (TP_ARRAY_TYPE_CONTACT_INFO_FIELD_LIST,
info));
}
@@ -282,7 +298,7 @@ tp_tests_contacts_connection_fill_contact_attributes (TpBaseConnection *base,
dbus_interface, contact, attributes))
return;
- if (tp_presence_mixin_fill_contact_attributes (G_OBJECT (self),
+ if (tp_presence_mixin_fill_contact_attributes (TP_PRESENCE_MIXIN (self),
dbus_interface, contact, attributes))
return;
@@ -360,135 +376,127 @@ static void
constructed (GObject *object)
{
TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (object);
+ GDBusObjectSkeleton *skel = G_DBUS_OBJECT_SKELETON (object);
+ GDBusInterfaceSkeleton *iface;
void (*parent_impl) (GObject *) =
G_OBJECT_CLASS (tp_tests_contacts_connection_parent_class)->constructed;
if (parent_impl != NULL)
parent_impl (object);
+ iface = tp_svc_interface_skeleton_new (skel,
+ TP_TYPE_SVC_CONNECTION_INTERFACE_ALIASING1);
+ g_dbus_object_skeleton_add_interface (skel, iface);
+ g_object_unref (iface);
+
+ iface = tp_svc_interface_skeleton_new (skel,
+ TP_TYPE_SVC_CONNECTION_INTERFACE_AVATARS1);
+ g_dbus_object_skeleton_add_interface (skel, iface);
+ g_object_unref (iface);
+
+ iface = tp_svc_interface_skeleton_new (skel,
+ TP_TYPE_SVC_CONNECTION_INTERFACE_CLIENT_TYPES1);
+ g_dbus_object_skeleton_add_interface (skel, iface);
+ g_object_unref (iface);
+
+ iface = tp_svc_interface_skeleton_new (skel,
+ TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_CAPABILITIES1);
+ g_dbus_object_skeleton_add_interface (skel, iface);
+ g_object_unref (iface);
+
+ iface = tp_svc_interface_skeleton_new (skel,
+ TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_INFO1);
+ g_dbus_object_skeleton_add_interface (skel, iface);
+ g_object_unref (iface);
+
+ iface = tp_svc_interface_skeleton_new (skel,
+ TP_TYPE_SVC_CONNECTION_INTERFACE_LOCATION1);
+ g_dbus_object_skeleton_add_interface (skel, iface);
+ g_object_unref (iface);
+
self->priv->list_manager = g_object_new (TP_TESTS_TYPE_CONTACT_LIST_MANAGER,
"connection", self, NULL);
- tp_presence_mixin_init (object,
- G_STRUCT_OFFSET (TpTestsContactsConnection, presence_mixin));
+ tp_presence_mixin_init (TP_PRESENCE_MIXIN (self));
}
-static const TpPresenceStatusOptionalArgumentSpec can_have_message[] = {
- { "message", "s", NULL, NULL },
- { NULL }
-};
-
/* Must match TpTestsContactsConnectionPresenceStatusIndex in the .h */
static const TpPresenceStatusSpec my_statuses[] = {
- { "available", TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, TRUE,
- can_have_message },
- { "busy", TP_CONNECTION_PRESENCE_TYPE_BUSY, TRUE, can_have_message },
- { "away", TP_CONNECTION_PRESENCE_TYPE_AWAY, TRUE, can_have_message },
- { "offline", TP_CONNECTION_PRESENCE_TYPE_OFFLINE, FALSE, NULL },
- { "unknown", TP_CONNECTION_PRESENCE_TYPE_UNKNOWN, FALSE, NULL },
- { "error", TP_CONNECTION_PRESENCE_TYPE_ERROR, FALSE, NULL },
+ { "available", TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, TRUE, TRUE},
+ { "busy", TP_CONNECTION_PRESENCE_TYPE_BUSY, TRUE, TRUE },
+ { "away", TP_CONNECTION_PRESENCE_TYPE_AWAY, TRUE, TRUE },
+ { "offline", TP_CONNECTION_PRESENCE_TYPE_OFFLINE, FALSE, FALSE },
+ { "unknown", TP_CONNECTION_PRESENCE_TYPE_UNKNOWN, FALSE, FALSE },
+ { "error", TP_CONNECTION_PRESENCE_TYPE_ERROR, FALSE, FALSE },
{ NULL }
};
static gboolean
-my_status_available (GObject *object,
- guint index)
+my_status_available (TpPresenceMixin *mixin,
+ guint index)
{
- TpBaseConnection *base = TP_BASE_CONNECTION (object);
-
- return tp_base_connection_check_connected (base, NULL);
+ return tp_base_connection_check_connected (TP_BASE_CONNECTION (mixin), NULL);
}
static TpPresenceStatus *
-my_get_contact_status (GObject *object,
+my_get_contact_status (TpPresenceMixin *mixin,
TpHandle contact)
{
- TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (object);
- TpPresenceStatus *result;
+ TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (mixin);
gpointer key = GUINT_TO_POINTER (contact);
TpTestsContactsConnectionPresenceStatusIndex index;
const gchar *presence_message;
- GHashTable *parameters;
index = GPOINTER_TO_UINT (g_hash_table_lookup (
self->priv->presence_statuses, key));
presence_message = g_hash_table_lookup (
self->priv->presence_messages, key);
- parameters = g_hash_table_new_full (g_str_hash,
- g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free);
-
- if (presence_message != NULL)
- g_hash_table_insert (parameters, (gpointer) "message",
- tp_g_value_slice_new_string (presence_message));
-
- result = tp_presence_status_new (index, parameters);
- g_hash_table_unref (parameters);
-
- return result;
+ return tp_presence_status_new (index, presence_message);
}
static gboolean
-my_set_own_status (GObject *object,
+my_set_own_status (TpPresenceMixin *mixin,
const TpPresenceStatus *status,
GError **error)
{
- TpBaseConnection *base_conn = TP_BASE_CONNECTION (object);
+ TpBaseConnection *base_conn = TP_BASE_CONNECTION (mixin);
TpTestsContactsConnectionPresenceStatusIndex index = status->index;
- const gchar *message = "";
+ const gchar *message = status->message;
TpHandle self_handle;
- if (status->optional_arguments != NULL)
- {
- message = g_hash_table_lookup (status->optional_arguments, "message");
-
- if (message == NULL)
- message = "";
- }
-
self_handle = tp_base_connection_get_self_handle (base_conn);
- tp_tests_contacts_connection_change_presences (TP_TESTS_CONTACTS_CONNECTION (object),
+ tp_tests_contacts_connection_change_presences (
+ TP_TESTS_CONTACTS_CONNECTION (base_conn),
1, &self_handle, &index, &message);
return TRUE;
}
static guint
-my_get_maximum_status_message_length_cb (GObject *obj)
+my_get_maximum_status_message_length_cb (TpPresenceMixin *mixin G_GNUC_UNUSED)
{
return 512;
}
-static GPtrArray *
-create_channel_managers (TpBaseConnection *conn)
+static void
+init_presence (gpointer g_iface,
+ gpointer iface_data)
{
- return g_ptr_array_new ();
+ TpPresenceMixinInterface *iface = g_iface;
+
+ iface->status_available = my_status_available;
+ iface->get_contact_status = my_get_contact_status;
+ iface->set_own_status = my_set_own_status;
+ iface->statuses = my_statuses;
+ iface->get_maximum_status_message_length =
+ my_get_maximum_status_message_length_cb;
}
static GPtrArray *
-tp_tests_contacts_get_interfaces_always_present (TpBaseConnection *base)
+create_channel_managers (TpBaseConnection *conn)
{
- GPtrArray *interfaces;
- static const gchar *interfaces_always_present[] = {
- TP_IFACE_CONNECTION_INTERFACE_ALIASING1,
- TP_IFACE_CONNECTION_INTERFACE_AVATARS1,
- TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST1,
- TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS1,
- TP_IFACE_CONNECTION_INTERFACE_PRESENCE1,
- TP_IFACE_CONNECTION_INTERFACE_LOCATION1,
- TP_IFACE_CONNECTION_INTERFACE_CLIENT_TYPES1,
- TP_IFACE_CONNECTION_INTERFACE_CONTACT_CAPABILITIES1,
- TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO1,
- NULL };
- guint i;
-
- interfaces = TP_BASE_CONNECTION_CLASS (
- tp_tests_contacts_connection_parent_class)->get_interfaces_always_present (base);
-
- for (i = 0; interfaces_always_present[i] != NULL; i++)
- g_ptr_array_add (interfaces, (gchar *) interfaces_always_present[i]);
-
- return interfaces;
+ return g_ptr_array_new ();
}
enum
@@ -520,7 +528,6 @@ tp_tests_contacts_connection_class_init (TpTestsContactsConnectionClass *klass)
TpBaseConnectionClass *base_class =
(TpBaseConnectionClass *) klass;
GObjectClass *object_class = (GObjectClass *) klass;
- TpPresenceMixinClass *mixin_class;
static TpDBusPropertiesMixinPropImpl aliasing_props[] = {
{ "AliasFlags", GUINT_TO_POINTER (ALIASING_DP_ALIAS_FLAGS), NULL },
{ NULL }
@@ -549,26 +556,13 @@ tp_tests_contacts_connection_class_init (TpTestsContactsConnectionClass *klass)
object_class->finalize = finalize;
g_type_class_add_private (klass, sizeof (TpTestsContactsConnectionPrivate));
- base_class->get_interfaces_always_present = tp_tests_contacts_get_interfaces_always_present;
base_class->create_channel_managers = create_channel_managers;
base_class->fill_contact_attributes =
tp_tests_contacts_connection_fill_contact_attributes;
- tp_presence_mixin_class_init (object_class,
- G_STRUCT_OFFSET (TpTestsContactsConnectionClass, presence_mixin),
- my_status_available, my_get_contact_status,
- my_set_own_status, my_statuses);
- mixin_class = TP_PRESENCE_MIXIN_CLASS(klass);
- mixin_class->get_maximum_status_message_length =
- my_get_maximum_status_message_length_cb;
-
- tp_presence_mixin_init_dbus_properties (object_class);
-
klass->properties_class.interfaces = prop_interfaces;
tp_dbus_properties_mixin_class_init (object_class,
G_STRUCT_OFFSET (TpTestsContactsConnectionClass, properties_class));
-
- tp_base_contact_list_mixin_class_init (base_class);
}
TpTestsContactListManager *
@@ -625,7 +619,6 @@ tp_tests_contacts_connection_change_presences (
for (i = 0; i < n; i++)
{
- GHashTable *parameters;
gpointer key = GUINT_TO_POINTER (handles[i]);
DEBUG ("contact#%u -> %s \"%s\"", handles[i],
@@ -636,19 +629,11 @@ tp_tests_contacts_connection_change_presences (
g_hash_table_insert (self->priv->presence_messages, key,
g_strdup (messages[i]));
- parameters = g_hash_table_new_full (g_str_hash,
- g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free);
-
- if (messages[i] != NULL && messages[i][0] != '\0')
- g_hash_table_insert (parameters, (gpointer) "message",
- tp_g_value_slice_new_string (messages[i]));
-
g_hash_table_insert (presences, key, tp_presence_status_new (indexes[i],
- parameters));
- g_hash_table_unref (parameters);
+ messages[i]));
}
- tp_presence_mixin_emit_presence_update ((GObject *) self,
+ tp_presence_mixin_emit_presence_update (TP_PRESENCE_MIXIN (self),
presences);
g_hash_table_unref (presences);
}
diff --git a/tests/lib/telepathy/contactlist/contacts-conn.h b/tests/lib/telepathy/contactlist/contacts-conn.h
index aaa826e..2814055 100644
--- a/tests/lib/telepathy/contactlist/contacts-conn.h
+++ b/tests/lib/telepathy/contactlist/contacts-conn.h
@@ -14,6 +14,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
#include "simple-conn.h"
#include "contact-list-manager.h"
@@ -27,15 +28,12 @@ typedef struct _TpTestsContactsConnectionPrivate TpTestsContactsConnectionPrivat
struct _TpTestsContactsConnectionClass {
TpTestsSimpleConnectionClass parent_class;
- TpPresenceMixinClass presence_mixin;
TpDBusPropertiesMixinClass properties_class;
};
struct _TpTestsContactsConnection {
TpTestsSimpleConnection parent;
- TpPresenceMixin presence_mixin;
-
TpTestsContactsConnectionPrivate *priv;
};
diff --git a/tests/lib/telepathy/contactlist/echo-chan.h b/tests/lib/telepathy/contactlist/echo-chan.h
index 5fbe6ee..9272985 100644
--- a/tests/lib/telepathy/contactlist/echo-chan.h
+++ b/tests/lib/telepathy/contactlist/echo-chan.h
@@ -14,6 +14,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
G_BEGIN_DECLS
diff --git a/tests/lib/telepathy/contactlist/my-conn-proxy.c b/tests/lib/telepathy/contactlist/my-conn-proxy.c
new file mode 100644
index 0000000..4df30a1
--- /dev/null
+++ b/tests/lib/telepathy/contactlist/my-conn-proxy.c
@@ -0,0 +1,365 @@
+/*
+ * my-conn-proxy.c - a simple subclass of TpConnection
+ *
+ * Copyright (C) 2010-2011 Collabora Ltd. <http://www.collabora.co.uk/>
+ *
+ * Copying and distribution of this file, with or without modification,
+ * are permitted in any medium without royalty provided the copyright
+ * notice and this notice are preserved.
+ */
+
+#include "config.h"
+
+#include "my-conn-proxy.h"
+
+#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
+
+G_DEFINE_TYPE (TpTestsMyConnProxy, tp_tests_my_conn_proxy,
+ TP_TYPE_CONNECTION)
+
+static void
+tp_tests_my_conn_proxy_init (TpTestsMyConnProxy *self)
+{
+}
+
+enum {
+ FEAT_CORE,
+ FEAT_A,
+ FEAT_B,
+ FEAT_WRONG_IFACE,
+ FEAT_BAD_DEP,
+ FEAT_FAIL,
+ FEAT_FAIL_DEP,
+ FEAT_RETRY,
+ FEAT_RETRY_DEP,
+ FEAT_BEFORE_CONNECTED,
+ FEAT_INTERFACE_LATER,
+ N_FEAT
+};
+
+static void
+prepare_core_async (TpProxy *proxy,
+ const TpProxyFeature *feature,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *result;
+
+ /* superclass core features are prepared first */
+ g_assert (tp_proxy_is_prepared (proxy, TP_CONNECTION_FEATURE_CORE));
+
+ result = g_simple_async_result_new ((GObject *) proxy, callback, user_data,
+ prepare_core_async);
+
+ g_simple_async_result_complete_in_idle (result);
+ g_object_unref (result);
+}
+
+static void
+prepare_a_async (TpProxy *proxy,
+ const TpProxyFeature *feature,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *result;
+
+ g_assert (tp_proxy_is_prepared (proxy, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE));
+
+ result = g_simple_async_result_new ((GObject *) proxy, callback, user_data,
+ prepare_a_async);
+
+ g_simple_async_result_complete_in_idle (result);
+ g_object_unref (result);
+}
+
+static void
+prepare_b_async (TpProxy *proxy,
+ const TpProxyFeature *feature,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *result;
+
+ g_assert (tp_proxy_is_prepared (proxy, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE));
+ g_assert (tp_proxy_is_prepared (proxy, TP_TESTS_MY_CONN_PROXY_FEATURE_A));
+
+ result = g_simple_async_result_new ((GObject *) proxy, callback, user_data,
+ prepare_b_async);
+
+ g_simple_async_result_complete_in_idle (result);
+ g_object_unref (result);
+}
+
+static void
+cannot_be_prepared_async (TpProxy *proxy,
+ const TpProxyFeature *feature,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_assert_not_reached ();
+}
+
+static void
+prepare_fail_async (TpProxy *proxy,
+ const TpProxyFeature *feature,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *result;
+
+ g_assert (tp_proxy_is_prepared (proxy, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE));
+
+ result = g_simple_async_result_new_error ((GObject *) proxy, callback,
+ user_data, TP_ERROR, TP_ERROR_NOT_AVAILABLE,
+ "No feature for you!");
+
+ g_simple_async_result_complete_in_idle (result);
+ g_object_unref (result);
+}
+
+static void
+prepare_retry_async (TpProxy *proxy,
+ const TpProxyFeature *feature,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ TpTestsMyConnProxy *self = (TpTestsMyConnProxy *) proxy;
+ GSimpleAsyncResult *result;
+
+ result = g_simple_async_result_new ((GObject *) proxy, callback, user_data,
+ prepare_retry_async);
+
+ if (!self->retry_feature_success)
+ {
+ /* Fail the first time we try to prepare the feature */
+ g_simple_async_result_set_error (result, TP_ERROR,
+ TP_ERROR_NOT_YET, "Nah");
+ }
+
+ g_simple_async_result_complete_in_idle (result);
+ g_object_unref (result);
+}
+
+static void
+prepare_retry_dep_async (TpProxy *proxy,
+ const TpProxyFeature *feature,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *result;
+
+ g_assert (tp_proxy_is_prepared (proxy, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE));
+
+ result = g_simple_async_result_new ((GObject *) proxy, callback, user_data,
+ prepare_retry_dep_async);
+
+ g_simple_async_result_complete_in_idle (result);
+ g_object_unref (result);
+}
+
+static void
+prepare_before_connected_async (TpProxy *proxy,
+ const TpProxyFeature *feature,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ TpTestsMyConnProxy *self = (TpTestsMyConnProxy *) proxy;
+ GSimpleAsyncResult *result;
+
+ g_assert (tp_proxy_is_prepared (proxy, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE));
+
+ result = g_simple_async_result_new ((GObject *) proxy, callback, user_data,
+ prepare_before_connected_async);
+
+ if (tp_connection_get_status (TP_CONNECTION (self), NULL) ==
+ TP_CONNECTION_STATUS_CONNECTED)
+ self->before_connected_state = BEFORE_CONNECTED_STATE_CONNECTED;
+ else
+ self->before_connected_state = BEFORE_CONNECTED_STATE_NOT_CONNECTED;
+
+ g_simple_async_result_complete_in_idle (result);
+ g_object_unref (result);
+}
+
+static void
+prepare_before_connected_before_async (TpProxy *proxy,
+ const TpProxyFeature *feature,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ TpTestsMyConnProxy *self = (TpTestsMyConnProxy *) proxy;
+ GSimpleAsyncResult *result;
+
+ g_assert (tp_proxy_is_prepared (proxy, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE));
+
+ g_assert_cmpuint (tp_connection_get_status (TP_CONNECTION (proxy), NULL), ==,
+ TP_CONNECTION_STATUS_CONNECTING);
+
+ result = g_simple_async_result_new ((GObject *) proxy, callback, user_data,
+ prepare_before_connected_before_async);
+
+ self->before_connected_state = BEFORE_CONNECTED_STATE_CONNECTED;
+
+ g_simple_async_result_complete_in_idle (result);
+ g_object_unref (result);
+}
+
+static void
+prepare_interface_later_async (TpProxy *proxy,
+ const TpProxyFeature *feature,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *result;
+
+ result = g_simple_async_result_new ((GObject *) proxy, callback, user_data,
+ prepare_interface_later_async);
+
+ g_simple_async_result_complete_in_idle (result);
+ g_object_unref (result);
+}
+
+static const TpProxyFeature *
+list_features (TpProxyClass *cls G_GNUC_UNUSED)
+{
+ static TpProxyFeature features[N_FEAT + 1] = { { 0 } };
+ static GQuark need_a[2] = {0, 0};
+ static GQuark need_channel_core[2] = {0, 0};
+ static GQuark need_wrong_iface[2] = {0, 0};
+ static GQuark need_fail[2] = {0, 0};
+ static GQuark need_retry[2] = {0, 0};
+ static GQuark need_iface_later[2] = {0, 0};
+
+ if (G_LIKELY (features[0].name != 0))
+ return features;
+
+ features[FEAT_CORE].name = TP_TESTS_MY_CONN_PROXY_FEATURE_CORE;
+ features[FEAT_CORE].core = TRUE;
+ features[FEAT_CORE].prepare_async = prepare_core_async;
+
+ features[FEAT_A].name = TP_TESTS_MY_CONN_PROXY_FEATURE_A;
+ features[FEAT_A].prepare_async = prepare_a_async;
+
+ features[FEAT_B].name = TP_TESTS_MY_CONN_PROXY_FEATURE_B;
+ features[FEAT_B].prepare_async = prepare_b_async;
+ need_a[0] = TP_TESTS_MY_CONN_PROXY_FEATURE_A;
+ features[FEAT_B].depends_on = need_a;
+
+ features[FEAT_WRONG_IFACE].name = TP_TESTS_MY_CONN_PROXY_FEATURE_WRONG_IFACE;
+ features[FEAT_WRONG_IFACE].prepare_async = cannot_be_prepared_async;
+ need_channel_core[0] = TP_CHANNEL_FEATURE_CORE;
+ features[FEAT_WRONG_IFACE].interfaces_needed = need_channel_core;
+
+ features[FEAT_BAD_DEP].name = TP_TESTS_MY_CONN_PROXY_FEATURE_BAD_DEP;
+ features[FEAT_BAD_DEP].prepare_async = cannot_be_prepared_async;
+ need_wrong_iface[0] = TP_TESTS_MY_CONN_PROXY_FEATURE_WRONG_IFACE;
+ features[FEAT_BAD_DEP].depends_on = need_wrong_iface;
+
+ features[FEAT_FAIL].name = TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL;
+ features[FEAT_FAIL].prepare_async = prepare_fail_async;
+
+ features[FEAT_FAIL_DEP].name = TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL_DEP;
+ features[FEAT_FAIL_DEP].prepare_async = cannot_be_prepared_async;
+ need_fail[0] = TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL;
+ features[FEAT_FAIL_DEP].depends_on = need_fail;
+
+ features[FEAT_RETRY].name = TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY;
+ features[FEAT_RETRY].prepare_async = prepare_retry_async;
+ features[FEAT_RETRY].can_retry = TRUE;
+
+ features[FEAT_RETRY_DEP].name = TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY_DEP;
+ need_retry[0] = TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY;
+ features[FEAT_RETRY_DEP].prepare_async = prepare_retry_dep_async;
+ features[FEAT_RETRY_DEP].depends_on = need_retry;
+
+ features[FEAT_BEFORE_CONNECTED].name =
+ TP_TESTS_MY_CONN_PROXY_FEATURE_BEFORE_CONNECTED;
+ features[FEAT_BEFORE_CONNECTED].prepare_async =
+ prepare_before_connected_async;
+ features[FEAT_BEFORE_CONNECTED].prepare_before_signalling_connected_async =
+ prepare_before_connected_before_async;
+
+ features[FEAT_INTERFACE_LATER].name =
+ TP_TESTS_MY_CONN_PROXY_FEATURE_INTERFACE_LATER;
+ features[FEAT_INTERFACE_LATER].prepare_async = prepare_interface_later_async;
+ need_iface_later[0] = g_quark_from_static_string (
+ TP_TESTS_MY_CONN_PROXY_IFACE_LATER);
+ features[FEAT_INTERFACE_LATER].interfaces_needed = need_iface_later;
+
+ return features;
+}
+
+static void
+tp_tests_my_conn_proxy_class_init (TpTestsMyConnProxyClass *klass)
+{
+ TpProxyClass *proxy_class = (TpProxyClass *) klass;
+
+ proxy_class->list_features = list_features;
+}
+
+GQuark
+tp_tests_my_conn_proxy_get_feature_quark_core (void)
+{
+ return g_quark_from_static_string ("tp-my-conn-proxy-feature-core");
+}
+
+GQuark
+tp_tests_my_conn_proxy_get_feature_quark_a (void)
+{
+ return g_quark_from_static_string ("tp-my-conn-proxy-feature-a");
+}
+
+GQuark
+tp_tests_my_conn_proxy_get_feature_quark_b (void)
+{
+ return g_quark_from_static_string ("tp-my-conn-proxy-feature-b");
+}
+
+GQuark
+tp_tests_my_conn_proxy_get_feature_quark_wrong_iface (void)
+{
+ return g_quark_from_static_string ("tp-my-conn-proxy-feature-wrong_iface");
+}
+
+GQuark
+tp_tests_my_conn_proxy_get_feature_quark_bad_dep (void)
+{
+ return g_quark_from_static_string ("tp-my-conn-proxy-feature-bad-dep");
+}
+
+GQuark
+tp_tests_my_conn_proxy_get_feature_quark_fail (void)
+{
+ return g_quark_from_static_string ("tp-my-conn-proxy-feature-fail");
+}
+
+GQuark
+tp_tests_my_conn_proxy_get_feature_quark_fail_dep (void)
+{
+ return g_quark_from_static_string ("tp-my-conn-proxy-feature-fail-dep");
+}
+
+GQuark
+tp_tests_my_conn_proxy_get_feature_quark_retry (void)
+{
+ return g_quark_from_static_string ("tp-my-conn-proxy-feature-retry");
+}
+
+GQuark
+tp_tests_my_conn_proxy_get_feature_quark_retry_dep (void)
+{
+ return g_quark_from_static_string ("tp-my-conn-proxy-feature-retry-dep");
+}
+
+GQuark
+tp_tests_my_conn_proxy_get_feature_quark_before_connected (void)
+{
+ return g_quark_from_static_string ("tp-my-conn-proxy-feature-before-connected");
+}
+
+GQuark
+tp_tests_my_conn_proxy_get_feature_quark_interface_later (void)
+{
+ return g_quark_from_static_string ("tp-my-conn-proxy-feature-interface-later");
+}
diff --git a/tests/lib/telepathy/contactlist/my-conn-proxy.h b/tests/lib/telepathy/contactlist/my-conn-proxy.h
new file mode 100644
index 0000000..e667c72
--- /dev/null
+++ b/tests/lib/telepathy/contactlist/my-conn-proxy.h
@@ -0,0 +1,128 @@
+/*
+ * my-conn-proxy.h - header for a simple subclass of TpConnection
+ *
+ * Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
+ *
+ * Copying and distribution of this file, with or without modification,
+ * are permitted in any medium without royalty provided the copyright
+ * notice and this notice are preserved.
+ */
+
+#ifndef __TP_TESTS_MY_CONN_PROXY_H__
+#define __TP_TESTS_MY_CONN_PROXY_H__
+
+#include <glib-object.h>
+#include <telepathy-glib/telepathy-glib.h>
+
+
+G_BEGIN_DECLS
+
+typedef struct _TpTestsMyConnProxy TpTestsMyConnProxy;
+typedef struct _TpTestsMyConnProxyClass TpTestsMyConnProxyClass;
+typedef struct _TpTestsMyConnProxyPrivate TpTestsMyConnProxyPrivate;
+
+struct _TpTestsMyConnProxyClass {
+ TpConnectionClass parent_class;
+};
+
+typedef enum
+{
+ BEFORE_CONNECTED_STATE_UNPREPARED = 0,
+ BEFORE_CONNECTED_STATE_NOT_CONNECTED,
+ BEFORE_CONNECTED_STATE_CONNECTED,
+} TpTestsMyConnProxyBeforeConnectedState;
+
+
+struct _TpTestsMyConnProxy {
+ TpConnection parent;
+
+ gboolean retry_feature_success;
+ TpTestsMyConnProxyBeforeConnectedState before_connected_state;
+};
+
+GType tp_tests_my_conn_proxy_get_type (void);
+
+/* TYPE MACROS */
+#define TP_TESTS_TYPE_MY_CONN_PROXY \
+ (tp_tests_my_conn_proxy_get_type ())
+#define TP_TESTS_MY_CONN_PROXY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_MY_CONN_PROXY, \
+ TpTestsMyConnProxy))
+#define TP_TESTS_MY_CONN_PROXY_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_MY_CONN_PROXY, \
+ TpTestsMyConnProxyClass))
+#define TP_TESTS_SIMPLE_IS_MY_CONN_PROXY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_MY_CONN_PROXY))
+#define TP_TESTS_SIMPLE_IS_MY_CONN_PROXY_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_MY_CONN_PROXY))
+#define TP_TESTS_MY_CONN_PROXY_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_MY_CONN_PROXY, \
+ TpTestsMyConnProxyClass))
+
+/* Core feature */
+#define TP_TESTS_MY_CONN_PROXY_FEATURE_CORE \
+ (tp_tests_my_conn_proxy_get_feature_quark_core ())
+GQuark tp_tests_my_conn_proxy_get_feature_quark_core (void) G_GNUC_CONST;
+
+/* No depends */
+#define TP_TESTS_MY_CONN_PROXY_FEATURE_A \
+ (tp_tests_my_conn_proxy_get_feature_quark_a ())
+GQuark tp_tests_my_conn_proxy_get_feature_quark_a (void) G_GNUC_CONST;
+
+/* Depends on A */
+#define TP_TESTS_MY_CONN_PROXY_FEATURE_B \
+ (tp_tests_my_conn_proxy_get_feature_quark_b ())
+GQuark tp_tests_my_conn_proxy_get_feature_quark_b (void) G_GNUC_CONST;
+
+/* Depends on an unimplemented iface */
+#define TP_TESTS_MY_CONN_PROXY_FEATURE_WRONG_IFACE \
+ (tp_tests_my_conn_proxy_get_feature_quark_wrong_iface ())
+GQuark tp_tests_my_conn_proxy_get_feature_quark_wrong_iface (void) G_GNUC_CONST;
+
+/* Depends on WRONG_IFACE */
+#define TP_TESTS_MY_CONN_PROXY_FEATURE_BAD_DEP \
+ (tp_tests_my_conn_proxy_get_feature_quark_bad_dep ())
+GQuark tp_tests_my_conn_proxy_get_feature_quark_bad_dep (void) G_GNUC_CONST;
+
+/* Fail during preparation */
+#define TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL \
+ (tp_tests_my_conn_proxy_get_feature_quark_fail ())
+GQuark tp_tests_my_conn_proxy_get_feature_quark_fail (void) G_GNUC_CONST;
+
+/* Depends on FAIL */
+#define TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL_DEP \
+ (tp_tests_my_conn_proxy_get_feature_quark_fail_dep ())
+GQuark tp_tests_my_conn_proxy_get_feature_quark_fail_dep (void) G_GNUC_CONST;
+
+/* Fail at first attempt but succeed after */
+#define TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY \
+ (tp_tests_my_conn_proxy_get_feature_quark_retry ())
+GQuark tp_tests_my_conn_proxy_get_feature_quark_retry (void) G_GNUC_CONST;
+
+/* Depends on FEATURE_RETRY */
+#define TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY_DEP \
+ (tp_tests_my_conn_proxy_get_feature_quark_retry_dep ())
+GQuark tp_tests_my_conn_proxy_get_feature_quark_retry_dep (void) G_GNUC_CONST;
+
+/* Can be prepared before the connection is connected and block announcing the
+ * connected state */
+#define TP_TESTS_MY_CONN_PROXY_FEATURE_BEFORE_CONNECTED \
+ (tp_tests_my_conn_proxy_get_feature_quark_before_connected ())
+GQuark tp_tests_my_conn_proxy_get_feature_quark_before_connected (void) G_GNUC_CONST;
+
+#define TP_TESTS_MY_CONN_PROXY_IFACE_LATER \
+ TP_IFACE_CONNECTION_INTERFACE_POWER_SAVING1
+
+#define TP_TESTS_TYPE_SVC_CONNECTION_INTERFACE_LATER \
+ TP_TYPE_SVC_CONNECTION_INTERFACE_POWER_SAVING1
+
+/* Need the interface TP_TESTS_MY_CONN_PROXY_IFACE_LATER to be prepared but
+ * this interface is not in the initial set of interfaces of the connection.
+ * It is added when the connection is connected. */
+#define TP_TESTS_MY_CONN_PROXY_FEATURE_INTERFACE_LATER \
+ (tp_tests_my_conn_proxy_get_feature_quark_interface_later ())
+GQuark tp_tests_my_conn_proxy_get_feature_quark_interface_later (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* #ifndef __TP_TESTS_MY_CONN_PROXY_H__ */
diff --git a/tests/lib/telepathy/contactlist/room-list-chan.h
b/tests/lib/telepathy/contactlist/room-list-chan.h
index 52dbd2e..a05921a 100644
--- a/tests/lib/telepathy/contactlist/room-list-chan.h
+++ b/tests/lib/telepathy/contactlist/room-list-chan.h
@@ -4,6 +4,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
G_BEGIN_DECLS
diff --git a/tests/lib/telepathy/contactlist/simple-account-manager.h
b/tests/lib/telepathy/contactlist/simple-account-manager.h
index cc65f09..0ed114d 100644
--- a/tests/lib/telepathy/contactlist/simple-account-manager.h
+++ b/tests/lib/telepathy/contactlist/simple-account-manager.h
@@ -14,7 +14,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
-
+#include <telepathy-glib/telepathy-glib-dbus.h>
G_BEGIN_DECLS
diff --git a/tests/lib/telepathy/contactlist/simple-account.h
b/tests/lib/telepathy/contactlist/simple-account.h
index b5da2af..a7fdcf2 100644
--- a/tests/lib/telepathy/contactlist/simple-account.h
+++ b/tests/lib/telepathy/contactlist/simple-account.h
@@ -14,6 +14,7 @@
#include <glib-object.h>
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
G_BEGIN_DECLS
diff --git a/tests/lib/telepathy/contactlist/simple-conn.c b/tests/lib/telepathy/contactlist/simple-conn.c
index 9acea0a..e7a04fd 100644
--- a/tests/lib/telepathy/contactlist/simple-conn.c
+++ b/tests/lib/telepathy/contactlist/simple-conn.c
@@ -24,16 +24,14 @@
#include "room-list-chan.h"
#include "util.h"
-G_DEFINE_TYPE_WITH_CODE (TpTestsSimpleConnection, tp_tests_simple_connection,
- TP_TYPE_BASE_CONNECTION,
- G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION, NULL))
+G_DEFINE_TYPE (TpTestsSimpleConnection, tp_tests_simple_connection,
+ TP_TYPE_BASE_CONNECTION)
/* type definition stuff */
enum
{
PROP_ACCOUNT = 1,
- PROP_DBUS_STATUS,
N_PROPS
};
@@ -70,12 +68,7 @@ get_property (GObject *object,
case PROP_ACCOUNT:
g_value_set_string (value, self->priv->account);
break;
- case PROP_DBUS_STATUS:
- {
- g_value_set_uint (value,
- tp_base_connection_get_status (TP_BASE_CONNECTION (self)));
- }
- break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec);
}
@@ -277,14 +270,6 @@ tp_tests_simple_connection_class_init (TpTestsSimpleConnectionClass *klass)
"The username of this user", NULL,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec);
-
- param_spec = g_param_spec_uint ("dbus-status",
- "Connection.Status",
- "The connection status as visible on D-Bus (overridden so can break it)",
- TP_CONNECTION_STATUS_CONNECTED, G_MAXUINT,
- TP_CONNECTION_STATUS_DISCONNECTED,
- G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_DBUS_STATUS, param_spec);
}
void
@@ -349,7 +334,15 @@ tp_tests_simple_connection_ensure_text_chan (TpTestsSimpleConnection *self,
g_object_get (chan, "object-path", &chan_path, NULL);
if (props != NULL)
- g_object_get (chan, "channel-properties", props, NULL);
+ {
+ GVariant *tmp;
+
+ g_object_get (chan,
+ "channel-properties", &tmp,
+ NULL);
+ *props = tp_asv_from_vardict (tmp);
+ g_variant_unref (tmp);
+ }
return chan_path;
}
@@ -393,8 +386,15 @@ tp_tests_simple_connection_ensure_room_list_chan (TpTestsSimpleConnection *self,
}
if (props != NULL)
- g_object_get (self->priv->room_list_chan,
- "channel-properties", props, NULL);
+ {
+ GVariant *tmp;
+
+ g_object_get (self->priv->room_list_chan,
+ "channel-properties", &tmp,
+ NULL);
+ *props = tp_asv_from_vardict (tmp);
+ g_variant_unref (tmp);
+ }
return chan_path;
}
diff --git a/tests/telepathy/Makefile.am b/tests/telepathy/Makefile.am
index dd52fc5..cf1b71b 100644
--- a/tests/telepathy/Makefile.am
+++ b/tests/telepathy/Makefile.am
@@ -20,6 +20,7 @@ AM_VALAFLAGS = \
AM_CPPFLAGS = \
$(test_cppflags) \
$(TP_GLIB_CFLAGS) \
+ $(TP_GLIB_DBUS_CFLAGS) \
-I$(top_srcdir)/backends/telepathy \
-I$(top_srcdir)/backends/telepathy/lib \
-I$(top_srcdir)/backends/telepathy/lib/folks \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]