aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am5
-rw-r--r--tests/test-libappindicator.c35
-rw-r--r--tests/test-libappindicator.desktop23
3 files changed, 62 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f2bdbb2..9cecd5e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -13,7 +13,9 @@ check_PROGRAMS = \
TESTS =
DISTCLEANFILES = $(TESTS)
-EXTRA_DIST = run-xvfb.sh
+EXTRA_DIST = \
+ run-xvfb.sh \
+ test-libappindicator.desktop
#########################################
## test-libappindicator
@@ -24,6 +26,7 @@ test_libappindicator_SOURCES = \
test_libappindicator_CFLAGS = \
$(INDICATOR_CFLAGS) \
+ -DSRCDIR="\"$(srcdir)\"" \
-Wall -Werror \
-I$(top_srcdir)/src
diff --git a/tests/test-libappindicator.c b/tests/test-libappindicator.c
index 7a1976c..82f3d05 100644
--- a/tests/test-libappindicator.c
+++ b/tests/test-libappindicator.c
@@ -341,6 +341,39 @@ 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
+test_libappindicator_desktop_menu_bad (void)
+{
+
+
+
+}
+
+void
test_libappindicator_props_suite (void)
{
g_test_add_func ("/indicator-application/libappindicator/init", test_libappindicator_init);
@@ -350,6 +383,8 @@ test_libappindicator_props_suite (void)
g_test_add_func ("/indicator-application/libappindicator/set_label", test_libappindicator_set_label);
g_test_add_func ("/indicator-application/libappindicator/set_menu", test_libappindicator_set_menu);
g_test_add_func ("/indicator-application/libappindicator/label_signals", test_libappindicator_label_signals);
+ g_test_add_func ("/indicator-application/libappindicator/desktop_menu", test_libappindicator_desktop_menu);
+ g_test_add_func ("/indicator-application/libappindicator/desktop_menu_bad",test_libappindicator_desktop_menu_bad);
return;
}
diff --git a/tests/test-libappindicator.desktop b/tests/test-libappindicator.desktop
new file mode 100644
index 0000000..59be810
--- /dev/null
+++ b/tests/test-libappindicator.desktop
@@ -0,0 +1,23 @@
+[Desktop Entry]
+Name=AppIndicator Test
+GenericName=Test
+Comment=This is only a test
+Exec=/usr/bin/false
+Terminal=false
+Type=Application
+X-Ayatana-Desktop-Shortcuts=Short1;Short2;Short3;
+
+[Short1 Shortcut Group]
+Name=Shortcut 1
+Exec=/usr/bin/true
+OnlyShowIn=Test Program;
+
+[Short2 Shortcut Group]
+Name=Shortcut 2
+Exec=/usr/bin/true
+OnlyShowIn=Test Program;
+
+[Short3 Shortcut Group]
+Name=Shortcut 3
+Exec=/usr/bin/true
+OnlyShowIn=Test Program;