diff options
-rw-r--r-- | tests/test-desktop-shortcuts.c | 20 | ||||
-rw-r--r-- | tests/test-well-formed.desktop | 6 |
2 files changed, 25 insertions, 1 deletions
diff --git a/tests/test-desktop-shortcuts.c b/tests/test-desktop-shortcuts.c index 02137ef..7594e51 100644 --- a/tests/test-desktop-shortcuts.c +++ b/tests/test-desktop-shortcuts.c @@ -92,12 +92,32 @@ test_desktop_shortcuts_nicknames (void) return; } +/* Try executing a shortcut which will touch a file */ +void +test_desktop_shortcuts_launch (void) +{ + IndicatorDesktopShortcuts * ids = indicator_desktop_shortcuts_new(SRCDIR "/test-well-formed.desktop", "Touch"); + g_assert(ids != NULL); + + const gchar ** nicks = indicator_desktop_shortcuts_get_nicks(ids); + g_assert(nicks[0] != NULL); + + g_assert(indicator_desktop_shortcuts_nick_exec(ids, nicks[0])); + g_assert(g_file_test("test-desktop-shortcuts-touch-test", G_FILE_TEST_EXISTS)); + + g_object_unref(ids); + + return; +} + +/* Build our test suite */ void test_desktop_shortcuts_suite (void) { g_test_add_func ("/libindicator/desktopshortcuts/creation", test_desktop_shortcuts_creation); g_test_add_func ("/libindicator/desktopshortcuts/globalnosho", test_desktop_shortcuts_globalnoshow); g_test_add_func ("/libindicator/desktopshortcuts/nicknames", test_desktop_shortcuts_nicknames); + g_test_add_func ("/libindicator/desktopshortcuts/launch", test_desktop_shortcuts_launch); return; } diff --git a/tests/test-well-formed.desktop b/tests/test-well-formed.desktop index dc2744f..84e2e02 100644 --- a/tests/test-well-formed.desktop +++ b/tests/test-well-formed.desktop @@ -2,7 +2,7 @@ Name=My Application Exec=ls NotShowIn=Germany -X-Ayatana-Desktop-Shortcuts=bob;alvin;jim +X-Ayatana-Desktop-Shortcuts=bob;alvin;jim;touch [bob Shortcut Group] Name=bob's shortcut @@ -18,3 +18,7 @@ Name=Jim's shortcut Exec=ls jim NotShowIn=France +[touch Shortcut Group] +Name=Touch Test +Exec=touch test-desktop-shortcuts-touch-test +OnlyShowIn=TouchTest |