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.
--- 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));
}
}