[empathy] add test-empathy-roster-view



commit ea95d2c328587a287cd3854683967f097241c063
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Fri May 11 15:30:10 2012 +0200

    add test-empathy-roster-view

 tests/interactive/.gitignore                 |    1 +
 tests/interactive/Makefile.am                |    4 ++-
 tests/interactive/test-empathy-roster-view.c |   43 ++++++++++++++++++++++++++
 3 files changed, 47 insertions(+), 1 deletions(-)
---
diff --git a/tests/interactive/.gitignore b/tests/interactive/.gitignore
index 535570e..0ca6607 100644
--- a/tests/interactive/.gitignore
+++ b/tests/interactive/.gitignore
@@ -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
diff --git a/tests/interactive/Makefile.am b/tests/interactive/Makefile.am
index ba82180..d396f39 100644
--- a/tests/interactive/Makefile.am
+++ b/tests/interactive/Makefile.am
@@ -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
index 0000000..20515d9
--- /dev/null
+++ b/tests/interactive/test-empathy-roster-view.c
@@ -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;
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]