aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test-libappindicator.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/test-libappindicator.c b/tests/test-libappindicator.c
index 46460f0..cadf783 100644
--- a/tests/test-libappindicator.c
+++ b/tests/test-libappindicator.c
@@ -386,9 +386,34 @@ test_libappindicator_desktop_menu (void)
void
test_libappindicator_desktop_menu_bad (void)
{
+ AppIndicator * ci = app_indicator_new ("my-id-desktop-menu-bad",
+ "my-name",
+ APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
+
+ g_assert(ci != NULL);
+ g_assert(app_indicator_get_label(ci) == NULL);
+ g_assert(app_indicator_get_label_guide(ci) == NULL);
+
+ app_indicator_build_menu_from_desktop(ci, SRCDIR "/test-libappindicator.desktop", "Not Test Program");
+
+ GValue serverval = {0};
+ g_value_init(&serverval, DBUSMENU_TYPE_SERVER);
+ g_object_get_property(G_OBJECT(ci), "dbus-menu-server", &serverval);
+ DbusmenuServer * server = DBUSMENU_SERVER(g_value_get_object(&serverval));
+ g_assert(server != NULL);
+ GValue rootval = {0};
+ g_value_init(&rootval, DBUSMENU_TYPE_MENUITEM);
+ g_object_get_property(G_OBJECT(server), DBUSMENU_SERVER_PROP_ROOT_NODE, &rootval);
+ DbusmenuMenuitem * root = DBUSMENU_MENUITEM(g_value_get_object(&rootval));
+ g_assert(root != NULL);
+
+ GList * children = dbusmenu_menuitem_get_children(root);
+ g_assert(g_list_length(children) == 0);
+ g_object_unref(G_OBJECT(ci));
+ return;
}
void