forked from mirrors/gecko-dev
Bug 1854456 - Ensure the Urlbar component's browser mochitests and XPCShell tests use add_setup correctly. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D188889
This commit is contained in:
parent
a99a113414
commit
c09bf2ddc0
19 changed files with 19 additions and 19 deletions
|
|
@ -418,7 +418,7 @@ const TEST_CASES = [
|
|||
},
|
||||
];
|
||||
|
||||
add_task(async function setup() {
|
||||
add_setup(async function () {
|
||||
UrlbarPrefs.set("quicksuggest.enabled", true);
|
||||
UrlbarPrefs.set("suggest.quicksuggest.sponsored", true);
|
||||
UrlbarPrefs.set("suggest.quicksuggest.nonsponsored", true);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ const match = new UrlbarResult(
|
|||
);
|
||||
let controller;
|
||||
|
||||
add_task(async function setup() {
|
||||
add_setup(async function () {
|
||||
controller = UrlbarTestUtils.newMockController();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ function getHistogramReportsCount(results) {
|
|||
return sum;
|
||||
}
|
||||
|
||||
add_task(function setup() {
|
||||
add_setup(function () {
|
||||
controller = UrlbarTestUtils.newMockController();
|
||||
|
||||
firstHistogram = Services.telemetry.getHistogramById(TELEMETRY_1ST_RESULT);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ function assertContextMatches(context, expectedValues) {
|
|||
}
|
||||
}
|
||||
|
||||
add_task(function setup() {
|
||||
add_setup(function () {
|
||||
sandbox = sinon.createSandbox();
|
||||
|
||||
fPM = {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ const { PlacesUIUtils } = ChromeUtils.importESModule(
|
|||
|
||||
let sandbox;
|
||||
|
||||
add_task(function setup() {
|
||||
add_setup(function () {
|
||||
sandbox = sinon.createSandbox();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
// Functional tests for inline autocomplete
|
||||
|
||||
add_task(async function setup() {
|
||||
add_setup(async function () {
|
||||
registerCleanupFunction(async () => {
|
||||
Services.prefs.clearUserPref("browser.urlbar.suggest.searches");
|
||||
Services.prefs.clearUserPref("browser.urlbar.suggest.quickactions");
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class FastHeuristicProvider extends TestProvider {
|
|||
}
|
||||
}
|
||||
|
||||
add_task(async function setup() {
|
||||
add_setup(async function () {
|
||||
registerCleanupFunction(async () => {
|
||||
Services.prefs.clearUserPref("browser.urlbar.suggest.searches");
|
||||
});
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|||
|
||||
let sandbox;
|
||||
|
||||
add_task(async function setup() {
|
||||
add_setup(async function () {
|
||||
sandbox = lazy.sinon.createSandbox();
|
||||
registerCleanupFunction(() => {
|
||||
sandbox.restore();
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ const TEST_SPACES = [" ", "\u3000", " \u3000", "\u3000 "];
|
|||
|
||||
testEngine_setup();
|
||||
|
||||
add_task(async function setup() {
|
||||
add_setup(async function () {
|
||||
registerCleanupFunction(async () => {
|
||||
Services.prefs.clearUserPref(QUICKACTIONS_PREF);
|
||||
Services.prefs.clearUserPref(SUGGEST_ENABLED_PREF);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
// Test for the behavior of UrlbarProviderHistoryUrlHeuristic.
|
||||
|
||||
add_task(async function setup() {
|
||||
add_setup(async function () {
|
||||
Services.prefs.setBoolPref("browser.urlbar.autoFill", false);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("browser.urlbar.autoFill");
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ async function cleanup() {
|
|||
await PlacesUtils.history.clear();
|
||||
}
|
||||
|
||||
add_task(function setup() {
|
||||
add_setup(function () {
|
||||
Services.prefs.setBoolPref(SUGGEST_PREF, false);
|
||||
Services.prefs.setBoolPref(SUGGEST_ENABLED_PREF, false);
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ ChromeUtils.defineESModuleGetters(this, {
|
|||
UrlbarProviderAutofill: "resource:///modules/UrlbarProviderAutofill.sys.mjs",
|
||||
});
|
||||
|
||||
add_task(async function setup() {
|
||||
add_setup(async function () {
|
||||
Services.prefs.setBoolPref("browser.urlbar.suggest.searches", false);
|
||||
Services.prefs.setBoolPref("browser.urlbar.suggest.quickactions", false);
|
||||
// Disable tab-to-search onboarding results.
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ function configureEngine(clients) {
|
|||
|
||||
testEngine_setup();
|
||||
|
||||
add_task(async function setup() {
|
||||
add_setup(async function () {
|
||||
// Tell Sync about the mocks.
|
||||
Weave.Service.engineManager.register(MockTabsEngine);
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ const MAX_RESULTS = 10;
|
|||
|
||||
let sandbox;
|
||||
|
||||
add_task(async function setup() {
|
||||
add_setup(async function () {
|
||||
// Set a specific maxRichResults for sanity's sake.
|
||||
Services.prefs.setIntPref(MAX_RICH_RESULTS_PREF, MAX_RESULTS);
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
testEngine_setup();
|
||||
|
||||
const engineDomain = "s.example.com";
|
||||
add_task(async function setup() {
|
||||
add_setup(async function () {
|
||||
Services.prefs.setBoolPref("browser.urlbar.restyleSearches", true);
|
||||
await SearchTestUtils.installSearchExtension({
|
||||
name: "MozSearch",
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ function setResultGroups(groups) {
|
|||
});
|
||||
}
|
||||
|
||||
add_task(async function setup() {
|
||||
add_setup(async function () {
|
||||
sandbox = lazy.sinon.createSandbox();
|
||||
|
||||
let engine = await addTestSuggestionsEngine(searchStr => {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ const TEST_SPACES = [" ", "\u3000", " \u3000", "\u3000 "];
|
|||
let engine;
|
||||
let port;
|
||||
|
||||
add_task(async function setup() {
|
||||
add_setup(async function () {
|
||||
engine = await addTestSuggestionsEngine();
|
||||
port = engine.getSubmission("").uri.port;
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ async function cleanUpSuggestions() {
|
|||
}
|
||||
}
|
||||
|
||||
add_task(async function setup() {
|
||||
add_setup(async function () {
|
||||
let engine = await addTestTailSuggestionsEngine(searchStr => {
|
||||
return suggestionsFn(searchStr);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
* 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/. */
|
||||
|
||||
add_task(async function setup() {
|
||||
add_setup(async function () {
|
||||
registerCleanupFunction(async () => {
|
||||
Services.prefs.clearUserPref("browser.urlbar.suggest.searches");
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue