diff options
author | Ted Gould <ted@gould.cx> | 2010-11-08 12:10:46 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-11-08 12:10:46 -0500 |
commit | 52c706605c23a2b3b06e5f4262d5ea1ab1577567 (patch) | |
tree | a7a72e5ea0d031603d971ba05f556653611d81b8 | |
parent | 2e1b3533b988c227f5699bc88dc5df0e67669430 (diff) | |
download | libayatana-appindicator-52c706605c23a2b3b06e5f4262d5ea1ab1577567.tar.gz libayatana-appindicator-52c706605c23a2b3b06e5f4262d5ea1ab1577567.tar.bz2 libayatana-appindicator-52c706605c23a2b3b06e5f4262d5ea1ab1577567.zip |
Adding a test to check the number of items in the desktop file
-rw-r--r-- | tests/test-libappindicator.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test-libappindicator.c b/tests/test-libappindicator.c index 202c5e1..f340a67 100644 --- a/tests/test-libappindicator.c +++ b/tests/test-libappindicator.c @@ -296,9 +296,26 @@ test_libappindicator_label_signals (void) void test_libappindicator_desktop_menu (void) { + AppIndicator * ci = app_indicator_new ("my-id", + "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", "Test Program"); + GtkMenu * menu = app_indicator_get_menu(ci); + g_assert(menu != NULL); + + GList * children = gtk_container_get_children(GTK_CONTAINER(menu)); + g_assert(children != NULL); + g_assert(g_list_length(children) == 3); + + g_object_unref(G_OBJECT(ci)); + + return; } void |