aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-12-02 22:19:52 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-12-02 22:24:10 +0800
commita9c67f126de7715edfeb49789108878f3d0da784 (patch)
tree0e379d54c0da86f88c1de01dec6232af778778d6 /tests
parent0fdc28006acf7be50776e237969bc31b38245e32 (diff)
downloadgsoc2013-empathy-a9c67f126de7715edfeb49789108878f3d0da784.tar
gsoc2013-empathy-a9c67f126de7715edfeb49789108878f3d0da784.tar.gz
gsoc2013-empathy-a9c67f126de7715edfeb49789108878f3d0da784.tar.bz2
gsoc2013-empathy-a9c67f126de7715edfeb49789108878f3d0da784.tar.lz
gsoc2013-empathy-a9c67f126de7715edfeb49789108878f3d0da784.tar.xz
gsoc2013-empathy-a9c67f126de7715edfeb49789108878f3d0da784.tar.zst
gsoc2013-empathy-a9c67f126de7715edfeb49789108878f3d0da784.zip
contact-blocking-dialog: stop using EmpathyContactManager
https://bugzilla.gnome.org/show_bug.cgi?id=660547
Diffstat (limited to 'tests')
-rw-r--r--tests/interactive/test-empathy-contact-blocking-dialog.c42
1 files changed, 35 insertions, 7 deletions
diff --git a/tests/interactive/test-empathy-contact-blocking-dialog.c b/tests/interactive/test-empathy-contact-blocking-dialog.c
index 801bd0b50..66353f13d 100644
--- a/tests/interactive/test-empathy-contact-blocking-dialog.c
+++ b/tests/interactive/test-empathy-contact-blocking-dialog.c
@@ -23,26 +23,54 @@
#include <gtk/gtk.h>
-#include <libempathy/empathy-contact-manager.h>
+#include <libempathy/empathy-client-factory.h>
#include <libempathy-gtk/empathy-ui-utils.h>
#include <libempathy-gtk/empathy-contact-blocking-dialog.h>
+static void
+am_prepare_cb (GObject *source,
+ GAsyncResult *result,
+ gpointer user_data)
+{
+ GMainLoop *loop = user_data;
+ GtkWidget *dialog;
+
+ dialog = empathy_contact_blocking_dialog_new (NULL);
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+
+ g_main_loop_quit (loop);
+}
+
int
main (int argc,
char **argv)
{
- EmpathyContactManager *manager;
- GtkWidget *dialog;
+ EmpathyClientFactory *factory;
+ TpAccountManager *am;
+ GMainLoop *loop;
gtk_init (&argc, &argv);
empathy_gtk_init ();
- manager = empathy_contact_manager_dup_singleton ();
- dialog = empathy_contact_blocking_dialog_new (NULL);
+ /* The blocking dialog needs the contact list for the contacts completion
+ * so we prepare it first. */
+ factory = empathy_client_factory_dup ();
- gtk_dialog_run (GTK_DIALOG (dialog));
+ tp_simple_client_factory_add_connection_features_varargs (
+ TP_SIMPLE_CLIENT_FACTORY (factory),
+ TP_CONNECTION_FEATURE_CONTACT_LIST,
+ NULL);
+
+ am = tp_account_manager_dup ();
+
+ loop = g_main_loop_new (NULL, FALSE);
+
+ tp_proxy_prepare_async (am, NULL, am_prepare_cb, loop);
+
+ g_main_loop_run (loop);
- g_object_unref (manager);
+ g_object_unref (am);
return 0;
}