diff options
| author | Ted Gould <ted@gould.cx> | 2010-08-25 13:19:05 -0500 |
|---|---|---|
| committer | Ted Gould <ted@gould.cx> | 2010-08-25 13:19:05 -0500 |
| commit | 3bd4b8dce9460159945a9cc24f0bc8aba7e62898 (patch) | |
| tree | d94605af07736d1eb037a64c106c2705db319634 /tests | |
| parent | ced95a80cc2cf2664c171879069b5c9753379dd9 (diff) | |
| parent | 15501ea22301d17dc7d193f1ece226ee657e59c3 (diff) | |
| download | libdbusmenu-3bd4b8dce9460159945a9cc24f0bc8aba7e62898.tar.gz libdbusmenu-3bd4b8dce9460159945a9cc24f0bc8aba7e62898.tar.bz2 libdbusmenu-3bd4b8dce9460159945a9cc24f0bc8aba7e62898.zip | |
Sync to trunk
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-gtk-submenu-client.c | 9 | ||||
| -rw-r--r-- | tests/test-gtk-submenu-server.c | 17 |
2 files changed, 24 insertions, 2 deletions
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); |
