Commit ecf3387c authored by Mark Banner's avatar Mark Banner
Browse files

Bug 1601633 - Switch some more search xpcshell-tests to use the useTestEngines...

Bug 1601633 - Switch some more search xpcshell-tests to use the useTestEngines helper function. r=mikedeboer

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

--HG--
extra : moz-landing-system : lando
parent 7e33411d
......@@ -5,7 +5,7 @@
"use strict";
function run_test() {
add_task(async function setup() {
let defaultBranch = Services.prefs.getDefaultBranch(
SearchUtils.BROWSER_SEARCH_PREF
);
......@@ -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();
......
......@@ -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() {
......
......@@ -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();
......
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