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:
@@ -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]],
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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: [
|
||||
|
||||
@@ -34,7 +34,7 @@ const TEST_OVERRIDES = {
|
||||
defaultPrefs: DEFAULT_PREFS,
|
||||
};
|
||||
|
||||
add_task(async function init() {
|
||||
add_setup(async () => {
|
||||
await UrlbarTestUtils.initNimbusFeature();
|
||||
});
|
||||
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ const PREFS = [
|
||||
},
|
||||
];
|
||||
|
||||
add_task(async function init() {
|
||||
add_setup(async () => {
|
||||
await UrlbarTestUtils.initNimbusFeature();
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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: [
|
||||
{
|
||||
|
||||
@@ -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: [
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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/"),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ const RESULT_GROUPS = {
|
||||
};
|
||||
|
||||
let sandbox;
|
||||
add_task(function setuo() {
|
||||
add_setup(async () => {
|
||||
sandbox = lazy.sinon.createSandbox();
|
||||
registerCleanupFunction(() => {
|
||||
sandbox.restore();
|
||||
|
||||
Reference in New Issue
Block a user