Bug 1870275 - Change more urlbar tests to use add_setup. r=adw

Differential Revision: https://phabricator.services.mozilla.com/D196575
This commit is contained in:
Mark Banner
2023-12-16 14:00:13 +00:00
parent 091cf4f804
commit 41aa2fb746
19 changed files with 19 additions and 19 deletions

View File

@@ -7,7 +7,7 @@
* Test for middle click behavior.
*/
add_task(async function test_setup() {
add_setup(async () => {
CustomizableUI.addWidgetToArea("home-button", "nav-bar");
await SpecialPowers.pushPrefEnv({
set: [["browser.tabs.searchclipboardfor.middleclick", false]],

View File

@@ -14,7 +14,7 @@ const { SEARCH_PARAMS } = MerinoClient;
let gClient;
add_task(async function init() {
add_setup(async () => {
gClient = new MerinoClient();
await MerinoTestUtils.server.start();
});

View File

@@ -101,7 +101,7 @@ let gSandbox;
let gDateNowStub;
let gStartupDateMsStub;
add_task(async function init() {
add_setup(async () => {
// Disable search suggestions so we don't hit the network.
Services.prefs.setBoolPref("browser.search.suggest.enabled", false);

View File

@@ -96,7 +96,7 @@ ChromeUtils.defineLazyGetter(
() => UrlbarProviderQuickSuggest._test_merino
);
add_task(async function init() {
add_setup(async () => {
await MerinoTestUtils.server.start();
// Set up the remote settings client with the test data.

View File

@@ -14,7 +14,7 @@ ChromeUtils.defineLazyGetter(
() => UrlbarProviderQuickSuggest._test_merino
);
add_task(async function init() {
add_setup(async () => {
await MerinoTestUtils.server.start();
await QuickSuggestTestUtils.ensureQuickSuggestInit({
prefs: [

View File

@@ -34,7 +34,7 @@ const TEST_OVERRIDES = {
defaultPrefs: DEFAULT_PREFS,
};
add_task(async function init() {
add_setup(async () => {
await UrlbarTestUtils.initNimbusFeature();
});

View File

@@ -39,7 +39,7 @@ const DEFAULT_PREFS = {
// added, set this to an object like the one in test_quicksuggest_migrate_v1.js.
const TEST_OVERRIDES = undefined;
add_task(async function init() {
add_setup(async () => {
await UrlbarTestUtils.initNimbusFeature();
});

View File

@@ -45,7 +45,7 @@ const PREFS = [
},
];
add_task(async function init() {
add_setup(async () => {
await UrlbarTestUtils.initNimbusFeature();
});

View File

@@ -33,7 +33,7 @@ const REMOTE_SETTINGS_DATA = [
},
];
add_setup(async function init() {
add_setup(async () => {
// Disable search suggestions so we don't hit the network.
Services.prefs.setBoolPref("browser.search.suggest.enabled", false);

View File

@@ -16,7 +16,7 @@ ChromeUtils.defineESModuleGetters(this, {
// behavior doesn't depend on the chunk size.
const TEST_CHUNK_SIZE = 100;
add_task(async function init() {
add_setup(async () => {
// Sanity check the actual `chunkSize` value.
Assert.equal(
typeof SuggestionsMap.chunkSize,

View File

@@ -16,7 +16,7 @@ const HISTOGRAM_RESPONSE = "FX_URLBAR_MERINO_RESPONSE_WEATHER";
const { WEATHER_RS_DATA, WEATHER_SUGGESTION } = MerinoTestUtils;
add_task(async function init() {
add_setup(async () => {
await QuickSuggestTestUtils.ensureQuickSuggestInit({
remoteSettingsRecords: [
{

View File

@@ -12,7 +12,7 @@ ChromeUtils.defineESModuleGetters(this, {
const { WEATHER_RS_DATA, WEATHER_SUGGESTION } = MerinoTestUtils;
add_task(async function init() {
add_setup(async () => {
await QuickSuggestTestUtils.ensureQuickSuggestInit({
remoteSettingsRecords: [
{

View File

@@ -388,7 +388,7 @@ async function removeOpenPages(aUri, aCount = 1, aUserContextId = 0) {
* suggestions.
*/
function testEngine_setup() {
add_task(async function setup() {
add_setup(async () => {
await cleanupPlaces();
let engine = await addTestSuggestionsEngine();
let oldDefaultEngine = await Services.search.getDefault();

View File

@@ -6,7 +6,7 @@
testEngine_setup();
add_task(async function setup() {
add_setup(async () => {
Services.prefs.setBoolPref("browser.urlbar.suggest.searches", false);
await PlacesTestUtils.addVisits({
uri: Services.io.newURI("http://mozilla.org/link/"),

View File

@@ -9,7 +9,7 @@
const TEST_ENGINE_NAME = "test autofill aliases";
const TEST_ENGINE_ALIAS = "@autofilltest";
add_task(async function init() {
add_setup(async () => {
// Add an engine with an "@" alias.
await SearchTestUtils.installSearchExtension({
name: TEST_ENGINE_NAME,

View File

@@ -11,7 +11,7 @@
testEngine_setup();
add_task(async function setup() {
add_setup(async () => {
Services.prefs.setBoolPref("browser.urlbar.autoFill", false);
Services.prefs.setBoolPref("browser.urlbar.suggest.engines", false);
Services.prefs.setBoolPref("browser.urlbar.suggest.quickactions", false);

View File

@@ -10,7 +10,7 @@
let testEngine;
add_task(async function init() {
add_setup(async () => {
// Disable search suggestions for a less verbose test.
Services.prefs.setBoolPref("browser.search.suggest.enabled", false);
// Disable tab-to-search onboarding results. Those are covered in

View File

@@ -24,7 +24,7 @@ let expectedMatch = (key, inputLength) => ({
testEngine_setup();
add_task(async function init() {
add_setup(async () => {
UrlbarPrefs.set("quickactions.enabled", true);
UrlbarPrefs.set("suggest.quickactions", true);

View File

@@ -38,7 +38,7 @@ const RESULT_GROUPS = {
};
let sandbox;
add_task(function setuo() {
add_setup(async () => {
sandbox = lazy.sinon.createSandbox();
registerCleanupFunction(() => {
sandbox.restore();