Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Unified Diff: third_party/xdg-utils/tests/xdg-desktop-icon/t.04-desktop_icon_install

Issue 151098: Patch from mdm@google.com... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/xdg-utils/tests/xdg-desktop-icon/t.04-desktop_icon_install
===================================================================
--- third_party/xdg-utils/tests/xdg-desktop-icon/t.04-desktop_icon_install (revision 0)
+++ third_party/xdg-utils/tests/xdg-desktop-icon/t.04-desktop_icon_install (revision 0)
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+## Include utility functions.
+. "$XDG_TEST_DIR/include/testassertions.sh"
+. "$XDG_TEST_DIR/include/testcontrol.sh"
+
+## Test function
+test_desktop_icon_install() {
+## Begin the test.
+test_start "$FUNCNAME: verify a desktop file installed correctly on the desktop"
+
+# Dependencies section
+test_init
+
+# Generate .desktop file
+use_file "$XDG_TEST_DIR/xdg-desktop-icon/data/desktop_icon_install.desktop" DESK_FILE
+edit_file "$DESK_FILE" 'xdg-test-desktop-icon-install.tmp' CREATE_FILE
+edit_file "$DESK_FILE" 'Desktop_Icon' ICON_TEXT "Install $XDG_TEST_SHORTID"
+assert_file "$DESK_FILE"
+DESKTOP="$HOME/Desktop"
+
+set_no_display
+
+# Verify the test icon is not installed already.
+assert_file_not_in_path "$DESK_FILE" "$DESKTOP"
+assert_nofile "$HOME/$CREATE_FILE"
+
+# Test steps section
+test_procedure
+
+assert_exit 0 xdg-desktop-icon install "$DESK_FILE"
+assert_nostdout
+assert_nostderr
+
+assert_file_in_path "$DESK_FILE" "$DESKTOP"
+
+if [ -z "$XDG_TEST_NO_INTERACTIVE" ] && [ `whoami` != root ] ; then
+assert_interactive "Is there an icon on the desktop with name '$ICON_TEXT'?" y
+assert_interactive "Please double click the '$ICON_TEXT' icon."
+
+## Double clicking will result in the command 'touch xdg-test-desktop-icon-install.tmp' to be run
+assert_file "$HOME/$CREATE_FILE"
+
+
+## Cleanup
+rm -f "$HOME/$CREATE_FILE"
+fi
+xdg-desktop-icon uninstall "$DESK_FILE" >/dev/null 2>&1
+
+test_result
+}
+
+run_test test_desktop_icon_install
Property changes on: third_party/xdg-utils/tests/xdg-desktop-icon/t.04-desktop_icon_install
___________________________________________________________________
Name: svn:executable
+ *

Powered by Google App Engine
This is Rietveld 408576698