aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test-gtk-submenu-client.c9
-rw-r--r--tests/test-gtk-submenu-server.c17
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);