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

Unified Diff: third_party/xdg-utils/tests/xdg-icon-resource/t.icon_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-icon-resource/t.icon_system_as_nonroot
===================================================================
--- third_party/xdg-utils/tests/xdg-icon-resource/t.icon_system_as_nonroot (revision 0)
+++ third_party/xdg-utils/tests/xdg-icon-resource/t.icon_system_as_nonroot (revision 0)
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+## Include utility functions.
+. "$XDG_TEST_DIR/include/testassertions.sh"
+
+. "$XDG_TEST_DIR/include/testcontrol.sh"
+
+## Test function
+test_icon_system_as_nonroot() {
+ICON_PATH="$HOME/.icons:${XDG_DATA_DIRS-/usr/local/share:/usr/share}:/usr/share/pixmaps:$HOME/.local/icons:$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/icons/red-32.png" ICONFILE
+assert_file "$ICONFILE"
+
+# Verify the test icon is not installed already.
+assert_file_not_in_path "$ICONFILE" "$ICON_PATH"
+
+# Test steps section
+test_procedure
+
+assert_exit 3 xdg-icon-resource install --mode system --size 32 "$ICONFILE"
+assert_nostdout
+assert_stderr
+
+assert_file_not_in_path "$ICONFILE" "$ICON_PATH"
+
+assert_exit 3 xdg-icon-resource uninstall --mode system --size 32 "$ICONFILE"
+assert_nostdout
+assert_stderr
+
+test_result
+}
+run_test test_icon_system_as_nonroot
Property changes on: third_party/xdg-utils/tests/xdg-icon-resource/t.icon_system_as_nonroot
___________________________________________________________________
Name: svn:executable
+ *

Powered by Google App Engine
This is Rietveld 408576698