Commit 7e33411d authored by Mark Banner's avatar Mark Banner
Browse files

Bug 1601633 - In search tests, when running asyncReInit, don't reset the...

Bug 1601633 - In search tests, when running asyncReInit, don't reset the search service. r=mikedeboer

SearchService.reset() isn't designed to be called with reInit, but with init.

Differential Revision: https://phabricator.services.mozilla.com/D55462

--HG--
extra : moz-landing-system : lando
parent b0370355
......@@ -509,10 +509,7 @@ function installTestEngine() {
return addTestEngines([{ name: kTestEngineName, xmlFileName: "engine.xml" }]);
}
async function asyncReInit({
waitForRegionFetch = false,
skipReset = false,
} = {}) {
async function asyncReInit({ waitForRegionFetch = false } = {}) {
let promises = [SearchTestUtils.promiseSearchNotification("reinit-complete")];
if (waitForRegionFetch) {
promises.push(
......@@ -520,9 +517,6 @@ async function asyncReInit({
);
}
if (!skipReset) {
Services.search.reset();
}
Services.search.reInit(!waitForRegionFetch);
return Promise.all(promises);
......
......@@ -84,7 +84,7 @@ add_task(async function test_listJSONlocaleSwitch() {
add_task(async function test_listJSONRegionOverride() {
Services.prefs.setCharPref("browser.search.region", "RU");
await asyncReInit({ skipReset: true });
await asyncReInit();
Assert.ok(Services.search.isInitialized, "search initialized");
......
......@@ -41,7 +41,7 @@ add_task(async function test_defaultEngineNameUserPrefUS() {
// Set the browser.search.defaultenginename pref.
Services.prefs.setCharPref(kDefaultenginenamePref, "Bing");
await asyncReInit({ skipReset: true });
await asyncReInit();
Assert.equal(
(await Services.search.getDefault()).name,
defaultEngineName,
......@@ -66,7 +66,7 @@ add_task(async function test_defaultEngineNameDefaultPrefUS() {
"data:text/plain,browser.search.defaultenginename=Bing"
);
await asyncReInit({ skipReset: true });
await asyncReInit();
Assert.equal(
(await Services.search.getDefault()).name,
"Bing",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment