Skip to content

Commit

Permalink
Bug 1601633 - Switch some more search xpcshell-tests to use the useTe…
Browse files Browse the repository at this point in the history
…stEngines helper function. r=mikedeboer

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

--HG--
extra : moz-landing-system : lando
  • Loading branch information
Standard8 committed Dec 5, 2019
1 parent 7e33411 commit ecf3387
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
Expand Up @@ -5,7 +5,7 @@

"use strict";

function run_test() {
add_task(async function setup() {
let defaultBranch = Services.prefs.getDefaultBranch(
SearchUtils.BROWSER_SEARCH_PREF
);
Expand All @@ -16,16 +16,10 @@ function run_test() {

// The test engines used in this test need to be recognized as 'default'
// engines or the resource URL won't be used
let url = "resource://test/data/";
let resProt = Services.io
.getProtocolHandler("resource")
.QueryInterface(Ci.nsIResProtocolHandler);
resProt.setSubstitution("search-extensions", Services.io.newURI(url));
await useTestEngines();

Assert.ok(!Services.search.isInitialized);

run_next_test();
}
});

add_task(async function test_disthidden() {
await AddonTestUtils.promiseStartupManager();
Expand Down
6 changes: 1 addition & 5 deletions toolkit/components/search/tests/xpcshell/test_pref.js
Expand Up @@ -14,11 +14,7 @@ const baseURL = "https://www.google.com/search?q=foo";
add_task(async function setup() {
// The test engines used in this test need to be recognized as 'default'
// engines, or their MozParams will be ignored.
let url = "resource://test/data/";
let resProt = Services.io
.getProtocolHandler("resource")
.QueryInterface(Ci.nsIResProtocolHandler);
resProt.setSubstitution("search-extensions", Services.io.newURI(url));
await useTestEngines();
});

add_task(async function test_pref_initial_value() {
Expand Down
6 changes: 1 addition & 5 deletions toolkit/components/search/tests/xpcshell/test_purpose.js
Expand Up @@ -11,11 +11,7 @@
add_task(async function setup() {
// The test engines used in this test need to be recognized as 'default'
// engines, or their MozParams used to set the purpose will be ignored.
let url = "resource://test/data/";
let resProt = Services.io
.getProtocolHandler("resource")
.QueryInterface(Ci.nsIResProtocolHandler);
resProt.setSubstitution("search-extensions", Services.io.newURI(url));
await useTestEngines();

await AddonTestUtils.promiseStartupManager();
await Services.search.init();
Expand Down

0 comments on commit ecf3387

Please sign in to comment.