diff options
author | Ted Gould <ted@gould.cx> | 2010-02-16 21:40:50 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-16 21:40:50 -0600 |
commit | af36cb86cf0cb671cd8521e66562341a2a015fd1 (patch) | |
tree | 6aade9ec182e1a0ed1aa71a935e3b7f425605154 /tests | |
parent | e0bc1911d9618a2d8ac4d1d93de3e7f81d1a14ae (diff) | |
download | libayatana-indicator-af36cb86cf0cb671cd8521e66562341a2a015fd1.tar.gz libayatana-indicator-af36cb86cf0cb671cd8521e66562341a2a015fd1.tar.bz2 libayatana-indicator-af36cb86cf0cb671cd8521e66562341a2a015fd1.zip |
Add a test to launch an nick
Diffstat (limited to 'tests')
-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 |