From b8b16bdfc5f52a306bacaa34776c3d159e16fbc2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 20 Aug 2010 16:52:02 -0500 Subject: Showing items as part of the test to ensure we don't break. --- tests/test-gtk-submenu-client.c | 9 ++++++++- tests/test-gtk-submenu-server.c | 17 ++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test-gtk-submenu-client.c b/tests/test-gtk-submenu-client.c index 2e1ef7a..ec46122 100644 --- a/tests/test-gtk-submenu-client.c +++ b/tests/test-gtk-submenu-client.c @@ -102,6 +102,12 @@ timer_func (gpointer data) } passed = TRUE; + return FALSE; +} + +gboolean +finished_func (gpointer user_data) +{ g_main_loop_quit(mainloop); return FALSE; } @@ -127,7 +133,8 @@ main (int argc, char ** argv) gtk_window_set_title(GTK_WINDOW(window), "libdbusmenu-gtk test"); gtk_widget_show(window); - g_timeout_add_seconds(1, timer_func, menuitem); + g_timeout_add_seconds(2, timer_func, menuitem); + g_timeout_add_seconds(6, finished_func, menuitem); g_debug("Entering Mainloop"); mainloop = g_main_loop_new(NULL, FALSE); diff --git a/tests/test-gtk-submenu-server.c b/tests/test-gtk-submenu-server.c index ba3993e..11cede0 100644 --- a/tests/test-gtk-submenu-server.c +++ b/tests/test-gtk-submenu-server.c @@ -39,6 +39,17 @@ timer_func (gpointer data) return FALSE; } +static gboolean +show_item (gpointer pmi) +{ + DbusmenuMenuitem * mi = DBUSMENU_MENUITEM(pmi); + g_debug("Showing item"); + + dbusmenu_menuitem_show_to_user(mi, 0); + + return FALSE; +} + DbusmenuMenuitem * add_item(DbusmenuMenuitem * parent, const char * label) { @@ -81,12 +92,16 @@ main (int argc, char ** argv) add_item(item, "1.2"); add_item(item, "1.3"); + g_timeout_add_seconds(2, show_item, item); + item = add_item(root, "Folder 2"); add_item(item, "2.1"); add_item(item, "2.2"); add_item(item, "2.3"); - g_timeout_add_seconds(3, timer_func, NULL); + g_timeout_add_seconds(4, show_item, item); + + g_timeout_add_seconds(6, timer_func, NULL); mainloop = g_main_loop_new(NULL, FALSE); g_main_loop_run(mainloop); -- cgit v1.2.3 From db3d95c01f91456d042c507c9dfe91e75276c5e8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Aug 2010 14:17:39 -0500 Subject: Removing death timer message --- tests/test-gtk-label-client.c | 1 - 1 file changed, 1 deletion(-) (limited to 'tests') diff --git a/tests/test-gtk-label-client.c b/tests/test-gtk-label-client.c index 070c278..4316b8e 100644 --- a/tests/test-gtk-label-client.c +++ b/tests/test-gtk-label-client.c @@ -105,7 +105,6 @@ verify_root_to_layout(DbusmenuMenuitem * mi, proplayout_t * layout) static gboolean timer_func (gpointer data) { - g_debug("Death timer. Oops. Got to: %d", layouton); passed = TRUE; g_main_loop_quit(mainloop); return FALSE; -- cgit v1.2.3 From 510263800720ca5f8980ade0a3d0e9d564b3ddff Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Aug 2010 15:18:19 -0500 Subject: Removing unused variable --- tests/test-gtk-label-client.c | 1 - 1 file changed, 1 deletion(-) (limited to 'tests') diff --git a/tests/test-gtk-label-client.c b/tests/test-gtk-label-client.c index 4316b8e..14eb5bd 100644 --- a/tests/test-gtk-label-client.c +++ b/tests/test-gtk-label-client.c @@ -22,7 +22,6 @@ with this program. If not, see . #include #include -static guint layouton = 0; static GMainLoop * mainloop = NULL; static gboolean passed = TRUE; static guint death_timer = 0; -- cgit v1.2.3