summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-10-23 14:55:10 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-10-23 14:55:10 +0200
commit79acc094fb8d0136641022ae7e19e401e7aec8e5 (patch)
tree8aaf25a88ef39582642fc68d61630b783b55bc2e /tests
parent159b18dd5af2f618a5f5571fed870e65ccf110d9 (diff)
downloadtelepathy-glib-79acc094fb8d0136641022ae7e19e401e7aec8e5.tar.gz
add TpAccount::avatar-changed signal
Fix https://bugs.freedesktop.org/show_bug.cgi?id=52938
Diffstat (limited to 'tests')
-rw-r--r--tests/dbus/account.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/dbus/account.c b/tests/dbus/account.c
index eb21dc1e8..81ac8f159 100644
--- a/tests/dbus/account.c
+++ b/tests/dbus/account.c
@@ -690,6 +690,13 @@ test_addressing (Test *test,
}
static void
+avatar_changed_cb (TpAccount *account,
+ Test *test)
+{
+ g_main_loop_quit (test->mainloop);
+}
+
+static void
test_avatar (Test *test,
gconstpointer mode)
{
@@ -714,6 +721,27 @@ test_avatar (Test *test,
g_assert_cmpstr (((char *) blob->data), ==, ":-)");
tp_clear_object (&test->result);
+
+ /* change the avatar */
+ g_signal_connect (test->account, "avatar-changed",
+ G_CALLBACK (avatar_changed_cb), test);
+
+ tp_tests_simple_account_set_avatar (test->account_service, ":-(");
+ g_main_loop_run (test->mainloop);
+
+ tp_account_get_avatar_async (test->account,
+ tp_tests_result_ready_cb, &test->result);
+ tp_tests_run_until_result (&test->result);
+
+ blob = tp_account_get_avatar_finish (
+ test->account, test->result, &error);
+ g_assert_no_error (error);
+
+ g_assert (blob != NULL);
+ g_assert_cmpuint (blob->len, ==, 4);
+ g_assert_cmpstr (((char *) blob->data), ==, ":-(");
+
+ tp_clear_object (&test->result);
}
static void