Browse Source

reset prefs after testing the Preferences module

Myk Melez 15 years ago
parent
commit
8f3703a728
1 changed files with 17 additions and 0 deletions
  1. 17 0
      test/unit/test_Preferences.js

+ 17 - 0
test/unit/test_Preferences.js

@@ -1,5 +1,22 @@
 Components.utils.import("resource://jsmodules/Preferences.js");
 
+function run_test() {
+  // Run tests manually ourselves instead of letting the harness enumerate
+  // and run them so we can reset them all afterwards so they don't persist
+  // in the test profile and affect future test runs.
+  
+  // XXX Does this cause other prefs to get reset that should persist?
+
+  test_set_get_pref();
+  test_set_get_multiple_prefs();
+  test_reset_pref();
+  test_reset_pref_branch();
+  test_reset_nonexistent_pref();
+  test_reset_nonexistent_pref_branch();
+
+  Preferences.resetBranch("");
+}
+
 function test_set_get_pref() {
   Preferences.set("test_set_get_pref.integer", 1);
   do_check_eq(Preferences.get("test_set_get_pref.integer"), 1);