summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-11-03 11:48:17 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-11-03 12:49:58 +0100
commit252e1801e2f781a0ec8f3732a878fa87cef8402f (patch)
tree75cab9ed2922ef65906a03c4eb4328a81c90fd4b
parent3b40037ad760793c912c1cf391f69f9cc2c4cda3 (diff)
test that contact list properties are set
https://bugs.freedesktop.org/show_bug.cgi?id=42546
-rw-r--r--tests/dbus/contact-list-client.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/dbus/contact-list-client.c b/tests/dbus/contact-list-client.c
index 35abf6b5..6f2d5ff9 100644
--- a/tests/dbus/contact-list-client.c
+++ b/tests/dbus/contact-list-client.c
@@ -503,6 +503,34 @@ test_is_blocked (Test *test,
g_assert (!tp_contact_is_blocked (test->contact));
}
+static void
+test_contact_list_properties (Test *test,
+ gconstpointer data G_GNUC_UNUSED)
+{
+ GQuark conn_features[] = { TP_CONNECTION_FEATURE_CONTACT_LIST, 0 };
+
+ /* Feature isn't prepared yet */
+ g_assert (!tp_proxy_is_prepared (test->connection,
+ TP_CONNECTION_FEATURE_CONTACT_LIST));
+
+ g_assert_cmpuint (tp_connection_get_contact_list_state (test->connection), ==,
+ TP_CONTACT_LIST_STATE_NONE);
+ g_assert (!tp_connection_get_contact_list_persists (test->connection));
+ g_assert (!tp_connection_get_can_change_contact_list (test->connection));
+ g_assert (!tp_connection_get_request_uses_message (test->connection));
+
+ tp_proxy_prepare_async (test->connection, conn_features,
+ proxy_prepare_cb, test);
+
+ test->wait = 1;
+ g_main_loop_run (test->mainloop);
+ g_assert_no_error (test->error);
+
+ g_assert (tp_connection_get_contact_list_persists (test->connection));
+ g_assert (tp_connection_get_can_change_contact_list (test->connection));
+ g_assert (tp_connection_get_request_uses_message (test->connection));
+}
+
int
main (int argc,
char **argv)
@@ -521,5 +549,8 @@ main (int argc,
g_test_add ("/contact-list-client/blocking/is-blocked", Test, NULL,
setup, test_is_blocked, teardown);
+ g_test_add ("/contact-list-client/contact-list/properties", Test, NULL,
+ setup, test_contact_list_properties, teardown);
+
return g_test_run ();
}