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

Unified Diff: third_party/xdg-utils/tests/xdg-mime/t.11-user_mime_uninstall

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-mime/t.11-user_mime_uninstall
===================================================================
--- third_party/xdg-utils/tests/xdg-mime/t.11-user_mime_uninstall (revision 0)
+++ third_party/xdg-utils/tests/xdg-mime/t.11-user_mime_uninstall (revision 0)
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+## Include utility functions.
+. "$XDG_TEST_DIR/include/testassertions.sh"
+. "$XDG_TEST_DIR/include/testcontrol.sh"
+
+## Test function
+test_user_mime_uninstall() {
+# TODO: should follow the filename tests.
+QUERY_FILE="testfile.xdgtest"
+
+## Begin the test.
+test_start "$FUNCNAME: uninstall user mime type"
+test_purpose "Verify that mime types get removed from the user space correctly."
+
+# Dependencies section
+test_init
+
+require_notroot
+
+use_file "$XDG_TEST_DIR/xdg-mime/data/testmime.xml" INPUT_FILE
+edit_file "$INPUT_FILE" "x-xdg-testpattern" TEST_MIME "x-$XDG_TEST_ID"
+assert_file "$INPUT_FILE"
+echo "text/$TEST_MIME" >testmime.expected
+
+echo "Some text." >testfile.xdgtest
+assert_file testfile.xdgtest
+
+assert_exit 0 xdg-mime query filetype testfile.xdgtest
+assert_stdout
+mv out.stdout origmime.save
+
+# Install & verify mime type is installed
+assert_exit 0 xdg-mime install --mode user "$INPUT_FILE"
+assert_exit 0 xdg-mime query filetype testfile.xdgtest
+assert_stdout testmime.expected
+
+# Test steps section
+test_procedure
+
+assert_exit 0 xdg-mime uninstall --mode user "$INPUT_FILE"
+assert_nostdout
+assert_nostderr
+
+## Verify uninstall
+assert_exit 0 xdg-mime query filetype $QUERY_FILE
+assert_stdout origmime.save
+
+test_result
+}
+run_test test_user_mime_uninstall
Property changes on: third_party/xdg-utils/tests/xdg-mime/t.11-user_mime_uninstall
___________________________________________________________________
Name: svn:executable
+ *

Powered by Google App Engine
This is Rietveld 408576698