From 8d08c9ce5b488f09be435db11fbf26bf33e8ea00 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 5 Apr 2010 15:59:47 +0200 Subject: add tests/interactive/test-empathy-account-chooser.c --- tests/interactive/.gitignore | 1 + tests/interactive/Makefile.am | 4 ++- tests/interactive/test-empathy-account-chooser.c | 45 ++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 tests/interactive/test-empathy-account-chooser.c (limited to 'tests') diff --git a/tests/interactive/.gitignore b/tests/interactive/.gitignore index f6f87d8b4..ebaa4d1e9 100644 --- a/tests/interactive/.gitignore +++ b/tests/interactive/.gitignore @@ -7,3 +7,4 @@ test-empathy-account-assistant test-empathy-presence-chooser test-empathy-status-preset-dialog test-empathy-protocol-chooser +test-empathy-account-chooser diff --git a/tests/interactive/Makefile.am b/tests/interactive/Makefile.am index 2f9696e64..8fc19eb3e 100644 --- a/tests/interactive/Makefile.am +++ b/tests/interactive/Makefile.am @@ -18,7 +18,8 @@ noinst_PROGRAMS = \ test-empathy-account-assistant \ test-empathy-presence-chooser \ test-empathy-status-preset-dialog \ - test-empathy-protocol-chooser + test-empathy-protocol-chooser \ + test-empathy-account-chooser contact_manager_SOURCES = contact-manager.c empathy_logs_SOURCES = empathy-logs.c @@ -27,6 +28,7 @@ test_empathy_presence_chooser_SOURCES = test-empathy-presence-chooser.c 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_assistant_SOURCES = test-empathy-account-assistant.c +test_empathy_account_chooser_SOURCES = test-empathy-account-chooser.c test_empathy_account_assistant_CFLAGS = -I$(top_srcdir)/src test_empathy_account_assistant_LDADD = \ diff --git a/tests/interactive/test-empathy-account-chooser.c b/tests/interactive/test-empathy-account-chooser.c new file mode 100644 index 000000000..d2ce7ccbc --- /dev/null +++ b/tests/interactive/test-empathy-account-chooser.c @@ -0,0 +1,45 @@ +#include + +#include + +#include +#include + +static gboolean +filter_func (TpAccount *account, + gpointer user_data) +{ + g_assert (TP_IS_ACCOUNT (account)); + return TRUE; +} + +int +main (int argc, + char **argv) +{ + GtkWidget *window, *c; + + gtk_init (&argc, &argv); + empathy_gtk_init (); + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + c = empathy_account_chooser_new (); + + empathy_account_chooser_set_has_all_option (EMPATHY_ACCOUNT_CHOOSER (c), + TRUE); + + empathy_account_chooser_set_filter (EMPATHY_ACCOUNT_CHOOSER (c), + filter_func, NULL); + + gtk_container_add (GTK_CONTAINER (window), c); + + /* gtk_window_set_default_size (GTK_WINDOW (window), 150, -1);*/ + gtk_widget_show_all (window); + + g_signal_connect_swapped (window, "destroy", + G_CALLBACK (gtk_main_quit), NULL); + + gtk_main (); + + return 0; +} -- cgit v1.2.3