]> git.0d.be Git - empathy.git/commitdiff
add test-empathy-roster-view
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 11 May 2012 13:30:10 +0000 (15:30 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 14 Jun 2012 07:21:45 +0000 (09:21 +0200)
tests/interactive/.gitignore
tests/interactive/Makefile.am
tests/interactive/test-empathy-roster-view.c [new file with mode: 0644]

index 535570e165374a1f36239ebd29b0dc7f21e5650b..0ca660767890db905b493cc09eab16e62b120588 100644 (file)
@@ -10,3 +10,4 @@ test-empathy-status-preset-dialog
 test-empathy-protocol-chooser
 test-empathy-account-chooser
 test-empathy-calendar-button
+test-empathy-roster-view
index ba82180d5b8ddd41c6c15652faf2dc2ed3bfa292..d396f3908e6b3f738763a5f739efe7c9e3b94c08 100644 (file)
@@ -18,7 +18,8 @@ noinst_PROGRAMS =                     \
        test-empathy-status-preset-dialog \
        test-empathy-protocol-chooser \
        test-empathy-account-chooser \
-       test-empathy-calendar-button
+       test-empathy-calendar-button \
+       test-empathy-roster-view
 
 empathy_logs_SOURCES = empathy-logs.c
 test_empathy_contact_blocking_dialog_SOURCES = test-empathy-contact-blocking-dialog.c
@@ -27,3 +28,4 @@ test_empathy_status_preset_dialog_SOURCES = test-empathy-status-preset-dialog.c
 test_empathy_protocol_chooser_SOURCES = test-empathy-protocol-chooser.c
 test_empathy_account_chooser_SOURCES = test-empathy-account-chooser.c
 test_empathy_calendar_button_SOURCES = test-empathy-calendar-button.c
+test_empathy_roster_view_SOURCES = test-empathy-roster-view.c
diff --git a/tests/interactive/test-empathy-roster-view.c b/tests/interactive/test-empathy-roster-view.c
new file mode 100644 (file)
index 0000000..20515d9
--- /dev/null
@@ -0,0 +1,43 @@
+#include <config.h>
+
+#include <libempathy-gtk/empathy-roster-view.h>
+#include <libempathy-gtk/empathy-ui-utils.h>
+
+int
+main (int argc,
+    char **argv)
+{
+  GtkWidget *window, *view, *scrolled;
+  EmpathyIndividualManager *mgr;
+
+  gtk_init (&argc, &argv);
+  empathy_gtk_init ();
+
+  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+
+  empathy_set_css_provider (window);
+
+  mgr = empathy_individual_manager_dup_singleton ();
+
+  view = empathy_roster_view_new (mgr);
+
+  g_object_unref (mgr);
+
+  scrolled = gtk_scrolled_window_new (NULL, NULL);
+  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
+      GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+
+  egg_list_box_add_to_scrolled (EGG_LIST_BOX (view),
+      GTK_SCROLLED_WINDOW (scrolled));
+  gtk_container_add (GTK_CONTAINER (window), scrolled);
+
+  gtk_window_set_default_size (GTK_WINDOW (window), 300, 600);
+  gtk_widget_show_all (window);
+
+  g_signal_connect_swapped (window, "destroy",
+      G_CALLBACK (gtk_main_quit), NULL);
+
+  gtk_main ();
+
+  return 0;
+}