From 852f034b58a8f489409309d3254c618fbe81b210 Mon Sep 17 00:00:00 2001 From: Oana Pop Rus Date: Fri, 18 Oct 2019 18:45:58 +0300 Subject: [PATCH] Backed out 2 changesets (bug 1588785) for causing bc perma failures in browser_searchDefaultEngine.js on a CLOSED TREE Backed out changeset 6ad4b26b21d7 (bug 1588785) Backed out changeset 4a4afa268baf (bug 1588785) --- browser/app/profile/firefox.js | 2 + browser/base/content/browser.js | 27 ++++-- .../test/browser/browser_searchbar_default.js | 7 -- .../browser/browser_action_searchengine.js | 5 +- .../browser/browser_urlbarPlaceholder.js | 5 +- .../test/browser/browser_ContentSearch.js | 1 - .../browser/browser_uriFixupIntegration.js | 5 +- .../test/unit/test_nsDefaultURIFixup_info.js | 4 - .../unit/test_nsDefaultURIFixup_search.js | 7 -- modules/libpref/init/all.js | 1 - toolkit/components/search/SearchService.jsm | 74 +++------------ .../search/tests/xpcshell/head_search.js | 9 -- .../searchconfigs/head_searchconfig.js | 4 - .../tests/xpcshell/test_defaultEngine.js | 17 ---- .../xpcshell/test_defaultEngine_fallback.js | 4 - .../xpcshell/test_defaultPrivateEngine.js | 91 ------------------- .../tests/xpcshell/test_list_json_locale.js | 4 - .../test_list_json_no_private_default.js | 4 - .../xpcshell/test_list_json_searchdefault.js | 5 - .../xpcshell/test_list_json_searchorder.js | 5 - .../tests/xpcshell/test_notifications.js | 4 - .../tests/unit/test_TelemetryEnvironment.js | 4 - 22 files changed, 35 insertions(+), 254 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 23b476d6d038..c2407d74d1a5 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -393,6 +393,8 @@ pref("browser.search.widget.inNavBar", false); // engine in private browsing mode. #ifdef EARLY_BETA_OR_EARLIER pref("browser.search.separatePrivateDefault.ui.enabled", true); +#else + pref("browser.search.separatePrivateDefault.ui.enabled", false); #endif // The maximum amount of times the private default banner is shown. pref("browser.search.separatePrivateDefault.ui.banner.max", 0); diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index eaa63e26a306..04961f819a1c 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -4403,7 +4403,7 @@ const BrowserSearch = { // Asynchronously initialize the search service if necessary, to get the // current engine for working out the placeholder. this._updateURLBarPlaceholderFromDefaultEngine( - PrivateBrowsingUtils.isWindowPrivate(window), + this._usePrivateSettings, // Delay the update for this until so that we don't change it while // the user is looking at it / isn't expecting it. true @@ -4439,24 +4439,31 @@ const BrowserSearch = { this._removeMaybeOfferedEngine(engineName); break; case "engine-default": - if ( - this._searchInitComplete && - !PrivateBrowsingUtils.isWindowPrivate(window) - ) { + if (this._searchInitComplete && !this._usePrivateSettings) { this._updateURLBarPlaceholder(engineName, false); } break; case "engine-default-private": - if ( - this._searchInitComplete && - PrivateBrowsingUtils.isWindowPrivate(window) - ) { + if (this._searchInitComplete && this._usePrivateSettings) { this._updateURLBarPlaceholder(engineName, true); } break; } }, + /** + * @returns True if we are using a separate default private engine, and + * we are in a private window. + */ + get _usePrivateSettings() { + return ( + Services.prefs.getBoolPref( + "browser.search.separatePrivateDefault", + true + ) && PrivateBrowsingUtils.isWindowPrivate(window) + ); + }, + _addMaybeOfferedEngine(engineName) { let selectedBrowserOffersEngine = false; for (let browser of gBrowser.browsers) { @@ -4514,7 +4521,7 @@ const BrowserSearch = { initPlaceHolder() { const prefName = "browser.urlbar.placeholderName" + - (PrivateBrowsingUtils.isWindowPrivate(window) ? ".private" : ""); + (this._usePrivateSettings ? ".private" : ""); let engineName = Services.prefs.getStringPref(prefName, ""); if (engineName) { // We can do this directly, since we know we're at DOMContentLoaded. diff --git a/browser/components/search/test/browser/browser_searchbar_default.js b/browser/components/search/test/browser/browser_searchbar_default.js index e31d73321346..0a730fac0d64 100644 --- a/browser/components/search/test/browser/browser_searchbar_default.js +++ b/browser/components/search/test/browser/browser_searchbar_default.js @@ -50,13 +50,6 @@ add_task(async function setup() { template: templatePrivate + "{searchTerms}", }); - await SpecialPowers.pushPrefEnv({ - set: [ - ["browser.search.separatePrivateDefault.ui.enabled", true], - ["browser.search.separatePrivateDefault", false], - ], - }); - let originalEngine = await Services.search.getDefault(); let originalPrivateEngine = await Services.search.getDefaultPrivate(); diff --git a/browser/components/urlbar/tests/browser/browser_action_searchengine.js b/browser/components/urlbar/tests/browser/browser_action_searchengine.js index 612cf3803f9d..e37905c3e5c2 100644 --- a/browser/components/urlbar/tests/browser/browser_action_searchengine.js +++ b/browser/components/urlbar/tests/browser/browser_action_searchengine.js @@ -8,10 +8,7 @@ add_task(async function setup() { await SpecialPowers.pushPrefEnv({ - set: [ - ["browser.search.separatePrivateDefault.ui.enabled", true], - ["browser.search.separatePrivateDefault", false], - ], + set: [["browser.search.separatePrivateDefault", false]], }); const engine = await Services.search.addEngineWithDetails("MozSearch", { diff --git a/browser/components/urlbar/tests/browser/browser_urlbarPlaceholder.js b/browser/components/urlbar/tests/browser/browser_urlbarPlaceholder.js index ee86d0e371d6..82c37f067ec5 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbarPlaceholder.js +++ b/browser/components/urlbar/tests/browser/browser_urlbarPlaceholder.js @@ -37,10 +37,7 @@ add_task(async function setup() { BrowserTestUtils.removeTab(urlTab); await SpecialPowers.pushPrefEnv({ - set: [ - ["browser.search.separatePrivateDefault.ui.enabled", true], - ["browser.search.separatePrivateDefault", false], - ], + set: [["browser.search.separatePrivateDefault", false]], }); registerCleanupFunction(async () => { diff --git a/browser/modules/test/browser/browser_ContentSearch.js b/browser/modules/test/browser/browser_ContentSearch.js index 158b32945748..54057faa9407 100644 --- a/browser/modules/test/browser/browser_ContentSearch.js +++ b/browser/modules/test/browser/browser_ContentSearch.js @@ -22,7 +22,6 @@ add_task(async function setup() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.newtab.preload", false], - ["browser.search.separatePrivateDefault.ui.enabled", true], ["browser.search.separatePrivateDefault", true], ], }); diff --git a/docshell/test/browser/browser_uriFixupIntegration.js b/docshell/test/browser/browser_uriFixupIntegration.js index e00c5e0f6391..ebe20539838d 100644 --- a/docshell/test/browser/browser_uriFixupIntegration.js +++ b/docshell/test/browser/browser_uriFixupIntegration.js @@ -14,10 +14,7 @@ const kPrivateSearchEngineURL = "http://example.com/?private={searchTerms}"; add_task(async function setup() { await SpecialPowers.pushPrefEnv({ - set: [ - ["browser.search.separatePrivateDefault.ui.enabled", true], - ["browser.search.separatePrivateDefault", true], - ], + set: [["browser.search.separatePrivateDefault", true]], }); let oldCurrentEngine = await Services.search.getDefault(); diff --git a/docshell/test/unit/test_nsDefaultURIFixup_info.js b/docshell/test/unit/test_nsDefaultURIFixup_info.js index 70a4826b20c9..3220a930dae5 100644 --- a/docshell/test/unit/test_nsDefaultURIFixup_info.js +++ b/docshell/test/unit/test_nsDefaultURIFixup_info.js @@ -614,7 +614,6 @@ add_task(async function setup() { "keyword.enabled", "browser.fixup.domainwhitelist.whitelisted", "browser.search.separatePrivateDefault", - "browser.search.separatePrivateDefault.ui.enabled", ]; for (let pref of prefList) { Services.prefs.setBoolPref(pref, true); @@ -667,9 +666,6 @@ add_task(async function setup() { Services.prefs.clearUserPref("browser.fixup.typo.scheme"); Services.prefs.clearUserPref(kForceHostLookup); Services.prefs.clearUserPref("browser.search.separatePrivateDefault"); - Services.prefs.clearUserPref( - "browser.search.separatePrivateDefault.ui.enabled" - ); }); }); diff --git a/docshell/test/unit/test_nsDefaultURIFixup_search.js b/docshell/test/unit/test_nsDefaultURIFixup_search.js index df8c26d9a1bc..7bc79aefa311 100644 --- a/docshell/test/unit/test_nsDefaultURIFixup_search.js +++ b/docshell/test/unit/test_nsDefaultURIFixup_search.js @@ -119,10 +119,6 @@ add_task(async function setup() { Services.prefs.setBoolPref("keyword.enabled", true); Services.prefs.setBoolPref("browser.search.separatePrivateDefault", true); - Services.prefs.setBoolPref( - "browser.search.separatePrivateDefault.ui.enabled", - true - ); Services.io .getProtocolHandler("resource") @@ -164,9 +160,6 @@ add_task(async function setup() { await Services.search.removeEngine(newPrivateEngine); Services.prefs.clearUserPref("keyword.enabled"); Services.prefs.clearUserPref("browser.search.separatePrivateDefault"); - Services.prefs.clearUserPref( - "browser.search.separatePrivateDefault.ui.enabled" - ); }); }); diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 2c0300246650..49bbfdb38409 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -4449,7 +4449,6 @@ pref("browser.search.geoSpecificDefaults", false); pref("browser.search.geoip.url", "https://location.services.mozilla.com/v1/country?key=%MOZILLA_API_KEY%"); pref("browser.search.geoip.timeout", 3000); pref("browser.search.separatePrivateDefault", false); -pref("browser.search.separatePrivateDefault.ui.enabled", false); #ifdef MOZ_OFFICIAL_BRANDING // {moz:official} expands to "official" diff --git a/toolkit/components/search/SearchService.jsm b/toolkit/components/search/SearchService.jsm index 505f2e3b4c96..b7572db511fe 100644 --- a/toolkit/components/search/SearchService.jsm +++ b/toolkit/components/search/SearchService.jsm @@ -32,6 +32,13 @@ XPCOMUtils.defineLazyServiceGetters(this, { gEnvironment: ["@mozilla.org/process/environment;1", "nsIEnvironment"], }); +XPCOMUtils.defineLazyPreferenceGetter( + this, + "gSeparatePrivateDefault", + SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault", + false +); + XPCOMUtils.defineLazyPreferenceGetter( this, "gGeoSpecificDefaultsEnabled", @@ -662,16 +669,6 @@ SearchService.prototype = { */ _metaData: {}, - // This reflects the combined values of the prefs for enabling the separate - // private default UI, and for the user choosing a separate private engine. - // If either one is disabled, then we don't enable the separate private default. - get _separatePrivateDefault() { - return ( - this._separatePrivateDefaultPrefValue && - this._separatePrivateDefaultEnabledPrefValue - ); - }, - /** * Resets the locally stored data to the original empty values in preparation * for a reinit or a reset. @@ -726,22 +723,6 @@ SearchService.prototype = { async _init(skipRegionCheck) { SearchUtils.log("_init start"); - XPCOMUtils.defineLazyPreferenceGetter( - this, - "_separatePrivateDefaultPrefValue", - SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault", - false, - this._onSeparateDefaultPrefChanged.bind(this) - ); - - XPCOMUtils.defineLazyPreferenceGetter( - this, - "_separatePrivateDefaultEnabledPrefValue", - SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault.ui.enabled", - false, - this._onSeparateDefaultPrefChanged.bind(this) - ); - try { // See if we have a cache file so we don't have to parse a bunch of XML. let cache = await this._readCacheFile(); @@ -988,7 +969,7 @@ SearchService.prototype = { * browsing engine will be returned. */ get originalPrivateDefaultEngine() { - return this._originalDefaultEngine(this._separatePrivateDefault); + return this._originalDefaultEngine(gSeparatePrivateDefault); }, resetToOriginalDefaultEngine() { @@ -1302,17 +1283,9 @@ SearchService.prototype = { this._currentEngine, SearchUtils.MODIFIED_TYPE.DEFAULT ); - // If we've not got a separate private active, notify update of the - // private so that the UI updates correctly. - if (!this._separatePrivateDefault) { - SearchUtils.notifyAction( - this._currentEngine, - SearchUtils.MODIFIED_TYPE.DEFAULT_PRIVATE - ); - } } if ( - this._separatePrivateDefault && + gSeparatePrivateDefault && prevPrivateEngine && this.defaultPrivateEngine !== prevPrivateEngine ) { @@ -2649,7 +2622,7 @@ SearchService.prototype = { // tests. Really, removeEngine should always commit to updating any // changed defaults. if ( - this._separatePrivateDefault && + gSeparatePrivateDefault && engineToRemove == this.defaultPrivateEngine ) { this._currentPrivateEngine = null; @@ -2921,14 +2894,6 @@ SearchService.prototype = { this[currentEngine], SearchUtils.MODIFIED_TYPE[privateMode ? "DEFAULT_PRIVATE" : "DEFAULT"] ); - // If we've not got a separate private active, notify update of the - // private so that the UI updates correctly. - if (!privateMode && !this._separatePrivateDefault) { - SearchUtils.notifyAction( - this[currentEngine], - SearchUtils.MODIFIED_TYPE.DEFAULT_PRIVATE - ); - } }, get defaultEngine() { @@ -2940,11 +2905,11 @@ SearchService.prototype = { }, get defaultPrivateEngine() { - return this._getEngineDefault(this._separatePrivateDefault); + return this._getEngineDefault(gSeparatePrivateDefault); }, set defaultPrivateEngine(newEngine) { - this._setEngineDefault(this._separatePrivateDefault, newEngine); + this._setEngineDefault(gSeparatePrivateDefault, newEngine); }, async getDefault() { @@ -2967,19 +2932,6 @@ SearchService.prototype = { return (this.defaultPrivateEngine = engine); }, - _onSeparateDefaultPrefChanged() { - // We should notify if the normal default, and the currently saved private - // default are different. Otherwise, save the energy. - if (this.defaultEngine != this._getEngineDefault(true)) { - SearchUtils.notifyAction( - // Always notify with the new private engine, the function checks - // the preference value for us. - this.defaultPrivateEngine, - SearchUtils.MODIFIED_TYPE.DEFAULT_PRIVATE - ); - } - }, - async _getEngineInfo(engine) { if (!engine) { // The defaultEngine getter will throw if there's no engine at all, @@ -3107,7 +3059,7 @@ SearchService.prototype = { defaultSearchEngineData, }; - if (this._separatePrivateDefault) { + if (gSeparatePrivateDefault) { let [ privateShortName, defaultPrivateSearchEngineData, diff --git a/toolkit/components/search/tests/xpcshell/head_search.js b/toolkit/components/search/tests/xpcshell/head_search.js index 76893f4f95a5..c3b9b0e385d8 100644 --- a/toolkit/components/search/tests/xpcshell/head_search.js +++ b/toolkit/components/search/tests/xpcshell/head_search.js @@ -136,15 +136,6 @@ async function forceExpiration() { await promiseSaveGlobalMetadata(metadata); } -function promiseDefaultNotification(type = "normal") { - return SearchTestUtils.promiseSearchNotification( - SearchUtils.MODIFIED_TYPE[ - type == "private" ? "DEFAULT_PRIVATE" : "DEFAULT" - ], - SearchUtils.TOPIC_ENGINE_MODIFIED - ); -} - /** * Clean the profile of any cache file left from a previous run. * diff --git a/toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js b/toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js index a30056e6aac2..6d3b9ed1407b 100644 --- a/toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js +++ b/toolkit/components/search/tests/xpcshell/searchconfigs/head_searchconfig.js @@ -107,10 +107,6 @@ class SearchConfigTest { // Enable separatePrivateDefault testing. We test with this on, as we have // separate tests for ensuring the normal = private when this is off. - Services.prefs.setBoolPref( - SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault.ui.enabled", - true - ); Services.prefs.setBoolPref( SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault", true diff --git a/toolkit/components/search/tests/xpcshell/test_defaultEngine.js b/toolkit/components/search/tests/xpcshell/test_defaultEngine.js index 061580d39e2d..660f14987fbc 100644 --- a/toolkit/components/search/tests/xpcshell/test_defaultEngine.js +++ b/toolkit/components/search/tests/xpcshell/test_defaultEngine.js @@ -13,13 +13,6 @@ add_task(async function setup() { await AddonTestUtils.promiseStartupManager(); }); -function promiseDefaultNotification() { - return SearchTestUtils.promiseSearchNotification( - SearchUtils.MODIFIED_TYPE.DEFAULT, - SearchUtils.TOPIC_ENGINE_MODIFIED - ); -} - add_task(async function test_defaultEngine() { let search = Services.search; await search.init(); @@ -31,19 +24,11 @@ add_task(async function test_defaultEngine() { { name: "A second test engine", xmlFileName: "engine2.xml" }, ]); - let promise = promiseDefaultNotification(); search.defaultEngine = engine1; - Assert.equal(await promise, engine1); Assert.equal(search.defaultEngine, engine1); - - promise = promiseDefaultNotification(); search.defaultEngine = engine2; - Assert.equal(await promise, engine2); Assert.equal(search.defaultEngine, engine2); - - promise = promiseDefaultNotification(); search.defaultEngine = engine1; - Assert.equal(await promise, engine1); Assert.equal(search.defaultEngine, engine1); // Test that hiding the currently-default engine affects the defaultEngine getter @@ -59,8 +44,6 @@ add_task(async function test_defaultEngine() { // Test that setting defaultEngine to an already-hidden engine works, but // doesn't change the return value of the getter - promise = promiseDefaultNotification(); search.defaultEngine = engine1; - Assert.equal(await promise, engine1); Assert.equal(search.defaultEngine, engine2); }); diff --git a/toolkit/components/search/tests/xpcshell/test_defaultEngine_fallback.js b/toolkit/components/search/tests/xpcshell/test_defaultEngine_fallback.js index 5019bbe327d5..87bd096da61a 100644 --- a/toolkit/components/search/tests/xpcshell/test_defaultEngine_fallback.js +++ b/toolkit/components/search/tests/xpcshell/test_defaultEngine_fallback.js @@ -6,10 +6,6 @@ add_task(async function setup() { useTestEngineConfig(); Services.prefs.setCharPref(SearchUtils.BROWSER_SEARCH_PREF + "region", "US"); - Services.prefs.setBoolPref( - SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault.ui.enabled", - true - ); Services.prefs.setBoolPref( SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault", true diff --git a/toolkit/components/search/tests/xpcshell/test_defaultPrivateEngine.js b/toolkit/components/search/tests/xpcshell/test_defaultPrivateEngine.js index 66690955d00a..efbd74a165c5 100644 --- a/toolkit/components/search/tests/xpcshell/test_defaultPrivateEngine.js +++ b/toolkit/components/search/tests/xpcshell/test_defaultPrivateEngine.js @@ -17,10 +17,6 @@ add_task(async function setup() { useTestEngineConfig(); Services.prefs.setCharPref(SearchUtils.BROWSER_SEARCH_PREF + "region", "US"); - Services.prefs.setBoolPref( - SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault.ui.enabled", - true - ); Services.prefs.setBoolPref( SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault", true @@ -49,13 +45,7 @@ add_task(async function test_defaultPrivateEngine() { "Should have the original default as the default engine" ); - let promise = promiseDefaultNotification("private"); Services.search.defaultPrivateEngine = engine1; - Assert.equal( - await promise, - engine1, - "Should have notified setting the private engine to the new one" - ); Assert.equal( Services.search.defaultPrivateEngine, engine1, @@ -66,13 +56,7 @@ add_task(async function test_defaultPrivateEngine() { originalDefault, "Should not have changed the original default engine" ); - promise = promiseDefaultNotification("private"); await Services.search.setDefaultPrivate(engine2); - Assert.equal( - await promise, - engine2, - "Should have notified setting the private engine to the new one using async api" - ); Assert.equal( Services.search.defaultPrivateEngine, engine2, @@ -92,13 +76,7 @@ add_task(async function test_defaultPrivateEngine() { "Should not have changed the original default engine" ); - promise = promiseDefaultNotification("private"); await Services.search.setDefaultPrivate(engine1); - Assert.equal( - await promise, - engine1, - "Should have notified reverting the private engine to the selected one using async api" - ); Assert.equal( Services.search.defaultPrivateEngine, engine1, @@ -129,33 +107,12 @@ add_task(async function test_defaultPrivateEngine() { }); add_task(async function test_defaultPrivateEngine_turned_off() { - Services.search.defaultEngine = originalDefault; - Services.search.defaultPrivateEngine = engine1; - - let promise = promiseDefaultNotification("private"); Services.prefs.setBoolPref( SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault", false ); - Assert.equal( - await promise, - originalDefault, - "Should have notified setting the first engine correctly." - ); - promise = promiseDefaultNotification("normal"); - let privatePromise = promiseDefaultNotification("private"); Services.search.defaultPrivateEngine = engine1; - Assert.equal( - await promise, - engine1, - "Should have notified setting the first engine correctly." - ); - Assert.equal( - await privatePromise, - engine1, - "Should have notified setting of the private engine as well." - ); Assert.equal( Services.search.defaultPrivateEngine, engine1, @@ -166,13 +123,7 @@ add_task(async function test_defaultPrivateEngine_turned_off() { engine1, "Should keep the default engine in sync with the pref off" ); - promise = promiseDefaultNotification("normal"); Services.search.defaultPrivateEngine = engine2; - Assert.equal( - await promise, - engine2, - "Should have notified setting the second engine correctly." - ); Assert.equal( Services.search.defaultPrivateEngine, engine2, @@ -183,13 +134,7 @@ add_task(async function test_defaultPrivateEngine_turned_off() { engine2, "Should keep the default engine in sync with the pref off" ); - promise = promiseDefaultNotification("normal"); Services.search.defaultPrivateEngine = engine1; - Assert.equal( - await promise, - engine1, - "Should have notified resetting to the first engine again" - ); Assert.equal( Services.search.defaultPrivateEngine, engine1, @@ -244,39 +189,3 @@ add_task(async function test_defaultPrivateEngine_turned_off() { "Should also keep the normal default if attempted to be set to a hidden engine" ); }); - -add_task(async function test_defaultPrivateEngine_ui_turned_off() { - engine1.hidden = false; - engine2.hidden = false; - Services.prefs.setBoolPref( - SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault", - true - ); - - Services.search.defaultEngine = engine2; - Services.search.defaultPrivateEngine = engine1; - - let promise = promiseDefaultNotification("private"); - Services.prefs.setBoolPref( - SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault.ui.enabled", - false - ); - Assert.equal( - await promise, - engine2, - "Should have notified for resetting of the private pref." - ); - - promise = promiseDefaultNotification("normal"); - Services.search.defaultPrivateEngine = engine1; - Assert.equal( - await promise, - engine1, - "Should have notified setting the first engine correctly." - ); - Assert.equal( - Services.search.defaultPrivateEngine, - engine1, - "Should be set to the first engine correctly" - ); -}); diff --git a/toolkit/components/search/tests/xpcshell/test_list_json_locale.js b/toolkit/components/search/tests/xpcshell/test_list_json_locale.js index 8e227c3f5e71..0aa474a44163 100644 --- a/toolkit/components/search/tests/xpcshell/test_list_json_locale.js +++ b/toolkit/components/search/tests/xpcshell/test_list_json_locale.js @@ -8,10 +8,6 @@ add_task(function test_setup() { useTestEngineConfig(); - Services.prefs.setBoolPref( - SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault.ui.enabled", - true - ); Services.prefs.setBoolPref( SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault", true diff --git a/toolkit/components/search/tests/xpcshell/test_list_json_no_private_default.js b/toolkit/components/search/tests/xpcshell/test_list_json_no_private_default.js index eb9c8a9a1e9f..da4ac097aec8 100644 --- a/toolkit/components/search/tests/xpcshell/test_list_json_no_private_default.js +++ b/toolkit/components/search/tests/xpcshell/test_list_json_no_private_default.js @@ -11,10 +11,6 @@ add_task(async function test_searchDefaultEngineUS() { useTestEngineConfig("resource://test/data1/"); - Services.prefs.setBoolPref( - SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault.ui.enabled", - true - ); Services.prefs.setBoolPref( SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault", true diff --git a/toolkit/components/search/tests/xpcshell/test_list_json_searchdefault.js b/toolkit/components/search/tests/xpcshell/test_list_json_searchdefault.js index d9f082c66843..b9e55c1f0e4f 100644 --- a/toolkit/components/search/tests/xpcshell/test_list_json_searchdefault.js +++ b/toolkit/components/search/tests/xpcshell/test_list_json_searchdefault.js @@ -9,11 +9,6 @@ add_task(async function test_searchDefaultEngineUS() { useTestEngineConfig(); - Services.prefs.setBoolPref( - SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault.ui.enabled", - true - ); - Services.prefs.setCharPref(SearchUtils.BROWSER_SEARCH_PREF + "region", "US"); await AddonTestUtils.promiseStartupManager(); diff --git a/toolkit/components/search/tests/xpcshell/test_list_json_searchorder.js b/toolkit/components/search/tests/xpcshell/test_list_json_searchorder.js index 2852109f857a..41acc8aed838 100644 --- a/toolkit/components/search/tests/xpcshell/test_list_json_searchorder.js +++ b/toolkit/components/search/tests/xpcshell/test_list_json_searchorder.js @@ -8,11 +8,6 @@ add_task(async function setup() { await AddonTestUtils.promiseStartupManager(); - Services.prefs.setBoolPref( - SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault.ui.enabled", - true - ); - useTestEngineConfig(); }); diff --git a/toolkit/components/search/tests/xpcshell/test_notifications.js b/toolkit/components/search/tests/xpcshell/test_notifications.js index 9a1cbe6658e0..93af8f2f7653 100644 --- a/toolkit/components/search/tests/xpcshell/test_notifications.js +++ b/toolkit/components/search/tests/xpcshell/test_notifications.js @@ -55,10 +55,6 @@ add_task(async function setup() { await AddonTestUtils.promiseStartupManager(); useHttpServer(); - Services.prefs.setBoolPref( - SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault.ui.enabled", - true - ); Services.prefs.setBoolPref( SearchUtils.BROWSER_SEARCH_PREF + "separatePrivateDefault", true diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js index f5659759940d..1b2d0df0b8bf 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js @@ -1894,10 +1894,6 @@ async function checkDefaultSearch(privateOn, reInitSearchService) { ); // Start off with separate default engine for private browsing turned off. - Preferences.set( - "browser.search.separatePrivateDefault.ui.enabled", - privateOn - ); Preferences.set("browser.search.separatePrivateDefault", privateOn); let data = await TelemetryEnvironment.testCleanRestart().onInitialized();