Bug 440908 - Convert sticky prefs in default pref files to the new syntax. r=glandium
MozReview-Commit-ID: GgkNSsdGhBV
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1237,19 +1237,20 @@ pref("services.sync.prefs.sync.xpinstall
// A preference that controls whether we should show the icon for a remote tab.
// This pref has no UI but exists because some people may be concerned that
// fetching these icons to show remote tabs may leak information about that
// user's tabs and bookmarks. Note this pref is also synced.
pref("services.sync.syncedTabs.showRemoteIcons", true);
// Developer edition preferences
#ifdef MOZ_DEV_EDITION
-sticky_pref("lightweightThemes.selectedThemeID", "firefox-compact-dark@mozilla.org");
+pref("lightweightThemes.selectedThemeID", "firefox-compact-dark@mozilla.org",
+ sticky);
#else
-sticky_pref("lightweightThemes.selectedThemeID", "");
+pref("lightweightThemes.selectedThemeID", "", sticky);
#endif
// Whether the character encoding menu is under the main Firefox button. This
// preference is a string so that localizers can alter it.
pref("browser.menu.showCharacterEncoding", "chrome://browser/locale/browser.properties");
// Allow using tab-modal prompts when possible.
pref("prompts.tab_modal.enabled", true);
@@ -1261,17 +1262,17 @@ pref("browser.newtab.preload", true);
// NOTE: This preference is unused but was not removed in case
// this information will be valuable in the future.
pref("browser.newtabpage.introShown", false);
// Toggles the content of 'about:newtab'. Shows the grid when enabled.
pref("browser.newtabpage.enabled", true);
// Toggles the directory tiles content of 'about:newtab'.
-sticky_pref("browser.newtabpage.enhanced", true);
+pref("browser.newtabpage.enhanced", true, sticky);
// enables Activity Stream inspired layout
pref("browser.newtabpage.compact", false);
// enables showing basic placeholders for missing thumbnails
pref("browser.newtabpage.thumbnailPlaceholder", false);
// number of rows of newtab grid
--- a/devtools/shim/devtools-startup-prefs.js
+++ b/devtools/shim/devtools-startup-prefs.js
@@ -8,19 +8,19 @@
// process in JS, they can be defined in this file.
// Note that this preference file follows Firefox release cycle.
// Enable the JSON View tool (an inspector for application/json documents).
pref("devtools.jsonview.enabled", true);
// Default theme ("dark" or "light")
#ifdef MOZ_DEV_EDITION
-sticky_pref("devtools.theme", "dark");
+pref("devtools.theme", "dark", sticky);
#else
-sticky_pref("devtools.theme", "light");
+pref("devtools.theme", "light", sticky);
#endif
// Should the devtools toolbar be opened on startup
pref("devtools.toolbar.visible", false);
// Pref to drive the devtools onboarding flow experiment. States:
// - off: forces devtools.enabled to true
// - on: devtools.enabled is not forced to true.
@@ -33,9 +33,9 @@ pref("devtools.onboarding.experiment", "
// flipped once.
pref("devtools.onboarding.experiment.flipped", false);
// Flag to check if we already logged the devtools onboarding related probe.
pref("devtools.onboarding.telemetry.logged", false);
// Completely disable DevTools entry points, as well as all DevTools command line
// arguments This should be merged with devtools.enabled, see Bug 1440675.
-pref("devtools.policy.disabled", false);
\ No newline at end of file
+pref("devtools.policy.disabled", false);
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1088,33 +1088,33 @@ pref("toolkit.asyncshutdown.log", false)
// Until bug 1361080 lands, we always consider them enabled.
pref("devtools.enabled", true);
// Enable deprecation warnings.
pref("devtools.errorconsole.deprecation_warnings", true);
#ifdef NIGHTLY_BUILD
// Don't show the Browser Toolbox prompt on local builds / nightly
-sticky_pref("devtools.debugger.prompt-connection", false);
+pref("devtools.debugger.prompt-connection", false, sticky);
#else
-sticky_pref("devtools.debugger.prompt-connection", true);
+pref("devtools.debugger.prompt-connection", true, sticky);
#endif
#ifdef MOZILLA_OFFICIAL
// Disable debugging chrome
-sticky_pref("devtools.chrome.enabled", false);
+pref("devtools.chrome.enabled", false, sticky);
// Disable remote debugging connections
-sticky_pref("devtools.debugger.remote-enabled", false);
+pref("devtools.debugger.remote-enabled", false, sticky);
// enable JS dump() function.
-sticky_pref("browser.dom.window.dump.enabled", false);
+pref("browser.dom.window.dump.enabled", false, sticky);
#else
// In local builds, enable the browser toolbox by default
-sticky_pref("devtools.chrome.enabled", true);
-sticky_pref("devtools.debugger.remote-enabled", true);
-sticky_pref("browser.dom.window.dump.enabled", true);
+pref("devtools.chrome.enabled", true, sticky);
+pref("devtools.debugger.remote-enabled", true, sticky);
+pref("browser.dom.window.dump.enabled", true, sticky);
#endif
// Disable remote debugging protocol logging
pref("devtools.debugger.log", false);
pref("devtools.debugger.log.verbose", false);
pref("devtools.debugger.remote-port", 6000);
--- a/modules/libpref/test/unit/data/testPrefSticky.js
+++ b/modules/libpref/test/unit/data/testPrefSticky.js
@@ -1,2 +1,2 @@
pref("testPref.unsticky.bool", true);
-sticky_pref("testPref.sticky.bool", false);
+pref("testPref.sticky.bool", false, sticky);
--- a/modules/libpref/test/unit/data/testPrefStickyUser.js
+++ b/modules/libpref/test/unit/data/testPrefStickyUser.js
@@ -1,5 +1,5 @@
-// testPrefSticky.js defined this pref as a sticky_pref(). Once a sticky
+// testPrefSticky.js defined this pref as sticky. Once a sticky
// pref has been changed, it's written as a user_pref().
// So this test file reflects that scenario.
// Note the default in testPrefSticky.js is also false.
user_pref("testPref.sticky.bool", false);
--- a/modules/libpref/test/unit/test_stickyprefs.js
+++ b/modules/libpref/test/unit/test_stickyprefs.js
@@ -55,17 +55,17 @@ add_test(function notWrittenWhenUnchange
ps.getBoolPref("testPref.sticky.bool");
Assert.ok(false, "expected failure reading this pref");
} catch (ex) {
Assert.ok(ex, "exception reading regular pref");
}
run_next_test();
});
-// Loading a sticky_pref then a user_pref for the same pref means it should
+// Loading a sticky `pref` then a `user_pref` for the same pref means it should
// always be written.
add_test(function writtenOnceLoadedWithoutChange() {
// Load the same pref file *as well as* a pref file that has a user_pref for
// our sticky with the default value. It should be re-written without us
// touching it.
resetAndLoadAll();
// reset and re-read what we just wrote - it should be written.
saveAndReload();