Bug 1420311 - Remove hack from test_stickyprefs.js. r=njn
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 24 Nov 2017 10:39:23 +0900
changeset 438071 372b31b33fef91b00b66e2fa3f189dc5efadd4dd
parent 438070 d140f71aa8f40e16753f8f469a8bcfcb85206ac5
child 438072 6724ad1ea3012c8e7ed32556a1dd3c9ae1c53370
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewersnjn
bugs1420311, 1367813
milestone59.0a1
Bug 1420311 - Remove hack from test_stickyprefs.js. r=njn Before bug 1367813, the code in test_stickyprefs.js, using readUserPrefs, would end up changing the file under which the preferences service would save user prefs, making xpcshell possibly overwrite the test data files at the end of the test run. A hack was put in place to avoid this, that is not required anymore.
modules/libpref/test/unit/test_stickyprefs.js
--- a/modules/libpref/test/unit/test_stickyprefs.js
+++ b/modules/libpref/test/unit/test_stickyprefs.js
@@ -1,24 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/licenses/publicdomain/  */
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 Components.utils.import("resource://gre/modules/Services.jsm");
 
 const ps = Services.prefs;
 
-// Once we fetch the profile directory the xpcshell test harness will send
-// a profile-before-change notification at shutdown. This causes the prefs
-// service to flush the prefs file - and the prefs file it uses ends up being
-// testPrefSticky*.js in the test dir. This upsets things in confusing ways :)
-// We avoid this by ensuring our "temp" prefs.js is the current prefs file.
-do_get_profile();
-do_register_cleanup(saveAndReload);
-
 // A little helper to reset the service and load some pref files
 function resetAndLoad(filenames) {
   ps.resetPrefs();
   for (let filename of filenames) {
     ps.readUserPrefsFromFile(do_get_file(filename));
   }
 }