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

Unified Diff: third_party/xdg-utils/tests/xdg-desktop-menu/t.02-menu_system_as_nonroot

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-menu/t.02-menu_system_as_nonroot
===================================================================
--- third_party/xdg-utils/tests/xdg-desktop-menu/t.02-menu_system_as_nonroot (revision 0)
+++ third_party/xdg-utils/tests/xdg-desktop-menu/t.02-menu_system_as_nonroot (revision 0)
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+## Include utility functions.
+. "$XDG_TEST_DIR/include/testassertions.sh"
+
+. "$XDG_TEST_DIR/include/testcontrol.sh"
+
+## Test function
+test_menu_system_as_nonroot() {
+USERPATH="${XDG_DATA_DIRS-/usr/local/share:/usr/share}:$HOME/.local:$HOME/.config:$XDG_DATA_HOME"
+
+## Begin the test.
+test_start "$FUNCNAME: verify error for --mode system when run as a normal user"
+
+# Dependencies section
+test_init
+
+require_notroot
+set_no_display
+
+use_file "$XDG_TEST_DIR/xdg-desktop-menu/data/menu_item_test.desktop" DESKTOP
+edit_file "$DESKTOP" 'xdg-test-menu-item-install.tmp' CREATEFILE
+assert_file "$DESKTOP"
+
+# Test steps section
+test_procedure
+
+assert_exit 3 xdg-desktop-menu install --mode system "$DESKTOP"
+assert_nostdout
+assert_stderr
+
+assert_file_not_in_path "$DESKTOP" "$USERPATH"
+
+assert_exit 3 xdg-desktop-menu uninstall --mode system "$DESKTOP"
+assert_nostdout
+assert_stderr
+
+test_result
+}
+run_test test_menu_system_as_nonroot
Property changes on: third_party/xdg-utils/tests/xdg-desktop-menu/t.02-menu_system_as_nonroot
___________________________________________________________________
Name: svn:executable
+ *

Powered by Google App Engine
This is Rietveld 408576698