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 393523 372b31b33fef91b00b66e2fa3f189dc5efadd4dd
parent 393522 d140f71aa8f40e16753f8f469a8bcfcb85206ac5
child 393524 6724ad1ea3012c8e7ed32556a1dd3c9ae1c53370
push id55952
push usermh@glandium.org
push dateFri, 24 Nov 2017 02:25:24 +0000
treeherderautoland@372b31b33fef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1420311, 1367813
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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));
   }
 }