diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
index 1fab15275b93..421527bcaf49 100644
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -348,7 +348,11 @@ pref("browser.urlbar.match.url", "@");
pref("browser.urlbar.suggest.history", true);
pref("browser.urlbar.suggest.bookmark", true);
pref("browser.urlbar.suggest.openpage", true);
+#ifdef NIGHTLY_BUILD
pref("browser.urlbar.suggest.searches", true);
+#else
+pref("browser.urlbar.suggest.searches", false);
+#endif
// Restrictions to current suggestions can also be applied (intersection).
// Typed suggestion works only if history is set to true.
diff --git a/browser/components/preferences/in-content/privacy.js b/browser/components/preferences/in-content/privacy.js
index c498c7ca5ab3..ce6e81267457 100644
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
+Components.utils.import("resource://gre/modules/AppConstants.jsm");
+
var gPrivacyPane = {
/**
@@ -103,6 +105,8 @@ var gPrivacyPane = {
gPrivacyPane.showCookies);
setEventListener("clearDataSettings", "command",
gPrivacyPane.showClearPrivateDataSettings);
+
+ document.getElementById("searchesSuggestion").hidden = !AppConstants.NIGHTLY_BUILD;
},
// HISTORY MODE
diff --git a/browser/components/preferences/in-content/privacy.xul b/browser/components/preferences/in-content/privacy.xul
index 557c1d8b7365..e95f085ead82 100644
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -258,6 +258,7 @@
accesskey="&locbar.openpage.accesskey;"
preference="browser.urlbar.suggest.openpage"/>
diff --git a/browser/components/preferences/in-content/tests/browser_privacypane_1.js b/browser/components/preferences/in-content/tests/browser_privacypane_1.js
index 8694230d1e70..e254bd1c94a9 100644
--- a/browser/components/preferences/in-content/tests/browser_privacypane_1.js
+++ b/browser/components/preferences/in-content/tests/browser_privacypane_1.js
@@ -19,8 +19,5 @@ function test() {
test_dependent_cookie_elements,
test_dependent_clearonclose_elements,
test_dependent_prefs,
-
- // reset all preferences to their default values once we're done
- reset_preferences
]);
}
diff --git a/browser/components/preferences/in-content/tests/browser_privacypane_3.js b/browser/components/preferences/in-content/tests/browser_privacypane_3.js
index b333037de7ec..185528f7c73e 100644
--- a/browser/components/preferences/in-content/tests/browser_privacypane_3.js
+++ b/browser/components/preferences/in-content/tests/browser_privacypane_3.js
@@ -18,8 +18,5 @@ function test() {
test_custom_retention("rememberForms", "remember"),
test_custom_retention("rememberForms", "custom"),
test_historymode_retention("remember", "remember"),
-
- // reset all preferences to their default values once we're done
- reset_preferences
]);
}
diff --git a/browser/components/preferences/in-content/tests/browser_privacypane_4.js b/browser/components/preferences/in-content/tests/browser_privacypane_4.js
index b09f0e215fc2..ad22217a177d 100644
--- a/browser/components/preferences/in-content/tests/browser_privacypane_4.js
+++ b/browser/components/preferences/in-content/tests/browser_privacypane_4.js
@@ -27,8 +27,5 @@ function test() {
test_custom_retention("alwaysClear", "remember"),
test_custom_retention("alwaysClear", "custom"),
test_historymode_retention("remember", "remember"),
-
- // reset all preferences to their default values once we're done
- reset_preferences
]));
}
diff --git a/browser/components/preferences/in-content/tests/browser_privacypane_5.js b/browser/components/preferences/in-content/tests/browser_privacypane_5.js
index 5143231156c5..1a2b572d2d59 100644
--- a/browser/components/preferences/in-content/tests/browser_privacypane_5.js
+++ b/browser/components/preferences/in-content/tests/browser_privacypane_5.js
@@ -12,15 +12,16 @@ function test() {
}
loader.loadSubScript(rootDir + "privacypane_tests_perwindow.js", this);
- run_test_subset([
+ let tests = [
test_locbar_suggestion_retention("history", true),
test_locbar_suggestion_retention("bookmark", true),
- test_locbar_suggestion_retention("searches", true),
test_locbar_suggestion_retention("openpage", false),
test_locbar_suggestion_retention("history", true),
test_locbar_suggestion_retention("history", false),
+ ];
- // reset all preferences to their default values once we're done
- reset_preferences
- ]);
+ if (AppConstants.NIGHTLY_BUILD)
+ tests.push(test_locbar_suggestion_retention("searches", true)),
+
+ run_test_subset(tests);
}
diff --git a/browser/components/preferences/in-content/tests/browser_privacypane_8.js b/browser/components/preferences/in-content/tests/browser_privacypane_8.js
index 6cd134ed3f8f..ddfda044ec60 100644
--- a/browser/components/preferences/in-content/tests/browser_privacypane_8.js
+++ b/browser/components/preferences/in-content/tests/browser_privacypane_8.js
@@ -27,8 +27,5 @@ function test() {
// history mode should now be remember
test_historymode_retention("remember", "remember"),
-
- // reset all preferences to their default values once we're done
- reset_preferences
]);
}
diff --git a/browser/components/preferences/in-content/tests/privacypane_tests_perwindow.js b/browser/components/preferences/in-content/tests/privacypane_tests_perwindow.js
index 0851753ad929..4f43c3e70ff5 100644
--- a/browser/components/preferences/in-content/tests/privacypane_tests_perwindow.js
+++ b/browser/components/preferences/in-content/tests/privacypane_tests_perwindow.js
@@ -315,11 +315,18 @@ function test_locbar_suggestion_retention(suggestion, autocomplete) {
};
}
+const gPrefCache = new Map();
+
+function cache_preferences(win) {
+ let prefs = win.document.querySelectorAll("#privacyPreferences > preference");
+ for (let pref of prefs)
+ gPrefCache.set(pref.name, pref.value);
+}
+
function reset_preferences(win) {
let prefs = win.document.querySelectorAll("#privacyPreferences > preference");
- for (let i = 0; i < prefs.length; ++i)
- if (prefs[i].hasUserValue)
- prefs[i].reset();
+ for (let pref of prefs)
+ pref.value = gPrefCache.get(pref.name);
}
let testRunner;
@@ -334,7 +341,7 @@ function run_test_subset(subset) {
});
testRunner = {
- tests: subset,
+ tests: [cache_preferences, ...subset, reset_preferences],
counter: 0,
runNext: function() {
if (this.counter == this.tests.length) {
diff --git a/browser/components/preferences/privacy.js b/browser/components/preferences/privacy.js
index d7dadba42498..3c0688cbe4a3 100644
--- a/browser/components/preferences/privacy.js
+++ b/browser/components/preferences/privacy.js
@@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+Components.utils.import("resource://gre/modules/AppConstants.jsm");
var gPrivacyPane = {
@@ -69,6 +70,8 @@ var gPrivacyPane = {
this._initTrackingProtection();
#endif
this._initAutocomplete();
+
+ document.getElementById("searchesSuggestion").hidden = !AppConstants.NIGHTLY_BUILD;
},
// HISTORY MODE
diff --git a/browser/components/preferences/privacy.xul b/browser/components/preferences/privacy.xul
index f91e145ca961..aff5547f4450 100644
--- a/browser/components/preferences/privacy.xul
+++ b/browser/components/preferences/privacy.xul
@@ -284,6 +284,7 @@
accesskey="&locbar.openpage.accesskey;"
preference="browser.urlbar.suggest.openpage"/>
diff --git a/browser/components/preferences/tests/browser_privacypane_1.js b/browser/components/preferences/tests/browser_privacypane_1.js
index f478b1acabca..b57841ca4632 100644
--- a/browser/components/preferences/tests/browser_privacypane_1.js
+++ b/browser/components/preferences/tests/browser_privacypane_1.js
@@ -20,8 +20,5 @@ function test() {
test_dependent_cookie_elements,
test_dependent_clearonclose_elements,
test_dependent_prefs,
-
- // reset all preferences to their default values once we're done
- reset_preferences
]);
}
diff --git a/browser/components/preferences/tests/browser_privacypane_3.js b/browser/components/preferences/tests/browser_privacypane_3.js
index 8ef887a35b6a..9a4da380bc7e 100644
--- a/browser/components/preferences/tests/browser_privacypane_3.js
+++ b/browser/components/preferences/tests/browser_privacypane_3.js
@@ -19,8 +19,5 @@ function test() {
test_custom_retention("rememberForms", "remember"),
test_custom_retention("rememberForms", "custom"),
test_historymode_retention("remember", "remember"),
-
- // reset all preferences to their default values once we're done
- reset_preferences
]);
}
diff --git a/browser/components/preferences/tests/browser_privacypane_4.js b/browser/components/preferences/tests/browser_privacypane_4.js
index a86252922380..87ad56969208 100644
--- a/browser/components/preferences/tests/browser_privacypane_4.js
+++ b/browser/components/preferences/tests/browser_privacypane_4.js
@@ -28,8 +28,5 @@ function test() {
test_custom_retention("alwaysClear", "remember"),
test_custom_retention("alwaysClear", "custom"),
test_historymode_retention("remember", "remember"),
-
- // reset all preferences to their default values once we're done
- reset_preferences
]));
}
diff --git a/browser/components/preferences/tests/browser_privacypane_5.js b/browser/components/preferences/tests/browser_privacypane_5.js
index 5143231156c5..1a2b572d2d59 100644
--- a/browser/components/preferences/tests/browser_privacypane_5.js
+++ b/browser/components/preferences/tests/browser_privacypane_5.js
@@ -12,15 +12,16 @@ function test() {
}
loader.loadSubScript(rootDir + "privacypane_tests_perwindow.js", this);
- run_test_subset([
+ let tests = [
test_locbar_suggestion_retention("history", true),
test_locbar_suggestion_retention("bookmark", true),
- test_locbar_suggestion_retention("searches", true),
test_locbar_suggestion_retention("openpage", false),
test_locbar_suggestion_retention("history", true),
test_locbar_suggestion_retention("history", false),
+ ];
- // reset all preferences to their default values once we're done
- reset_preferences
- ]);
+ if (AppConstants.NIGHTLY_BUILD)
+ tests.push(test_locbar_suggestion_retention("searches", true)),
+
+ run_test_subset(tests);
}
diff --git a/browser/components/preferences/tests/browser_privacypane_8.js b/browser/components/preferences/tests/browser_privacypane_8.js
index bb21d6646a2e..51a8f4fcfd58 100644
--- a/browser/components/preferences/tests/browser_privacypane_8.js
+++ b/browser/components/preferences/tests/browser_privacypane_8.js
@@ -28,8 +28,5 @@ function test() {
// history mode should now be remember
test_historymode_retention("remember", "remember"),
-
- // reset all preferences to their default values once we're done
- reset_preferences
]);
}
diff --git a/browser/components/preferences/tests/privacypane_tests_perwindow.js b/browser/components/preferences/tests/privacypane_tests_perwindow.js
index 7c9487edab5d..c833cdcc7167 100644
--- a/browser/components/preferences/tests/privacypane_tests_perwindow.js
+++ b/browser/components/preferences/tests/privacypane_tests_perwindow.js
@@ -321,11 +321,18 @@ function test_locbar_suggestion_retention(suggestion, autocomplete) {
};
}
+const gPrefCache = new Map();
+
+function cache_preferences(win) {
+ let prefs = win.document.querySelectorAll("#privacyPreferences > preference");
+ for (let pref of prefs)
+ gPrefCache.set(pref.name, pref.value);
+}
+
function reset_preferences(win) {
- let prefs = win.document.getElementsByTagName("preference");
- for (let i = 0; i < prefs.length; ++i)
- if (prefs[i].hasUserValue)
- prefs[i].reset();
+ let prefs = win.document.querySelectorAll("#privacyPreferences > preference");
+ for (let pref of prefs)
+ pref.value = gPrefCache.get(pref.name);
}
let testRunner;
@@ -336,7 +343,7 @@ function run_test_subset(subset) {
waitForExplicitFinish();
testRunner = {
- tests: subset,
+ tests: [cache_preferences, ...subset, reset_preferences],
counter: 0,
runNext: function() {
if (this.counter == this.tests.length) {