diff --git a/browser/base/content/test/about/browser_aboutNewTab_bookmarksToolbarEmpty.js b/browser/base/content/test/about/browser_aboutNewTab_bookmarksToolbarEmpty.js index deb3260326797..cb8bab2614082 100644 --- a/browser/base/content/test/about/browser_aboutNewTab_bookmarksToolbarEmpty.js +++ b/browser/base/content/test/about/browser_aboutNewTab_bookmarksToolbarEmpty.js @@ -18,7 +18,7 @@ const bookmarksInfo = [ }, ]; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ // Ensure we can wait for about:newtab to load. set: [["browser.newtab.preload", false]], diff --git a/browser/base/content/test/alerts/browser_notification_do_not_disturb.js b/browser/base/content/test/alerts/browser_notification_do_not_disturb.js index cfae32e216ca2..0cee5585621f7 100644 --- a/browser/base/content/test/alerts/browser_notification_do_not_disturb.js +++ b/browser/base/content/test/alerts/browser_notification_do_not_disturb.js @@ -20,7 +20,7 @@ const PAGE = // to show up before we decide that it's not coming. const NOTIFICATION_TIMEOUT_SECS = 2000; -add_task(async function setup() { +add_setup(async function() { await addNotificationPermission(PAGE); }); diff --git a/browser/base/content/test/captivePortal/browser_captivePortalTabReference.js b/browser/base/content/test/captivePortal/browser_captivePortalTabReference.js index 63978a720e8ae..73297535acb12 100644 --- a/browser/base/content/test/captivePortal/browser_captivePortalTabReference.js +++ b/browser/base/content/test/captivePortal/browser_captivePortalTabReference.js @@ -40,7 +40,7 @@ async function checkCaptivePortalTabReference(evt, currState) { gBrowser.removeTab(errorTab); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["captivedetect.canonicalURL", CANONICAL_URL], diff --git a/browser/base/content/test/captivePortal/browser_captivePortal_certErrorUI.js b/browser/base/content/test/captivePortal/browser_captivePortal_certErrorUI.js index 215f32d529fde..35d5bd64386fe 100644 --- a/browser/base/content/test/captivePortal/browser_captivePortal_certErrorUI.js +++ b/browser/base/content/test/captivePortal/browser_captivePortal_certErrorUI.js @@ -3,7 +3,7 @@ "use strict"; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["captivedetect.canonicalURL", CANONICAL_URL], diff --git a/browser/base/content/test/captivePortal/browser_captivePortal_https_only.js b/browser/base/content/test/captivePortal/browser_captivePortal_https_only.js index 5b58c3bcc730f..3e9e69201ced6 100644 --- a/browser/base/content/test/captivePortal/browser_captivePortal_https_only.js +++ b/browser/base/content/test/captivePortal/browser_captivePortal_https_only.js @@ -12,7 +12,7 @@ const testPath = getRootDirectory(gTestPath).replace( const CANONICAL_URI = Services.io.newURI(testPath); const PERMISSION_NAME = "https-only-load-insecure"; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ // That changes the canoncicalURL from "http://{server}/captive-detect/success.txt" // to http://example.com diff --git a/browser/base/content/test/captivePortal/browser_closeCapPortalTabCanonicalURL.js b/browser/base/content/test/captivePortal/browser_closeCapPortalTabCanonicalURL.js index 22e38ca0b9c4e..bc30c95419807 100644 --- a/browser/base/content/test/captivePortal/browser_closeCapPortalTabCanonicalURL.js +++ b/browser/base/content/test/captivePortal/browser_closeCapPortalTabCanonicalURL.js @@ -35,7 +35,7 @@ function unlockHandler(request, response) { response.setHeader("Location", CANONICAL_SUCCESS_URL); } -add_task(async function setup() { +add_setup(async function() { // Set up a mock server for handling captive portal redirect. server = new HttpServer(); server.registerPathHandler("/success", redirectHandler); diff --git a/browser/base/content/test/contextMenu/browser_contextmenu_loadblobinnewtab.js b/browser/base/content/test/contextMenu/browser_contextmenu_loadblobinnewtab.js index d8e7be99bf254..0154faf70a0dc 100644 --- a/browser/base/content/test/contextMenu/browser_contextmenu_loadblobinnewtab.js +++ b/browser/base/content/test/contextMenu/browser_contextmenu_loadblobinnewtab.js @@ -135,7 +135,7 @@ async function openInNewTabAndReturnContent(selector) { return blobDataFromContent; } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["privacy.partition.bloburl_per_agent_cluster", false]], }); diff --git a/browser/base/content/test/contextMenu/browser_contextmenu_touch.js b/browser/base/content/test/contextMenu/browser_contextmenu_touch.js index 81e6462a380d5..f30e861d34120 100644 --- a/browser/base/content/test/contextMenu/browser_contextmenu_touch.js +++ b/browser/base/content/test/contextMenu/browser_contextmenu_touch.js @@ -35,7 +35,7 @@ async function openAndCheckContextMenu(contextMenu, target) { } // Ensure that we can run touch events properly for windows [10] -add_task(async function setup() { +add_setup(async function() { let isWindows = AppConstants.isPlatformAndVersionAtLeast("win", "10.0"); await SpecialPowers.pushPrefEnv({ set: [["apz.test.fails_with_native_injection", isWindows]], diff --git a/browser/base/content/test/favicons/browser_preferred_icons.js b/browser/base/content/test/favicons/browser_preferred_icons.js index 8b9893f264e25..ced7c27fec4ca 100644 --- a/browser/base/content/test/favicons/browser_preferred_icons.js +++ b/browser/base/content/test/favicons/browser_preferred_icons.js @@ -28,7 +28,7 @@ function createLinks(linkInfos) { }); } -add_task(async function setup() { +add_setup(async function() { const URL = ROOT + "discovery.html"; let iconPromise = waitIcon("http://mochi.test:8888/favicon.ico"); let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, URL); diff --git a/browser/base/content/test/forms/browser_selectpopup.js b/browser/base/content/test/forms/browser_selectpopup.js index 88573f38d2e3d..d7c0972792a5c 100644 --- a/browser/base/content/test/forms/browser_selectpopup.js +++ b/browser/base/content/test/forms/browser_selectpopup.js @@ -321,7 +321,7 @@ async function doSelectTests(contentType, content) { BrowserTestUtils.removeTab(tab); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["dom.forms.select.customstyling", true]], }); diff --git a/browser/base/content/test/forms/browser_selectpopup_colors.js b/browser/base/content/test/forms/browser_selectpopup_colors.js index d5b56f8bbe21b..9335916506901 100644 --- a/browser/base/content/test/forms/browser_selectpopup_colors.js +++ b/browser/base/content/test/forms/browser_selectpopup_colors.js @@ -459,7 +459,7 @@ async function testSelectColors(selectID, itemCount, options) { // System colors may be different in content pages and chrome pages. let kDefaultSelectStyles = {}; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["dom.forms.select.customstyling", true]], }); diff --git a/browser/base/content/test/forms/browser_selectpopup_searchfocus.js b/browser/base/content/test/forms/browser_selectpopup_searchfocus.js index 72ce956cb0e15..bb7035406db96 100644 --- a/browser/base/content/test/forms/browser_selectpopup_searchfocus.js +++ b/browser/base/content/test/forms/browser_selectpopup_searchfocus.js @@ -6,7 +6,7 @@ SELECT += ' ' + ""; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["dom.forms.selectSearch", true]], }); diff --git a/browser/base/content/test/fullscreen/browser_fullscreen_window_focus.js b/browser/base/content/test/fullscreen/browser_fullscreen_window_focus.js index d92de931d1aab..ac53cac54c582 100644 --- a/browser/base/content/test/fullscreen/browser_fullscreen_window_focus.js +++ b/browser/base/content/test/fullscreen/browser_fullscreen_window_focus.js @@ -76,7 +76,7 @@ async function testWindowElementFocus(isPopup) { BrowserTestUtils.removeTab(tab); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["dom.disable_open_during_load", false], // Allow window.focus calls without user interaction diff --git a/browser/base/content/test/fullscreen/browser_fullscreen_window_open.js b/browser/base/content/test/fullscreen/browser_fullscreen_window_open.js index 460b6a0bf0bc0..1a853f0437b62 100644 --- a/browser/base/content/test/fullscreen/browser_fullscreen_window_open.js +++ b/browser/base/content/test/fullscreen/browser_fullscreen_window_open.js @@ -28,7 +28,7 @@ async function testWindowOpen(iframeID) { BrowserTestUtils.removeTab(tab); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["dom.disable_open_during_load", false], // Allow window.open calls without user interaction diff --git a/browser/base/content/test/general/browser_datachoices_notification.js b/browser/base/content/test/general/browser_datachoices_notification.js index 38c1cc01ea7f9..78d864d739120 100644 --- a/browser/base/content/test/general/browser_datachoices_notification.js +++ b/browser/base/content/test/general/browser_datachoices_notification.js @@ -113,7 +113,7 @@ var checkInfobarButton = async function(aNotification) { await promiseNextTick(); }; -add_task(async function setup() { +add_setup(async function() { const isFirstRun = Preferences.get(PREF_FIRST_RUN, true); const bypassNotification = Preferences.get(PREF_BYPASS_NOTIFICATION, true); const currentPolicyVersion = Preferences.get(PREF_CURRENT_POLICY_VERSION, 1); diff --git a/browser/base/content/test/general/browser_storagePressure_notification.js b/browser/base/content/test/general/browser_storagePressure_notification.js index 7fe30af499e8d..2a720b3a3010a 100644 --- a/browser/base/content/test/general/browser_storagePressure_notification.js +++ b/browser/base/content/test/general/browser_storagePressure_notification.js @@ -27,7 +27,7 @@ function openAboutPrefPromise(win) { ]; return Promise.all(promises); } -add_task(async function setup() { +add_setup(async function() { let win = await BrowserTestUtils.openNewBrowserWindow(); // Open a new tab to keep the window open. await BrowserTestUtils.openNewForegroundTab( diff --git a/browser/base/content/test/general/browser_unknownContentType_title.js b/browser/base/content/test/general/browser_unknownContentType_title.js index 8ac32cdcb48dc..33d4c0d1016dd 100644 --- a/browser/base/content/test/general/browser_unknownContentType_title.js +++ b/browser/base/content/test/general/browser_unknownContentType_title.js @@ -16,7 +16,7 @@ function waitForNewWindow() { }); } -add_task(async function setup() { +add_setup(async function() { let tmpDir = PathUtils.join( PathUtils.tempDir, "testsavedir" + Math.floor(Math.random() * 2 ** 32) diff --git a/browser/base/content/test/keyboard/browser_toolbarKeyNav.js b/browser/base/content/test/keyboard/browser_toolbarKeyNav.js index cde12b057070c..07630db64c643 100644 --- a/browser/base/content/test/keyboard/browser_toolbarKeyNav.js +++ b/browser/base/content/test/keyboard/browser_toolbarKeyNav.js @@ -94,7 +94,7 @@ function withNewBlankTab(taskFn) { const BOOKMARKS_COUNT = 100; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.toolbars.keyboard_navigation", true], diff --git a/browser/base/content/test/permissions/browser_autoplay_blocked.js b/browser/base/content/test/permissions/browser_autoplay_blocked.js index a41f84766d80a..4fc8b40d626ad 100644 --- a/browser/base/content/test/permissions/browser_autoplay_blocked.js +++ b/browser/base/content/test/permissions/browser_autoplay_blocked.js @@ -73,7 +73,7 @@ function testPermListHasEntries(expectEntries) { ok(!listEntryCount, "List of permissions is empty"); } -add_task(async function setup() { +add_setup(async function() { registerCleanupFunction(() => { Services.perms.removeAll(); Services.prefs.clearUserPref(AUTOPLAY_PREF); diff --git a/browser/base/content/test/permissions/browser_permission_delegate_geo.js b/browser/base/content/test/permissions/browser_permission_delegate_geo.js index 635d83ed15f83..316758d3ec545 100644 --- a/browser/base/content/test/permissions/browser_permission_delegate_geo.js +++ b/browser/base/content/test/permissions/browser_permission_delegate_geo.js @@ -112,7 +112,7 @@ async function checkGeolocation(browser, frameId, expect) { } } -add_task(async function setup() { +add_setup(async function() { await new Promise(r => { SpecialPowers.pushPrefEnv( { diff --git a/browser/base/content/test/popupNotifications/browser_displayURI.js b/browser/base/content/test/popupNotifications/browser_displayURI.js index 1d5b8ac44530a..43484913a0317 100644 --- a/browser/base/content/test/popupNotifications/browser_displayURI.js +++ b/browser/base/content/test/popupNotifications/browser_displayURI.js @@ -84,7 +84,7 @@ async function check(contentTask, options = {}) { } } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["media.navigator.permission.fake", true], diff --git a/browser/base/content/test/popups/browser_popup_blocker.js b/browser/base/content/test/popups/browser_popup_blocker.js index 5c01791954f04..70eb14a71f71f 100644 --- a/browser/base/content/test/popups/browser_popup_blocker.js +++ b/browser/base/content/test/popups/browser_popup_blocker.js @@ -15,7 +15,7 @@ function clearAllPermissionsByPrefix(aPrefix) { } } -add_task(async function setup() { +add_setup(async function() { // Enable the popup blocker. await SpecialPowers.pushPrefEnv({ set: [["dom.disable_open_during_load", true]], diff --git a/browser/base/content/test/protectionsUI/browser_protectionsUI.js b/browser/base/content/test/protectionsUI/browser_protectionsUI.js index 0805374e84001..8dd901ea69096 100644 --- a/browser/base/content/test/protectionsUI/browser_protectionsUI.js +++ b/browser/base/content/test/protectionsUI/browser_protectionsUI.js @@ -18,7 +18,7 @@ const { CustomizableUITestUtils } = ChromeUtils.import( "resource://testing-common/CustomizableUITestUtils.jsm" ); -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ // Set the auto hide timing to 100ms for blocking the test less. diff --git a/browser/base/content/test/protectionsUI/browser_protectionsUI_cookies_subview.js b/browser/base/content/test/protectionsUI/browser_protectionsUI_cookies_subview.js index 86bfb573cb05a..1fc28a37709b6 100644 --- a/browser/base/content/test/protectionsUI/browser_protectionsUI_cookies_subview.js +++ b/browser/base/content/test/protectionsUI/browser_protectionsUI_cookies_subview.js @@ -12,7 +12,7 @@ const CONTAINER_PAGE = const TPC_PREF = "network.cookie.cookieBehavior"; -add_task(async function setup() { +add_setup(async function() { await UrlClassifierTestUtils.addTestTrackers(); registerCleanupFunction(() => { diff --git a/browser/base/content/test/protectionsUI/browser_protectionsUI_cryptominers.js b/browser/base/content/test/protectionsUI/browser_protectionsUI_cryptominers.js index 8be2103071aec..d4a6d35363e08 100644 --- a/browser/base/content/test/protectionsUI/browser_protectionsUI_cryptominers.js +++ b/browser/base/content/test/protectionsUI/browser_protectionsUI_cryptominers.js @@ -8,7 +8,7 @@ const TRACKING_PAGE = const CM_PROTECTION_PREF = "privacy.trackingprotection.cryptomining.enabled"; let cmHistogram; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ [ diff --git a/browser/base/content/test/protectionsUI/browser_protectionsUI_fingerprinters.js b/browser/base/content/test/protectionsUI/browser_protectionsUI_fingerprinters.js index 441b465853dad..fcbeac2d16d45 100644 --- a/browser/base/content/test/protectionsUI/browser_protectionsUI_fingerprinters.js +++ b/browser/base/content/test/protectionsUI/browser_protectionsUI_fingerprinters.js @@ -8,7 +8,7 @@ const TRACKING_PAGE = const FP_PROTECTION_PREF = "privacy.trackingprotection.fingerprinting.enabled"; let fpHistogram; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ [ diff --git a/browser/base/content/test/protectionsUI/browser_protectionsUI_milestones.js b/browser/base/content/test/protectionsUI/browser_protectionsUI_milestones.js index 0748e9752d4a7..c61fd7a401bef 100644 --- a/browser/base/content/test/protectionsUI/browser_protectionsUI_milestones.js +++ b/browser/base/content/test/protectionsUI/browser_protectionsUI_milestones.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ // Hide protections cards so as not to trigger more async messaging diff --git a/browser/base/content/test/protectionsUI/browser_protectionsUI_open_preferences.js b/browser/base/content/test/protectionsUI/browser_protectionsUI_open_preferences.js index 0cad097569092..1b52fe55bb173 100644 --- a/browser/base/content/test/protectionsUI/browser_protectionsUI_open_preferences.js +++ b/browser/base/content/test/protectionsUI/browser_protectionsUI_open_preferences.js @@ -40,7 +40,7 @@ async function waitAndAssertPreferencesShown(_spotlight) { BrowserTestUtils.removeTab(gBrowser.selectedTab); } -add_task(async function setup() { +add_setup(async function() { await UrlClassifierTestUtils.addTestTrackers(); let oldCanRecord = Services.telemetry.canRecordExtended; Services.telemetry.canRecordExtended = true; diff --git a/browser/base/content/test/protectionsUI/browser_protectionsUI_report_breakage.js b/browser/base/content/test/protectionsUI/browser_protectionsUI_report_breakage.js index abc503658b2da..1e1ed71189c74 100644 --- a/browser/base/content/test/protectionsUI/browser_protectionsUI_report_breakage.js +++ b/browser/base/content/test/protectionsUI/browser_protectionsUI_report_breakage.js @@ -23,7 +23,7 @@ let { Preferences } = ChromeUtils.import( "resource://gre/modules/Preferences.jsm" ); -add_task(async function setup() { +add_setup(async function() { await UrlClassifierTestUtils.addTestTrackers(); registerCleanupFunction(() => { diff --git a/browser/base/content/test/protectionsUI/browser_protectionsUI_shield_visibility.js b/browser/base/content/test/protectionsUI/browser_protectionsUI_shield_visibility.js index be3cc46118c61..4eb9b3247a791 100644 --- a/browser/base/content/test/protectionsUI/browser_protectionsUI_shield_visibility.js +++ b/browser/base/content/test/protectionsUI/browser_protectionsUI_shield_visibility.js @@ -74,7 +74,7 @@ const TEST_CASES = [ }, ]; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ // By default, proxies don't apply to 127.0.0.1. We need them to for this test, though: diff --git a/browser/base/content/test/protectionsUI/browser_protectionsUI_socialtracking.js b/browser/base/content/test/protectionsUI/browser_protectionsUI_socialtracking.js index 93a4b0dfc0e0a..ffea33f685d65 100644 --- a/browser/base/content/test/protectionsUI/browser_protectionsUI_socialtracking.js +++ b/browser/base/content/test/protectionsUI/browser_protectionsUI_socialtracking.js @@ -9,7 +9,7 @@ const TRACKING_PAGE = const ST_PROTECTION_PREF = "privacy.trackingprotection.socialtracking.enabled"; const ST_BLOCK_COOKIES_PREF = "privacy.socialtracking.block_cookies.enabled"; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ [ST_BLOCK_COOKIES_PREF, true], diff --git a/browser/base/content/test/protectionsUI/browser_protectionsUI_subview_shim.js b/browser/base/content/test/protectionsUI/browser_protectionsUI_subview_shim.js index 736b008253227..b3ae1b827efc4 100644 --- a/browser/base/content/test/protectionsUI/browser_protectionsUI_subview_shim.js +++ b/browser/base/content/test/protectionsUI/browser_protectionsUI_subview_shim.js @@ -14,7 +14,7 @@ const TRACKING_PAGE = "http://example.net/browser/browser/base/content/test/protectionsUI/trackingPage.html"; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["privacy.trackingprotection.enabled", true], diff --git a/browser/base/content/test/protectionsUI/browser_protectionsUI_telemetry.js b/browser/base/content/test/protectionsUI/browser_protectionsUI_telemetry.js index 70cc24b7fd16e..ffc8dedc1a7aa 100644 --- a/browser/base/content/test/protectionsUI/browser_protectionsUI_telemetry.js +++ b/browser/base/content/test/protectionsUI/browser_protectionsUI_telemetry.js @@ -29,7 +29,7 @@ function getShieldCounts() { return getShieldHistogram().snapshot().values; } -add_task(async function setup() { +add_setup(async function() { await UrlClassifierTestUtils.addTestTrackers(); Services.prefs.setBoolPref(DTSCBN_PREF, true); diff --git a/browser/base/content/test/protectionsUI/browser_protectionsUI_trackers_subview.js b/browser/base/content/test/protectionsUI/browser_protectionsUI_trackers_subview.js index 3dea57cb75fd3..b500d066f1e92 100644 --- a/browser/base/content/test/protectionsUI/browser_protectionsUI_trackers_subview.js +++ b/browser/base/content/test/protectionsUI/browser_protectionsUI_trackers_subview.js @@ -13,7 +13,7 @@ const TRACKING_PAGE = const TP_PREF = "privacy.trackingprotection.enabled"; -add_task(async function setup() { +add_setup(async function() { await UrlClassifierTestUtils.addTestTrackers(); registerCleanupFunction(() => { diff --git a/browser/base/content/test/sidebar/browser_sidebar_adopt.js b/browser/base/content/test/sidebar/browser_sidebar_adopt.js index 58c155bed3c46..6d206e1b23aa4 100644 --- a/browser/base/content/test/sidebar/browser_sidebar_adopt.js +++ b/browser/base/content/test/sidebar/browser_sidebar_adopt.js @@ -12,7 +12,7 @@ function failIfSidebarFocusedFires() { ok(false, "This event shouldn't have fired"); } -add_task(function setup() { +add_setup(function() { CustomizableUI.addWidgetToArea("sidebar-button", "nav-bar"); registerCleanupFunction(() => CustomizableUI.removeWidgetFromArea("sidebar-button") diff --git a/browser/base/content/test/siteIdentity/browser_bug902156.js b/browser/base/content/test/siteIdentity/browser_bug902156.js index 40b11851a306d..6eb6799dad5db 100644 --- a/browser/base/content/test/siteIdentity/browser_bug902156.js +++ b/browser/base/content/test/siteIdentity/browser_bug902156.js @@ -34,7 +34,7 @@ const HTTPS_TEST_ROOT_2 = getRootDirectory(gTestPath).replace( "https://test2.example.com" ); -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [[PREF_ACTIVE, true]] }); }); diff --git a/browser/base/content/test/sync/browser_contextmenu_sendpage.js b/browser/base/content/test/sync/browser_contextmenu_sendpage.js index 882b2a93eab94..ced21e77116f1 100644 --- a/browser/base/content/test/sync/browser_contextmenu_sendpage.js +++ b/browser/base/content/test/sync/browser_contextmenu_sendpage.js @@ -27,7 +27,7 @@ const fxaDevices = [ { id: 4, name: "Homer" }, // Incompatible target. ]; -add_task(async function setup() { +add_setup(async function() { await promiseSyncReady(); await Services.search.init(); // gSync.init() is called in a requestIdleCallback. Force its initialization. diff --git a/browser/base/content/test/sync/browser_contextmenu_sendtab.js b/browser/base/content/test/sync/browser_contextmenu_sendtab.js index cb7cb4c894336..fe890c1c42ce2 100644 --- a/browser/base/content/test/sync/browser_contextmenu_sendtab.js +++ b/browser/base/content/test/sync/browser_contextmenu_sendtab.js @@ -50,7 +50,7 @@ function updateTabContextMenu(tab = gBrowser.selectedTab) { menu.hidePopup(); } -add_task(async function setup() { +add_setup(async function() { await promiseSyncReady(); await Services.search.init(); // gSync.init() is called in a requestIdleCallback. Force its initialization. diff --git a/browser/base/content/test/sync/browser_sync.js b/browser/base/content/test/sync/browser_sync.js index 081ce930e1829..1143a94df8362 100644 --- a/browser/base/content/test/sync/browser_sync.js +++ b/browser/base/content/test/sync/browser_sync.js @@ -9,7 +9,7 @@ const { CustomizableUITestUtils } = ChromeUtils.import( let gCUITestUtils = new CustomizableUITestUtils(window); -add_task(async function setup() { +add_setup(async function() { // gSync.init() is called in a requestIdleCallback. Force its initialization. gSync.init(); // This preference gets set the very first time that the FxA menu gets opened, diff --git a/browser/base/content/test/tabPrompts/browser_confirmFolderUpload.js b/browser/base/content/test/tabPrompts/browser_confirmFolderUpload.js index e9231647f9ed5..bbff8fa125b37 100644 --- a/browser/base/content/test/tabPrompts/browser_confirmFolderUpload.js +++ b/browser/base/content/test/tabPrompts/browser_confirmFolderUpload.js @@ -36,7 +36,7 @@ function getTestDirectory() { return tmpDir.path; } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ // Allow using our MockFilePicker in the content process. diff --git a/browser/base/content/test/tabPrompts/browser_contentOrigins.js b/browser/base/content/test/tabPrompts/browser_contentOrigins.js index 074727081939d..a9ae314bcd5b6 100644 --- a/browser/base/content/test/tabPrompts/browser_contentOrigins.js +++ b/browser/base/content/test/tabPrompts/browser_contentOrigins.js @@ -125,7 +125,7 @@ async function checkDialog( }); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["prompts.contentPromptSubDialog", true], diff --git a/browser/base/content/test/tabcrashed/browser_noPermanentKey.js b/browser/base/content/test/tabcrashed/browser_noPermanentKey.js index 239938f9904ae..1fdcfaca96014 100644 --- a/browser/base/content/test/tabcrashed/browser_noPermanentKey.js +++ b/browser/base/content/test/tabcrashed/browser_noPermanentKey.js @@ -3,7 +3,7 @@ const PAGE = "data:text/html,A%20regular,%20everyday,%20normal%20page."; -add_task(async function setup() { +add_setup(async function() { await setupLocalCrashReportServer(); }); diff --git a/browser/base/content/test/tabcrashed/browser_shown.js b/browser/base/content/test/tabcrashed/browser_shown.js index 16e6a54feecef..92281a35d89e0 100644 --- a/browser/base/content/test/tabcrashed/browser_shown.js +++ b/browser/base/content/test/tabcrashed/browser_shown.js @@ -7,7 +7,7 @@ const COMMENTS = "Here's my test comment!"; // Avoid timeouts, as in bug 1325530 requestLongerTimeout(2); -add_task(async function setup() { +add_setup(async function() { await setupLocalCrashReportServer(); }); diff --git a/browser/base/content/test/tabcrashed/browser_withoutDump.js b/browser/base/content/test/tabcrashed/browser_withoutDump.js index fa261da434cf5..894950b002fab 100644 --- a/browser/base/content/test/tabcrashed/browser_withoutDump.js +++ b/browser/base/content/test/tabcrashed/browser_withoutDump.js @@ -3,7 +3,7 @@ const PAGE = "data:text/html,A%20regular,%20everyday,%20normal%20page."; -add_task(async function setup() { +add_setup(async function() { prepareNoDump(); }); diff --git a/browser/base/content/test/tabdialogs/browser_tabdialogbox_content_prompts.js b/browser/base/content/test/tabdialogs/browser_tabdialogbox_content_prompts.js index f0d2b4f42931d..0c84f3a35ae15 100644 --- a/browser/base/content/test/tabdialogs/browser_tabdialogbox_content_prompts.js +++ b/browser/base/content/test/tabdialogs/browser_tabdialogbox_content_prompts.js @@ -41,7 +41,7 @@ var commonDialogsBundle = Services.strings.createBundle( ); // Setup. -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [[CONTENT_PROMPT_PREF, true]], }); diff --git a/browser/base/content/test/tabs/browser_multiselect_tabs_using_keyboard.js b/browser/base/content/test/tabs/browser_multiselect_tabs_using_keyboard.js index 942bf75b1ca0c..fb622a2e686c3 100644 --- a/browser/base/content/test/tabs/browser_multiselect_tabs_using_keyboard.js +++ b/browser/base/content/test/tabs/browser_multiselect_tabs_using_keyboard.js @@ -15,7 +15,7 @@ function synthesizeKeyAndWaitForTabToGetKeyboardFocus(tab, keyCode, options) { return focused; } -add_task(async function setup() { +add_setup(async function() { // The DevEdition has the DevTools button in the toolbar by default. Remove it // to prevent branch-specific rules what button should be focused. CustomizableUI.removeWidgetFromArea("developer-button"); diff --git a/browser/base/content/test/tabs/browser_navigate_through_urls_origin_attributes.js b/browser/base/content/test/tabs/browser_navigate_through_urls_origin_attributes.js index 9ab31b3d16519..ddce6f52d0b9f 100644 --- a/browser/base/content/test/tabs/browser_navigate_through_urls_origin_attributes.js +++ b/browser/base/content/test/tabs/browser_navigate_through_urls_origin_attributes.js @@ -33,7 +33,7 @@ var gPrevRemoteTypeRegularTab; var gPrevRemoteTypeContainerTab; var gPrevRemoteTypePrivateTab; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["privacy.userContext.enabled", true], diff --git a/browser/base/content/test/tabs/browser_new_tab_in_privilegedabout_process_pref.js b/browser/base/content/test/tabs/browser_new_tab_in_privilegedabout_process_pref.js index c6486b4cef314..270f138859f24 100644 --- a/browser/base/content/test/tabs/browser_new_tab_in_privilegedabout_process_pref.js +++ b/browser/base/content/test/tabs/browser_new_tab_in_privilegedabout_process_pref.js @@ -17,7 +17,7 @@ const ABOUT_NEWTAB = "about:newtab"; const ABOUT_WELCOME = "about:welcome"; const TEST_HTTP = "http://example.org/"; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.newtab.preload", false], diff --git a/browser/base/content/test/tabs/browser_origin_attrs_in_remote_type.js b/browser/base/content/test/tabs/browser_origin_attrs_in_remote_type.js index 5631350828865..60d49847a93ed 100644 --- a/browser/base/content/test/tabs/browser_origin_attrs_in_remote_type.js +++ b/browser/base/content/test/tabs/browser_origin_attrs_in_remote_type.js @@ -21,7 +21,7 @@ var TEST_CASES = [ const NUM_PAGES_OPEN_FOR_EACH_TEST_CASE = 5; var remoteTypes; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["privacy.userContext.enabled", true], diff --git a/browser/base/content/test/tabs/browser_origin_attrs_rel.js b/browser/base/content/test/tabs/browser_origin_attrs_rel.js index 5725cd11944de..eef0633526d5c 100644 --- a/browser/base/content/test/tabs/browser_origin_attrs_rel.js +++ b/browser/base/content/test/tabs/browser_origin_attrs_rel.js @@ -49,7 +49,7 @@ function handleEventLocal(aEvent) { } } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["privacy.userContext.enabled", true], diff --git a/browser/base/content/test/tabs/browser_positional_attributes.js b/browser/base/content/test/tabs/browser_positional_attributes.js index 50bdf92748e0c..be9b377e61dea 100644 --- a/browser/base/content/test/tabs/browser_positional_attributes.js +++ b/browser/base/content/test/tabs/browser_positional_attributes.js @@ -26,7 +26,7 @@ function testAttrib(tabIndex, attrib, expected) { ); } -add_task(async function setup() { +add_setup(async function() { is(gBrowser.tabs.length, 1, "one tab is open initially"); addTab("http://mochi.test:8888/#0"); diff --git a/browser/base/content/test/tabs/browser_privilegedmozilla_process_pref.js b/browser/base/content/test/tabs/browser_privilegedmozilla_process_pref.js index 58be07b7a056b..b1a63c9d60502 100644 --- a/browser/base/content/test/tabs/browser_privilegedmozilla_process_pref.js +++ b/browser/base/content/test/tabs/browser_privilegedmozilla_process_pref.js @@ -17,7 +17,7 @@ const TEST_HIGH2 = "https://test1.example.org/"; const TEST_LOW1 = "http://example.org/"; const TEST_LOW2 = "https://example.com/"; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.tabs.remote.separatePrivilegedMozillaWebContentProcess", true], diff --git a/browser/base/content/test/tabs/browser_progress_keyword_search_handling.js b/browser/base/content/test/tabs/browser_progress_keyword_search_handling.js index 99af24ac8f1e1..19b630b8115a7 100644 --- a/browser/base/content/test/tabs/browser_progress_keyword_search_handling.js +++ b/browser/base/content/test/tabs/browser_progress_keyword_search_handling.js @@ -11,7 +11,7 @@ SearchTestUtils.init(this); const kButton = document.getElementById("reload-button"); -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["browser.fixup.dns_first_for_single_words", true]], }); diff --git a/browser/base/content/test/tabs/browser_removeTabs_order.js b/browser/base/content/test/tabs/browser_removeTabs_order.js index fe6dd885a6bd2..c0e9cc84ad4ac 100644 --- a/browser/base/content/test/tabs/browser_removeTabs_order.js +++ b/browser/base/content/test/tabs/browser_removeTabs_order.js @@ -5,7 +5,7 @@ const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm"); -add_task(async function setup() { +add_setup(async function() { let tab1 = await addTab(); let tab2 = await addTab(); let tab3 = await addTab(); diff --git a/browser/base/content/test/tabs/browser_removeTabs_skipPermitUnload.js b/browser/base/content/test/tabs/browser_removeTabs_skipPermitUnload.js index a26375282b979..1db1b22195ca2 100644 --- a/browser/base/content/test/tabs/browser_removeTabs_skipPermitUnload.js +++ b/browser/base/content/test/tabs/browser_removeTabs_skipPermitUnload.js @@ -38,7 +38,7 @@ let win; let nonBeforeUnloadTab; let beforeUnloadTab; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["dom.require_user_interaction_for_beforeunload", false]], }); diff --git a/browser/base/content/test/tabs/browser_tabCloseProbes.js b/browser/base/content/test/tabs/browser_tabCloseProbes.js index 3bc547ccb816d..c5b69567efedf 100644 --- a/browser/base/content/test/tabs/browser_tabCloseProbes.js +++ b/browser/base/content/test/tabs/browser_tabCloseProbes.js @@ -58,7 +58,7 @@ function waitForSnapshotCount(histogram, expectedCount) { }, `Collected value should become ${expectedCount}.`); } -add_task(async function setup() { +add_setup(async function() { // Force-enable tab animations gReduceMotionOverride = false; diff --git a/browser/base/content/test/tabs/browser_tabSpinnerProbe.js b/browser/base/content/test/tabs/browser_tabSpinnerProbe.js index 0a27b6f3ea02d..bd7501443aaeb 100644 --- a/browser/base/content/test/tabs/browser_tabSpinnerProbe.js +++ b/browser/base/content/test/tabs/browser_tabSpinnerProbe.js @@ -82,7 +82,7 @@ async function testProbe(aProbe) { ); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["dom.ipc.processCount", 1], diff --git a/browser/base/content/test/touch/browser_menu_touch.js b/browser/base/content/test/touch/browser_menu_touch.js index bdb2bf53a02f2..3dc5c5193c927 100644 --- a/browser/base/content/test/touch/browser_menu_touch.js +++ b/browser/base/content/test/touch/browser_menu_touch.js @@ -112,7 +112,7 @@ async function openAndCheckCustomizationUIMenu(target) { } // Ensure that we can run touch events properly for windows [10] -add_task(async function setup() { +add_setup(async function() { let isWindows = AppConstants.isPlatformAndVersionAtLeast("win", "10.0"); await SpecialPowers.pushPrefEnv({ set: [["apz.test.fails_with_native_injection", isWindows]], diff --git a/browser/base/content/test/webextensions/browser_extension_update_background.js b/browser/base/content/test/webextensions/browser_extension_update_background.js index 89a2630bbd438..3647c0790151f 100644 --- a/browser/base/content/test/webextensions/browser_extension_update_background.js +++ b/browser/base/content/test/webextensions/browser_extension_update_background.js @@ -35,7 +35,7 @@ function getBadgeStatus() { } // Set some prefs that apply to all the tests in this file -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ // We don't have pre-pinned certificates for the local mochitest server diff --git a/browser/base/content/test/webextensions/browser_extension_update_background_noprompt.js b/browser/base/content/test/webextensions/browser_extension_update_background_noprompt.js index 388988a4f97f0..bdc1f09d51a75 100644 --- a/browser/base/content/test/webextensions/browser_extension_update_background_noprompt.js +++ b/browser/base/content/test/webextensions/browser_extension_update_background_noprompt.js @@ -20,7 +20,7 @@ function getBadgeStatus() { } // Set some prefs that apply to all the tests in this file -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ // We don't have pre-pinned certificates for the local mochitest server diff --git a/browser/base/content/test/webextensions/browser_permissions_dismiss.js b/browser/base/content/test/webextensions/browser_permissions_dismiss.js index 394ab8abe5028..9ab63c56f156b 100644 --- a/browser/base/content/test/webextensions/browser_permissions_dismiss.js +++ b/browser/base/content/test/webextensions/browser_permissions_dismiss.js @@ -3,7 +3,7 @@ const INSTALL_PAGE = `${BASE}/file_install_extensions.html`; const INSTALL_XPI = `${BASE}/browser_webext_permissions.xpi`; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["extensions.webapi.testing", true], diff --git a/browser/base/content/test/webextensions/browser_update_interactive_noprompt.js b/browser/base/content/test/webextensions/browser_update_interactive_noprompt.js index 67054cf266e29..7de49d35663aa 100644 --- a/browser/base/content/test/webextensions/browser_update_interactive_noprompt.js +++ b/browser/base/content/test/webextensions/browser_update_interactive_noprompt.js @@ -1,5 +1,5 @@ // Set some prefs that apply to all the tests in this file -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ // We don't have pre-pinned certificates for the local mochitest server diff --git a/browser/base/content/test/webrtc/browser_global_mute_toggles.js b/browser/base/content/test/webrtc/browser_global_mute_toggles.js index ce7c31904456a..37478f4688dc4 100644 --- a/browser/base/content/test/webrtc/browser_global_mute_toggles.js +++ b/browser/base/content/test/webrtc/browser_global_mute_toggles.js @@ -15,7 +15,7 @@ const MUTE_TOPICS = [ "getUserMedia:unmuteAudio", ]; -add_task(async function setup() { +add_setup(async function() { let prefs = [ [PREF_PERMISSION_FAKE, true], [PREF_AUDIO_LOOPBACK, ""], diff --git a/browser/base/content/test/webrtc/browser_notification_silencing.js b/browser/base/content/test/webrtc/browser_notification_silencing.js index bba88b052c9c3..88591952858ea 100644 --- a/browser/base/content/test/webrtc/browser_notification_silencing.js +++ b/browser/base/content/test/webrtc/browser_notification_silencing.js @@ -129,7 +129,7 @@ async function testNotificationSilencing(aBrowser) { ); } -add_task(async function setup() { +add_setup(async function() { // Set prefs so that permissions prompts are shown and loopback devices // are not used. To test the chrome we want prompts to be shown, and // these tests are flakey when using loopback devices (though it would diff --git a/browser/base/content/test/webrtc/browser_stop_sharing_button.js b/browser/base/content/test/webrtc/browser_stop_sharing_button.js index 686ffc7065ab1..db9cc0d1fee08 100644 --- a/browser/base/content/test/webrtc/browser_stop_sharing_button.js +++ b/browser/base/content/test/webrtc/browser_stop_sharing_button.js @@ -9,7 +9,7 @@ const TEST_ROOT = getRootDirectory(gTestPath).replace( ); const TEST_PAGE = TEST_ROOT + "get_user_media.html"; -add_task(async function setup() { +add_setup(async function() { let prefs = [ [PREF_PERMISSION_FAKE, true], [PREF_AUDIO_LOOPBACK, ""], diff --git a/browser/base/content/test/webrtc/browser_stop_streams_on_indicator_close.js b/browser/base/content/test/webrtc/browser_stop_streams_on_indicator_close.js index a34df440477db..b0863dab61ca1 100644 --- a/browser/base/content/test/webrtc/browser_stop_streams_on_indicator_close.js +++ b/browser/base/content/test/webrtc/browser_stop_streams_on_indicator_close.js @@ -9,7 +9,7 @@ const TEST_ROOT = getRootDirectory(gTestPath).replace( ); const TEST_PAGE = TEST_ROOT + "get_user_media.html"; -add_task(async function setup() { +add_setup(async function() { let prefs = [ [PREF_PERMISSION_FAKE, true], [PREF_AUDIO_LOOPBACK, ""], diff --git a/browser/base/content/test/webrtc/browser_tab_switch_warning.js b/browser/base/content/test/webrtc/browser_tab_switch_warning.js index 30583722ef22e..2f6519bc136fd 100644 --- a/browser/base/content/test/webrtc/browser_tab_switch_warning.js +++ b/browser/base/content/test/webrtc/browser_tab_switch_warning.js @@ -188,7 +188,7 @@ async function ensureWarning(tab) { ); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["privacy.webrtc.sharedTabWarning", true]], }); diff --git a/browser/components/aboutlogins/tests/browser/browser_aaa_eventTelemetry_run_first.js b/browser/components/aboutlogins/tests/browser/browser_aaa_eventTelemetry_run_first.js index 7b5aec3550ab9..adc549d25fce2 100644 --- a/browser/components/aboutlogins/tests/browser/browser_aaa_eventTelemetry_run_first.js +++ b/browser/components/aboutlogins/tests/browser/browser_aaa_eventTelemetry_run_first.js @@ -30,7 +30,7 @@ let VULNERABLE_TEST_LOGIN2 = new nsLoginInfo( "password" ); -add_task(async function setup() { +add_setup(async function() { TEST_LOGIN1 = await addLogin(TEST_LOGIN1); VULNERABLE_TEST_LOGIN2 = await addLogin(VULNERABLE_TEST_LOGIN2); TEST_LOGIN3 = await addLogin(TEST_LOGIN3); diff --git a/browser/components/aboutlogins/tests/browser/browser_alertDismissedAfterChangingPassword.js b/browser/components/aboutlogins/tests/browser/browser_alertDismissedAfterChangingPassword.js index 88a025bed3385..67f68adfa37e1 100644 --- a/browser/components/aboutlogins/tests/browser/browser_alertDismissedAfterChangingPassword.js +++ b/browser/components/aboutlogins/tests/browser/browser_alertDismissedAfterChangingPassword.js @@ -24,7 +24,7 @@ let VULNERABLE_TEST_LOGIN2 = new nsLoginInfo( "password" ); -add_task(async function setup() { +add_setup(async function() { TEST_LOGIN1 = await addLogin(TEST_LOGIN1); VULNERABLE_TEST_LOGIN2 = await addLogin(VULNERABLE_TEST_LOGIN2); TEST_LOGIN3 = await addLogin(TEST_LOGIN3); diff --git a/browser/components/aboutlogins/tests/browser/browser_breachAlertShowingForAddedLogin.js b/browser/components/aboutlogins/tests/browser/browser_breachAlertShowingForAddedLogin.js index 394f9041f9422..78c819c6a076a 100644 --- a/browser/components/aboutlogins/tests/browser/browser_breachAlertShowingForAddedLogin.js +++ b/browser/components/aboutlogins/tests/browser/browser_breachAlertShowingForAddedLogin.js @@ -14,7 +14,7 @@ EXPECTED_BREACH = { schema: "1541615609018", }; -add_task(async function setup() { +add_setup(async function() { await BrowserTestUtils.openNewForegroundTab({ gBrowser, url: "about:logins", diff --git a/browser/components/aboutlogins/tests/browser/browser_confirmDeleteDialog.js b/browser/components/aboutlogins/tests/browser/browser_confirmDeleteDialog.js index ca37821608ff4..6a5a94f222595 100644 --- a/browser/components/aboutlogins/tests/browser/browser_confirmDeleteDialog.js +++ b/browser/components/aboutlogins/tests/browser/browser_confirmDeleteDialog.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -add_task(async function setup() { +add_setup(async function() { await BrowserTestUtils.openNewForegroundTab({ gBrowser, url: "about:logins", diff --git a/browser/components/aboutlogins/tests/browser/browser_contextmenuFillLogins.js b/browser/components/aboutlogins/tests/browser/browser_contextmenuFillLogins.js index 2521432eb624c..0eb9c70459a18 100644 --- a/browser/components/aboutlogins/tests/browser/browser_contextmenuFillLogins.js +++ b/browser/components/aboutlogins/tests/browser/browser_contextmenuFillLogins.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -add_task(async function setup() { +add_setup(async function() { TEST_LOGIN1 = await addLogin(TEST_LOGIN1); await BrowserTestUtils.openNewForegroundTab({ gBrowser, diff --git a/browser/components/aboutlogins/tests/browser/browser_createLogin.js b/browser/components/aboutlogins/tests/browser/browser_createLogin.js index a886792f6570b..109979e2c4c69 100644 --- a/browser/components/aboutlogins/tests/browser/browser_createLogin.js +++ b/browser/components/aboutlogins/tests/browser/browser_createLogin.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -add_task(async function setup() { +add_setup(async function() { let aboutLoginsTab = await BrowserTestUtils.openNewForegroundTab({ gBrowser, url: "about:logins", diff --git a/browser/components/aboutlogins/tests/browser/browser_deleteLogin.js b/browser/components/aboutlogins/tests/browser/browser_deleteLogin.js index e8971a6a178d9..2e192844f25b7 100644 --- a/browser/components/aboutlogins/tests/browser/browser_deleteLogin.js +++ b/browser/components/aboutlogins/tests/browser/browser_deleteLogin.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -add_task(async function setup() { +add_setup(async function() { TEST_LOGIN1 = await addLogin(TEST_LOGIN1); TEST_LOGIN2 = await addLogin(TEST_LOGIN2); await BrowserTestUtils.openNewForegroundTab({ diff --git a/browser/components/aboutlogins/tests/browser/browser_fxAccounts.js b/browser/components/aboutlogins/tests/browser/browser_fxAccounts.js index 200032d6d4090..c9306d0915f5c 100644 --- a/browser/components/aboutlogins/tests/browser/browser_fxAccounts.js +++ b/browser/components/aboutlogins/tests/browser/browser_fxAccounts.js @@ -12,7 +12,7 @@ function mockState(state) { }); } -add_task(async function setup() { +add_setup(async function() { let aboutLoginsTab = await BrowserTestUtils.openNewForegroundTab({ gBrowser, url: "about:logins", diff --git a/browser/components/aboutlogins/tests/browser/browser_loginItemErrors.js b/browser/components/aboutlogins/tests/browser/browser_loginItemErrors.js index f6be325e4093b..4adf69203c707 100644 --- a/browser/components/aboutlogins/tests/browser/browser_loginItemErrors.js +++ b/browser/components/aboutlogins/tests/browser/browser_loginItemErrors.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -add_task(async function setup() { +add_setup(async function() { await BrowserTestUtils.openNewForegroundTab({ gBrowser, url: "about:logins", diff --git a/browser/components/aboutlogins/tests/browser/browser_loginListChanges.js b/browser/components/aboutlogins/tests/browser/browser_loginListChanges.js index 1a51bb2e64a74..910e8d5be7e92 100644 --- a/browser/components/aboutlogins/tests/browser/browser_loginListChanges.js +++ b/browser/components/aboutlogins/tests/browser/browser_loginListChanges.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -add_task(async function setup() { +add_setup(async function() { await BrowserTestUtils.openNewForegroundTab({ gBrowser, url: "about:logins", diff --git a/browser/components/aboutlogins/tests/browser/browser_loginSortOrderRestored.js b/browser/components/aboutlogins/tests/browser/browser_loginSortOrderRestored.js index fc77a149bddb6..937bfa210a770 100644 --- a/browser/components/aboutlogins/tests/browser/browser_loginSortOrderRestored.js +++ b/browser/components/aboutlogins/tests/browser/browser_loginSortOrderRestored.js @@ -16,7 +16,7 @@ EXPECTED_BREACH = { const SORT_PREF_NAME = "signon.management.page.sort"; -add_task(async function setup() { +add_setup(async function() { TEST_LOGIN3.QueryInterface(Ci.nsILoginMetaInfo).timePasswordChanged = 1; TEST_LOGIN1 = await addLogin(TEST_LOGIN1); info(`TEST_LOGIN1 added with guid=${TEST_LOGIN1.guid}`); diff --git a/browser/components/aboutlogins/tests/browser/browser_noLoginsView.js b/browser/components/aboutlogins/tests/browser/browser_noLoginsView.js index e67852642887a..e2cfdbd883c1a 100644 --- a/browser/components/aboutlogins/tests/browser/browser_noLoginsView.js +++ b/browser/components/aboutlogins/tests/browser/browser_noLoginsView.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -add_task(async function setup() { +add_setup(async function() { await BrowserTestUtils.openNewForegroundTab({ gBrowser, url: "about:logins", diff --git a/browser/components/aboutlogins/tests/browser/browser_openExport.js b/browser/components/aboutlogins/tests/browser/browser_openExport.js index 810b92e0c2b11..fe5f668c34637 100644 --- a/browser/components/aboutlogins/tests/browser/browser_openExport.js +++ b/browser/components/aboutlogins/tests/browser/browser_openExport.js @@ -17,7 +17,7 @@ let { TelemetryTestUtils } = ChromeUtils.import( let { MockFilePicker } = SpecialPowers; -add_task(async function setup() { +add_setup(async function() { await TestUtils.waitForCondition(() => { Services.telemetry.clearEvents(); let events = Services.telemetry.snapshotEvents( diff --git a/browser/components/aboutlogins/tests/browser/browser_openFiltered.js b/browser/components/aboutlogins/tests/browser/browser_openFiltered.js index b8eba0c08208c..aaa4d75fafbcc 100644 --- a/browser/components/aboutlogins/tests/browser/browser_openFiltered.js +++ b/browser/components/aboutlogins/tests/browser/browser_openFiltered.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -add_task(async function setup() { +add_setup(async function() { let storageChangedPromised = TestUtils.topicObserved( "passwordmgr-storage-changed", (_, data) => data == "addLogin" diff --git a/browser/components/aboutlogins/tests/browser/browser_openImport.js b/browser/components/aboutlogins/tests/browser/browser_openImport.js index abe1ae917e090..aac7d47929c31 100644 --- a/browser/components/aboutlogins/tests/browser/browser_openImport.js +++ b/browser/components/aboutlogins/tests/browser/browser_openImport.js @@ -5,7 +5,7 @@ let { TelemetryTestUtils } = ChromeUtils.import( "resource://testing-common/TelemetryTestUtils.jsm" ); -add_task(async function setup() { +add_setup(async function() { await TestUtils.waitForCondition(() => { Services.telemetry.clearEvents(); let events = Services.telemetry.snapshotEvents( diff --git a/browser/components/aboutlogins/tests/browser/browser_openImportCSV.js b/browser/components/aboutlogins/tests/browser/browser_openImportCSV.js index 2984b854667fa..c52ea6c8df478 100644 --- a/browser/components/aboutlogins/tests/browser/browser_openImportCSV.js +++ b/browser/components/aboutlogins/tests/browser/browser_openImportCSV.js @@ -257,7 +257,7 @@ class CsvImportHelper { const random = Math.round(Math.random() * 100000001); -add_task(async function setup() { +add_setup(async function() { registerCleanupFunction(() => { Services.logins.removeAllUserFacingLogins(); }); diff --git a/browser/components/aboutlogins/tests/browser/browser_openPreferences.js b/browser/components/aboutlogins/tests/browser/browser_openPreferences.js index 876ee2a7a3cff..cc3e34484c4e5 100644 --- a/browser/components/aboutlogins/tests/browser/browser_openPreferences.js +++ b/browser/components/aboutlogins/tests/browser/browser_openPreferences.js @@ -5,7 +5,7 @@ let { TelemetryTestUtils } = ChromeUtils.import( "resource://testing-common/TelemetryTestUtils.jsm" ); -add_task(async function setup() { +add_setup(async function() { await TestUtils.waitForCondition(() => { Services.telemetry.clearEvents(); let events = Services.telemetry.snapshotEvents( diff --git a/browser/components/aboutlogins/tests/browser/browser_openPreferencesExternal.js b/browser/components/aboutlogins/tests/browser/browser_openPreferencesExternal.js index adac8f03a0314..591bb3b9112e0 100644 --- a/browser/components/aboutlogins/tests/browser/browser_openPreferencesExternal.js +++ b/browser/components/aboutlogins/tests/browser/browser_openPreferencesExternal.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -add_task(async function setup() { +add_setup(async function() { await BrowserTestUtils.openNewForegroundTab({ gBrowser, url: "about:logins", diff --git a/browser/components/aboutlogins/tests/browser/browser_openSite.js b/browser/components/aboutlogins/tests/browser/browser_openSite.js index 92934f8adafc8..ad6b8436997e4 100644 --- a/browser/components/aboutlogins/tests/browser/browser_openSite.js +++ b/browser/components/aboutlogins/tests/browser/browser_openSite.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -add_task(async function setup() { +add_setup(async function() { TEST_LOGIN1 = await addLogin(TEST_LOGIN1); await BrowserTestUtils.openNewForegroundTab({ gBrowser, diff --git a/browser/components/aboutlogins/tests/browser/browser_primaryPassword.js b/browser/components/aboutlogins/tests/browser/browser_primaryPassword.js index 6bd89b6ad9db4..1615c3026800c 100644 --- a/browser/components/aboutlogins/tests/browser/browser_primaryPassword.js +++ b/browser/components/aboutlogins/tests/browser/browser_primaryPassword.js @@ -17,7 +17,7 @@ function waitForLoginCountToReach(browser, loginCount) { ); } -add_task(async function setup() { +add_setup(async function() { await addLogin(TEST_LOGIN1); registerCleanupFunction(() => { Services.logins.removeAllUserFacingLogins(); diff --git a/browser/components/aboutlogins/tests/browser/browser_removeAllDialog.js b/browser/components/aboutlogins/tests/browser/browser_removeAllDialog.js index a465a3f44ad7d..83eae83f1ef72 100644 --- a/browser/components/aboutlogins/tests/browser/browser_removeAllDialog.js +++ b/browser/components/aboutlogins/tests/browser/browser_removeAllDialog.js @@ -76,7 +76,7 @@ async function waitForRemoveAllLogins() { }); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [[OS_REAUTH_PREF, false]], }); diff --git a/browser/components/aboutlogins/tests/browser/browser_tabKeyNav.js b/browser/components/aboutlogins/tests/browser/browser_tabKeyNav.js index e18ed44ed7f43..d9b59458a33b4 100644 --- a/browser/components/aboutlogins/tests/browser/browser_tabKeyNav.js +++ b/browser/components/aboutlogins/tests/browser/browser_tabKeyNav.js @@ -14,7 +14,7 @@ EXPECTED_BREACH = { schema: "1541615609018", }; -add_task(async function setup() { +add_setup(async function() { TEST_LOGIN1 = await addLogin(TEST_LOGIN1); await BrowserTestUtils.openNewForegroundTab({ gBrowser, diff --git a/browser/components/aboutlogins/tests/browser/browser_updateLogin.js b/browser/components/aboutlogins/tests/browser/browser_updateLogin.js index 2bef81db41163..eeaa6ec56d809 100644 --- a/browser/components/aboutlogins/tests/browser/browser_updateLogin.js +++ b/browser/components/aboutlogins/tests/browser/browser_updateLogin.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -add_task(async function setup() { +add_setup(async function() { TEST_LOGIN1 = await addLogin(TEST_LOGIN1); await BrowserTestUtils.openNewForegroundTab({ gBrowser, diff --git a/browser/components/aboutlogins/tests/browser/browser_vulnerableLoginAddedInSecondaryWindow.js b/browser/components/aboutlogins/tests/browser/browser_vulnerableLoginAddedInSecondaryWindow.js index 4f3894b218ad7..3c0427dd3ca6c 100644 --- a/browser/components/aboutlogins/tests/browser/browser_vulnerableLoginAddedInSecondaryWindow.js +++ b/browser/components/aboutlogins/tests/browser/browser_vulnerableLoginAddedInSecondaryWindow.js @@ -16,7 +16,7 @@ EXPECTED_BREACH = { let tabInSecondWindow; -add_task(async function setup() { +add_setup(async function() { TEST_LOGIN1 = await addLogin(TEST_LOGIN1); TEST_LOGIN2 = await addLogin(TEST_LOGIN2); TEST_LOGIN3 = await addLogin(TEST_LOGIN3); diff --git a/browser/components/attribution/test/browser/head.js b/browser/components/attribution/test/browser/head.js index cd4124d272f81..973e63d2fb36b 100644 --- a/browser/components/attribution/test/browser/head.js +++ b/browser/components/attribution/test/browser/head.js @@ -13,7 +13,7 @@ const INDEX_DECODE_ERROR = 1; const INDEX_WRITE_ERROR = 2; const INDEX_QUARANTINE_ERROR = 3; -add_task(function setup() { +add_setup(function() { // AttributionCode._clearCache is only possible in a testing environment let env = Cc["@mozilla.org/process/environment;1"].getService( Ci.nsIEnvironment diff --git a/browser/components/contextualidentity/test/browser/browser_blobUrl.js b/browser/components/contextualidentity/test/browser/browser_blobUrl.js index 0fcb9bf6e43d1..4469f56fc3a6b 100644 --- a/browser/components/contextualidentity/test/browser/browser_blobUrl.js +++ b/browser/components/contextualidentity/test/browser/browser_blobUrl.js @@ -6,7 +6,7 @@ const BASE_URI = "http://mochi.test:8888/browser/browser/components/" + "contextualidentity/test/browser/empty_file.html"; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["privacy.userContext.enabled", true]], }); diff --git a/browser/components/contextualidentity/test/browser/browser_broadcastchannel.js b/browser/components/contextualidentity/test/browser/browser_broadcastchannel.js index 4bce3fbc7f96e..cc3354fbeb675 100644 --- a/browser/components/contextualidentity/test/browser/browser_broadcastchannel.js +++ b/browser/components/contextualidentity/test/browser/browser_broadcastchannel.js @@ -68,7 +68,7 @@ async function runTestForReceiver(receiver) { gBrowser.removeTab(sender2.tab); } -add_task(async function setup() { +add_setup(async function() { // make sure userContext is enabled. await SpecialPowers.pushPrefEnv({ set: [["privacy.userContext.enabled", true]], diff --git a/browser/components/contextualidentity/test/browser/browser_count_and_remove.js b/browser/components/contextualidentity/test/browser/browser_count_and_remove.js index 7d9d2f6d087a6..214de40256187 100644 --- a/browser/components/contextualidentity/test/browser/browser_count_and_remove.js +++ b/browser/components/contextualidentity/test/browser/browser_count_and_remove.js @@ -10,7 +10,7 @@ function openTabInUserContext(userContextId) { gBrowser.selectedTab = tab; } -add_task(async function setup() { +add_setup(async function() { // make sure userContext is enabled. await SpecialPowers.pushPrefEnv({ set: [["privacy.userContext.enabled", true]], diff --git a/browser/components/contextualidentity/test/browser/browser_eme.js b/browser/components/contextualidentity/test/browser/browser_eme.js index 4c6111e087838..62c2b22d385bb 100644 --- a/browser/components/contextualidentity/test/browser/browser_eme.js +++ b/browser/components/contextualidentity/test/browser/browser_eme.js @@ -90,7 +90,7 @@ function generateKeyInfo(aData) { return keyInfo; } -add_task(async function setup() { +add_setup(async function() { // Make sure userContext is enabled. await SpecialPowers.pushPrefEnv({ set: [ diff --git a/browser/components/contextualidentity/test/browser/browser_favicon.js b/browser/components/contextualidentity/test/browser/browser_favicon.js index 151f40861e39c..dd9f2f8e34378 100644 --- a/browser/components/contextualidentity/test/browser/browser_favicon.js +++ b/browser/components/contextualidentity/test/browser/browser_favicon.js @@ -78,7 +78,7 @@ function loadFaviconHandler(metadata, response) { response.bodyOutputStream.write(gFaviconData, gFaviconData.length); } -add_task(async function setup() { +add_setup(async function() { // Make sure userContext is enabled. await SpecialPowers.pushPrefEnv({ set: [["privacy.userContext.enabled", true]], diff --git a/browser/components/contextualidentity/test/browser/browser_forgetAPI_EME_forgetThisSite.js b/browser/components/contextualidentity/test/browser/browser_forgetAPI_EME_forgetThisSite.js index dbcc7d194d225..910bfc589682f 100644 --- a/browser/components/contextualidentity/test/browser/browser_forgetAPI_EME_forgetThisSite.js +++ b/browser/components/contextualidentity/test/browser/browser_forgetAPI_EME_forgetThisSite.js @@ -199,7 +199,7 @@ async function checkEMEKey(browser, emeSessionId) { // Test functions. // -add_task(async function setup() { +add_setup(async function() { // Make sure userContext is enabled. await SpecialPowers.pushPrefEnv({ set: [ diff --git a/browser/components/contextualidentity/test/browser/browser_forgetAPI_cookie_getCookiesWithOriginAttributes.js b/browser/components/contextualidentity/test/browser/browser_forgetAPI_cookie_getCookiesWithOriginAttributes.js index 73c178c24e42a..960a5d886a98c 100644 --- a/browser/components/contextualidentity/test/browser/browser_forgetAPI_cookie_getCookiesWithOriginAttributes.js +++ b/browser/components/contextualidentity/test/browser/browser_forgetAPI_cookie_getCookiesWithOriginAttributes.js @@ -37,7 +37,7 @@ function getCookiesForOA(host, userContextId) { // Test functions. // -add_task(async function setup() { +add_setup(async function() { // Make sure userContext is enabled. await SpecialPowers.pushPrefEnv({ set: [["privacy.userContext.enabled", true]], diff --git a/browser/components/contextualidentity/test/browser/browser_forgetAPI_quota_clearStoragesForPrincipal.js b/browser/components/contextualidentity/test/browser/browser_forgetAPI_quota_clearStoragesForPrincipal.js index ac1eee178b0bb..b749e73514d2c 100644 --- a/browser/components/contextualidentity/test/browser/browser_forgetAPI_quota_clearStoragesForPrincipal.js +++ b/browser/components/contextualidentity/test/browser/browser_forgetAPI_quota_clearStoragesForPrincipal.js @@ -107,7 +107,7 @@ async function checkIndexedDB(browser) { // Test functions. // -add_task(async function setup() { +add_setup(async function() { // Make sure userContext is enabled. await SpecialPowers.pushPrefEnv({ set: [["privacy.userContext.enabled", true]], diff --git a/browser/components/contextualidentity/test/browser/browser_forgetaboutsite.js b/browser/components/contextualidentity/test/browser/browser_forgetaboutsite.js index b81200788ba8a..20c6653aa12b9 100644 --- a/browser/components/contextualidentity/test/browser/browser_forgetaboutsite.js +++ b/browser/components/contextualidentity/test/browser/browser_forgetaboutsite.js @@ -390,7 +390,7 @@ async function test_storage_cleared() { } } -add_task(async function setup() { +add_setup(async function() { // Make sure userContext is enabled. await SpecialPowers.pushPrefEnv({ set: [["privacy.userContext.enabled", true]], diff --git a/browser/components/contextualidentity/test/browser/browser_imageCache.js b/browser/components/contextualidentity/test/browser/browser_imageCache.js index 77ebe8283e6ce..0c12907096e71 100644 --- a/browser/components/contextualidentity/test/browser/browser_imageCache.js +++ b/browser/components/contextualidentity/test/browser/browser_imageCache.js @@ -30,7 +30,7 @@ function fileHandler(metadata, response) { response.bodyOutputStream.write(body, body.length); } -add_task(async function setup() { +add_setup(async function() { // make sure userContext is enabled. await SpecialPowers.pushPrefEnv({ set: [["privacy.userContext.enabled", true]], diff --git a/browser/components/contextualidentity/test/browser/browser_originattrs_reopenin.js b/browser/components/contextualidentity/test/browser/browser_originattrs_reopenin.js index 6b3555f26c1bf..777c0f010e5d5 100644 --- a/browser/components/contextualidentity/test/browser/browser_originattrs_reopenin.js +++ b/browser/components/contextualidentity/test/browser/browser_originattrs_reopenin.js @@ -34,7 +34,7 @@ function handleEventLocal(aEvent) { } } const NUM_PAGES_OPEN_FOR_EACH_TEST_CASE = 5; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["privacy.userContext.enabled", true], diff --git a/browser/components/contextualidentity/test/browser/browser_restore_getCookiesWithOriginAttributes.js b/browser/components/contextualidentity/test/browser/browser_restore_getCookiesWithOriginAttributes.js index dda1d73cfb67a..6bb617094e5f0 100644 --- a/browser/components/contextualidentity/test/browser/browser_restore_getCookiesWithOriginAttributes.js +++ b/browser/components/contextualidentity/test/browser/browser_restore_getCookiesWithOriginAttributes.js @@ -40,7 +40,7 @@ function getCookiesForOA(host, userContextId) { // Test functions. // -add_task(async function setup() { +add_setup(async function() { // Make sure userContext is enabled. await SpecialPowers.pushPrefEnv({ set: [["privacy.userContext.enabled", true]], diff --git a/browser/components/contextualidentity/test/browser/browser_saveLink.js b/browser/components/contextualidentity/test/browser/browser_saveLink.js index 94a8e748f9d67..d8df584d59888 100644 --- a/browser/components/contextualidentity/test/browser/browser_saveLink.js +++ b/browser/components/contextualidentity/test/browser/browser_saveLink.js @@ -8,7 +8,7 @@ const URI = let MockFilePicker = SpecialPowers.MockFilePicker; MockFilePicker.init(window); -add_task(async function setup() { +add_setup(async function() { info("Setting the prefs."); // make sure userContext is enabled. diff --git a/browser/components/contextualidentity/test/browser/browser_serviceworkers.js b/browser/components/contextualidentity/test/browser/browser_serviceworkers.js index cd7caff4a608e..763d2be7619a0 100644 --- a/browser/components/contextualidentity/test/browser/browser_serviceworkers.js +++ b/browser/components/contextualidentity/test/browser/browser_serviceworkers.js @@ -21,7 +21,7 @@ function openTabInUserContext(uri, userContextId) { return tab; } -add_task(async function setup() { +add_setup(async function() { // make sure userContext is enabled. await SpecialPowers.pushPrefEnv({ set: [ diff --git a/browser/components/contextualidentity/test/browser/browser_usercontext.js b/browser/components/contextualidentity/test/browser/browser_usercontext.js index 67869d25a1f90..79f7c2e6461d4 100644 --- a/browser/components/contextualidentity/test/browser/browser_usercontext.js +++ b/browser/components/contextualidentity/test/browser/browser_usercontext.js @@ -20,7 +20,7 @@ function openTabInUserContext(uri, userContextId) { return tab; } -add_task(async function setup() { +add_setup(async function() { // make sure userContext is enabled. await SpecialPowers.pushPrefEnv({ set: [ diff --git a/browser/components/contextualidentity/test/browser/browser_usercontextid_new_window.js b/browser/components/contextualidentity/test/browser/browser_usercontextid_new_window.js index 6c573bbc06435..b018a1f4c3fb1 100644 --- a/browser/components/contextualidentity/test/browser/browser_usercontextid_new_window.js +++ b/browser/components/contextualidentity/test/browser/browser_usercontextid_new_window.js @@ -52,7 +52,7 @@ function openWindowWithUserContextId(userContextId, isPrivate) { return windowPromise; } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["privacy.userContext.enabled", true]], }); diff --git a/browser/components/contextualidentity/test/browser/browser_windowName.js b/browser/components/contextualidentity/test/browser/browser_windowName.js index 55ff0084fa5ac..71c003d2806e6 100644 --- a/browser/components/contextualidentity/test/browser/browser_windowName.js +++ b/browser/components/contextualidentity/test/browser/browser_windowName.js @@ -7,7 +7,7 @@ const BASE_URI = "http://mochi.test:8888/browser/browser/components/" + "contextualidentity/test/browser/empty_file.html"; -add_task(async function setup() { +add_setup(async function() { // make sure userContext is enabled. await SpecialPowers.pushPrefEnv({ set: [ diff --git a/browser/components/contextualidentity/test/browser/browser_windowOpen.js b/browser/components/contextualidentity/test/browser/browser_windowOpen.js index d53f91cecc3fd..d28942506690c 100644 --- a/browser/components/contextualidentity/test/browser/browser_windowOpen.js +++ b/browser/components/contextualidentity/test/browser/browser_windowOpen.js @@ -7,7 +7,7 @@ const BASE_URI = "http://mochi.test:8888/browser/browser/components/" + "contextualidentity/test/browser/empty_file.html"; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["privacy.userContext.enabled", true], diff --git a/browser/components/customizableui/test/browser_PanelMultiView_focus.js b/browser/components/customizableui/test/browser_PanelMultiView_focus.js index 7f088217ad825..8ea7131c2d0a6 100644 --- a/browser/components/customizableui/test/browser_PanelMultiView_focus.js +++ b/browser/components/customizableui/test/browser_PanelMultiView_focus.js @@ -20,7 +20,7 @@ let gMainSubButton; let gSubView; let gSubButton; -add_task(async function setup() { +add_setup(async function() { let navBar = document.getElementById("nav-bar"); gAnchor = document.createXULElement("toolbarbutton"); // Must be focusable in order for key presses to work. diff --git a/browser/components/customizableui/test/browser_PanelMultiView_keyboard.js b/browser/components/customizableui/test/browser_PanelMultiView_keyboard.js index 745acd6cb0459..fdfa943113b66 100644 --- a/browser/components/customizableui/test/browser_PanelMultiView_keyboard.js +++ b/browser/components/customizableui/test/browser_PanelMultiView_keyboard.js @@ -70,7 +70,7 @@ async function expectFocusAfterKey(aKey, aFocus) { ok(true, aFocus.id + " focused after " + aKey + " pressed"); } -add_task(async function setup() { +add_setup(async function() { // This shouldn't be necessary - but it is, because we use same-process frames. // https://bugzilla.mozilla.org/show_bug.cgi?id=1565276 covers improving this. await SpecialPowers.pushPrefEnv({ diff --git a/browser/components/customizableui/test/browser_synced_tabs_menu.js b/browser/components/customizableui/test/browser_synced_tabs_menu.js index 7d77f314704b4..a76762e13ce77 100644 --- a/browser/components/customizableui/test/browser_synced_tabs_menu.js +++ b/browser/components/customizableui/test/browser_synced_tabs_menu.js @@ -55,7 +55,7 @@ let mockedInternal = { hasSyncedThisSession: false, }; -add_task(async function setup() { +add_setup(async function() { const getSignedInUser = FxAccounts.config.getSignedInUser; FxAccounts.config.getSignedInUser = async () => Promise.resolve({ uid: "uid", email: "foo@bar.com" }); diff --git a/browser/components/downloads/test/browser/browser_download_overwrite.js b/browser/components/downloads/test/browser/browser_download_overwrite.js index 53b23d7f1cd87..9e50a416f1f90 100644 --- a/browser/components/downloads/test/browser/browser_download_overwrite.js +++ b/browser/components/downloads/test/browser/browser_download_overwrite.js @@ -17,7 +17,7 @@ Services.scriptloader.loadSubScript( this ); -add_task(async function setup() { +add_setup(async function() { // head.js has helpers that write to a nice unique file we can use. await createDownloadedFile(gTestTargetFile.path, "Hello.\n"); ok(gTestTargetFile.exists(), "We created a test file."); diff --git a/browser/components/downloads/test/browser/browser_download_spam_protection.js b/browser/components/downloads/test/browser/browser_download_spam_protection.js index 8809b6a30bbda..e500e49878dcf 100644 --- a/browser/components/downloads/test/browser/browser_download_spam_protection.js +++ b/browser/components/downloads/test/browser/browser_download_spam_protection.js @@ -26,7 +26,7 @@ const TEST_PATH = getRootDirectory(gTestPath).replace( TEST_URI ); -add_task(async function setup() { +add_setup(async function() { // Create temp directory let time = new Date().getTime(); let tempDir = Services.dirsvc.get("TmpD", Ci.nsIFile); diff --git a/browser/components/downloads/test/browser/browser_downloads_context_menu_always_open_similar_files.js b/browser/components/downloads/test/browser/browser_downloads_context_menu_always_open_similar_files.js index 07fa8ebf524e1..2dcd72cf573e1 100644 --- a/browser/components/downloads/test/browser/browser_downloads_context_menu_always_open_similar_files.js +++ b/browser/components/downloads/test/browser/browser_downloads_context_menu_always_open_similar_files.js @@ -57,7 +57,7 @@ async function prepareDownloadFiles(downloadList) { info("Download target exists? " + download.target.exists); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["browser.download.improvements_to_download_panel", true]], }); diff --git a/browser/components/downloads/test/browser/browser_downloads_panel_disable_items.js b/browser/components/downloads/test/browser/browser_downloads_panel_disable_items.js index 1377a621522cc..88a3650718730 100644 --- a/browser/components/downloads/test/browser/browser_downloads_panel_disable_items.js +++ b/browser/components/downloads/test/browser/browser_downloads_panel_disable_items.js @@ -9,7 +9,7 @@ const TEST_PATH = getRootDirectory(gTestPath).replace( TEST_URI ); -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.download.improvements_to_download_panel", true], diff --git a/browser/components/downloads/test/browser/browser_downloads_panel_focus.js b/browser/components/downloads/test/browser/browser_downloads_panel_focus.js index 1cd9f1679634f..68ec96335cf1c 100644 --- a/browser/components/downloads/test/browser/browser_downloads_panel_focus.js +++ b/browser/components/downloads/test/browser/browser_downloads_panel_focus.js @@ -3,7 +3,7 @@ "use strict"; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["browser.download.improvements_to_download_panel", true]], }); diff --git a/browser/components/downloads/test/browser/browser_library_clearall.js b/browser/components/downloads/test/browser/browser_library_clearall.js index dea32e4ae3f8f..d4570cbc2535e 100644 --- a/browser/components/downloads/test/browser/browser_library_clearall.js +++ b/browser/components/downloads/test/browser/browser_library_clearall.js @@ -78,7 +78,7 @@ async function testClearingDownloads(clearCallback) { ); } -add_task(async function setup() { +add_setup(async function() { // Ensure that state is reset in case previous tests didn't finish. await task_resetState(); diff --git a/browser/components/downloads/test/browser/browser_library_select_all.js b/browser/components/downloads/test/browser/browser_library_select_all.js index 779ccf337cf09..9944909bc5d0e 100644 --- a/browser/components/downloads/test/browser/browser_library_select_all.js +++ b/browser/components/downloads/test/browser/browser_library_select_all.js @@ -3,7 +3,7 @@ let gDownloadDir; -add_task(async function setup() { +add_setup(async function() { await task_resetState(); if (!gDownloadDir) { diff --git a/browser/components/enterprisepolicies/tests/browser/browser_policy_block_set_desktop_background.js b/browser/components/enterprisepolicies/tests/browser/browser_policy_block_set_desktop_background.js index d17a29a7b5223..ae67dbf2c2670 100644 --- a/browser/components/enterprisepolicies/tests/browser/browser_policy_block_set_desktop_background.js +++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_block_set_desktop_background.js @@ -2,7 +2,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; -add_task(async function setup() { +add_setup(async function() { await setupPolicyEngineWithJson({ policies: { DisableSetDesktopBackground: true, diff --git a/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_popup_blocker.js b/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_popup_blocker.js index 40075b98e6596..e6bac625704fc 100644 --- a/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_popup_blocker.js +++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_popup_blocker.js @@ -7,7 +7,7 @@ function restore_prefs() { } let ORIGINAL_PREF_VALUE = undefined; -add_task(async function setup() { +add_setup(async function() { // It seems that this pref is given a special testing value for some reason. // Unset that value for this test, but save the old value if (Services.prefs.prefHasUserValue("dom.disable_open_during_load")) { diff --git a/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_privatebrowsing.js b/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_privatebrowsing.js index e8ce7e891a288..aeefa2e950a36 100644 --- a/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_privatebrowsing.js +++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_privatebrowsing.js @@ -7,7 +7,7 @@ const { PrivateBrowsingUtils } = ChromeUtils.import( "resource://gre/modules/PrivateBrowsingUtils.jsm" ); -add_task(async function setup() { +add_setup(async function() { await setupPolicyEngineWithJson({ policies: { DisablePrivateBrowsing: true, diff --git a/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_profile_reset.js b/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_profile_reset.js index e3cb9f9c6872c..70a53872a1503 100644 --- a/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_profile_reset.js +++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_profile_reset.js @@ -8,7 +8,7 @@ let { ResetProfile } = ChromeUtils.import( // For this test to work properly, this profile actually needs to be // "reset-able", which requires that it be recognized by the profile service -add_task(async function setup() { +add_setup(async function() { let profileDirectory = Services.dirsvc.get("ProfD", Ci.nsIFile); let profileName = profileDirectory.leafName; let profileService = Cc["@mozilla.org/toolkit/profile-service;1"].getService( diff --git a/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_safemode.js b/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_safemode.js index e6c8313cc6398..f1d1dd4fc4362 100644 --- a/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_safemode.js +++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_disable_safemode.js @@ -2,7 +2,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; -add_task(async function setup() { +add_setup(async function() { await setupPolicyEngineWithJson({ policies: { DisableSafeMode: true, diff --git a/browser/components/enterprisepolicies/tests/browser/browser_policy_display_bookmarks.js b/browser/components/enterprisepolicies/tests/browser/browser_policy_display_bookmarks.js index effca803e0a27..d3c4e56ba31f3 100644 --- a/browser/components/enterprisepolicies/tests/browser/browser_policy_display_bookmarks.js +++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_display_bookmarks.js @@ -3,7 +3,7 @@ "use strict"; -add_task(async function setup() { +add_setup(async function() { await setupPolicyEngineWithJson({ policies: { DisplayBookmarksToolbar: true, diff --git a/browser/components/enterprisepolicies/tests/browser/browser_policy_searchbar.js b/browser/components/enterprisepolicies/tests/browser/browser_policy_searchbar.js index f4e16f26bb3bf..b04538931f53b 100644 --- a/browser/components/enterprisepolicies/tests/browser/browser_policy_searchbar.js +++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_searchbar.js @@ -3,7 +3,7 @@ "use strict"; -add_task(async function setup() { +add_setup(async function() { await setupPolicyEngineWithJson({ policies: { SearchBar: "separate", @@ -23,7 +23,7 @@ add_task(async function test_menu_shown() { await BrowserTestUtils.closeWindow(newWin); }); -add_task(async function setup() { +add_setup(async function() { await setupPolicyEngineWithJson({ policies: { SearchBar: "unified", diff --git a/browser/components/enterprisepolicies/tests/browser/browser_policy_set_startpage.js b/browser/components/enterprisepolicies/tests/browser/browser_policy_set_startpage.js index 91c3184b36be3..36636b349491c 100644 --- a/browser/components/enterprisepolicies/tests/browser/browser_policy_set_startpage.js +++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_set_startpage.js @@ -2,7 +2,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; -add_task(async function setup() { +add_setup(async function() { // browser.startup.page is set by unittest-required/user.js, // but we need the default value await SpecialPowers.pushPrefEnv({ diff --git a/browser/components/enterprisepolicies/tests/browser/browser_policy_support_menu.js b/browser/components/enterprisepolicies/tests/browser/browser_policy_support_menu.js index 47139a0e32379..5f46ef24e4124 100644 --- a/browser/components/enterprisepolicies/tests/browser/browser_policy_support_menu.js +++ b/browser/components/enterprisepolicies/tests/browser/browser_policy_support_menu.js @@ -2,7 +2,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; -add_task(async function setup() { +add_setup(async function() { await setupPolicyEngineWithJson({ policies: { SupportMenu: { diff --git a/browser/components/extensions/test/browser/browser_ext_browserAction_simple.js b/browser/components/extensions/test/browser/browser_ext_browserAction_simple.js index 316eb22da0acf..41770898a9e13 100644 --- a/browser/components/extensions/test/browser/browser_ext_browserAction_simple.js +++ b/browser/components/extensions/test/browser/browser_ext_browserAction_simple.js @@ -86,7 +86,7 @@ async function testAction(manifest_version) { await waitForConsole; } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["extensions.manifestV3.enabled", true]], }); diff --git a/browser/components/extensions/test/browser/browser_ext_menus_events.js b/browser/components/extensions/test/browser/browser_ext_menus_events.js index 8a03a7886e075..4ae9e54545c6d 100644 --- a/browser/components/extensions/test/browser/browser_ext_menus_events.js +++ b/browser/components/extensions/test/browser/browser_ext_menus_events.js @@ -21,7 +21,7 @@ async function grantOptionalPermission(extension, permissions) { var someOtherTab, testTab; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["extensions.manifestV3.enabled", true]], }); diff --git a/browser/components/extensions/test/browser/browser_ext_pageAction_click_types.js b/browser/components/extensions/test/browser/browser_ext_pageAction_click_types.js index dc101e06b2d4d..93c8be1d469f8 100644 --- a/browser/components/extensions/test/browser/browser_ext_pageAction_click_types.js +++ b/browser/components/extensions/test/browser/browser_ext_pageAction_click_types.js @@ -2,7 +2,7 @@ /* vim: set sts=2 sw=2 et tw=80: */ "use strict"; -add_task(async function setup() { +add_setup(async function() { // The page action button is hidden by default. // This tests the use of pageAction when the button is visible. // diff --git a/browser/components/extensions/test/browser/browser_ext_settings_overrides_default_search.js b/browser/components/extensions/test/browser/browser_ext_settings_overrides_default_search.js index 79d10a5230d3d..9852994985701 100644 --- a/browser/components/extensions/test/browser/browser_ext_settings_overrides_default_search.js +++ b/browser/components/extensions/test/browser/browser_ext_settings_overrides_default_search.js @@ -33,7 +33,7 @@ async function restoreDefaultEngine() { await Services.search.setDefault(engine); } -add_task(async function setup() { +add_setup(async function() { let searchExtensions = getChromeDir(getResolvedURI(gTestPath)); searchExtensions.append("search-engines"); diff --git a/browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js b/browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js index a5cd9dd9ca279..9cd276236c7b6 100644 --- a/browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js +++ b/browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js @@ -2,7 +2,7 @@ /* vim: set sts=2 sw=2 et tw=80: */ "use strict"; -add_task(async function setup() { +add_setup(async function() { // make sure userContext is enabled. return SpecialPowers.pushPrefEnv({ set: [["privacy.userContext.enabled", true]], diff --git a/browser/components/extensions/test/browser/browser_ext_topSites.js b/browser/components/extensions/test/browser/browser_ext_topSites.js index 60ae8ee024546..d64a9038e0e35 100644 --- a/browser/components/extensions/test/browser/browser_ext_topSites.js +++ b/browser/components/extensions/test/browser/browser_ext_topSites.js @@ -61,7 +61,7 @@ async function getSites(extension, options) { return extension.awaitMessage("sites"); } -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.history.clear(); await PlacesUtils.bookmarks.eraseEverything(); diff --git a/browser/components/extensions/test/browser/browser_ext_webRequest.js b/browser/components/extensions/test/browser/browser_ext_webRequest.js index 0feeee51a8c8e..9df48ebc1446e 100644 --- a/browser/components/extensions/test/browser/browser_ext_webRequest.js +++ b/browser/components/extensions/test/browser/browser_ext_webRequest.js @@ -65,7 +65,7 @@ let events = { onCompleted: [{ urls }, ["responseHeaders"]], }; -add_task(async function setup() { +add_setup(async function() { extension = makeExtension(events); await extension.startup(); }); diff --git a/browser/components/extensions/test/browser/browser_ext_webrtc.js b/browser/components/extensions/test/browser/browser_ext_webrtc.js index f15c43d1e0b40..96f76ba21dd9a 100644 --- a/browser/components/extensions/test/browser/browser_ext_webrtc.js +++ b/browser/components/extensions/test/browser/browser_ext_webrtc.js @@ -4,7 +4,7 @@ const { PermissionTestUtils } = ChromeUtils.import( "resource://testing-common/PermissionTestUtils.jsm" ); -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["media.navigator.permission.fake", true]], }); diff --git a/browser/components/newtab/test/browser/browser_aboutwelcome_multistage_default.js b/browser/components/newtab/test/browser/browser_aboutwelcome_multistage_default.js index 486e6996314ba..731c50720204b 100644 --- a/browser/components/newtab/test/browser/browser_aboutwelcome_multistage_default.js +++ b/browser/components/newtab/test/browser/browser_aboutwelcome_multistage_default.js @@ -644,7 +644,7 @@ add_task(async function test_updatesPrefOnAWOpen() { Services.prefs.clearUserPref(DID_SEE_ABOUT_WELCOME_PREF); }); -add_task(async function setup() { +add_setup(async function() { const sandbox = sinon.createSandbox(); // This needs to happen before any about:welcome page opens sandbox.stub(FxAccounts.config, "promiseMetricsFlowURI").resolves(""); diff --git a/browser/components/newtab/test/browser/browser_asrouter_cfr.js b/browser/components/newtab/test/browser/browser_asrouter_cfr.js index 5d9b4362cb0ca..b7bb46e1fe52b 100644 --- a/browser/components/newtab/test/browser/browser_asrouter_cfr.js +++ b/browser/components/newtab/test/browser/browser_asrouter_cfr.js @@ -178,7 +178,7 @@ function trigger_cfr_panel( ); } -add_task(async function setup() { +add_setup(async function() { // Store it in order to restore to the original value const { _fetchLatestAddonVersion } = CFRPageActions; // Prevent fetching the real addon url and making a network request diff --git a/browser/components/newtab/test/browser/browser_asrouter_group_frequency.js b/browser/components/newtab/test/browser/browser_asrouter_group_frequency.js index f6cef72e65f1b..a412979b16477 100644 --- a/browser/components/newtab/test/browser/browser_asrouter_group_frequency.js +++ b/browser/components/newtab/test/browser/browser_asrouter_group_frequency.js @@ -14,7 +14,7 @@ const { CFRPageActions } = ChromeUtils.import( /** * Load and modify a message for the test. */ -add_task(async function setup() { +add_setup(async function() { const initialMsgCount = ASRouter.state.messages.length; const heartbeatMsg = (await CFRMessageProvider.getMessages()).find( m => m.id === "HEARTBEAT_TACTIC_2" diff --git a/browser/components/newtab/test/browser/browser_asrouter_group_userprefs.js b/browser/components/newtab/test/browser/browser_asrouter_group_userprefs.js index 172bfdb47c8c9..31a63dafabee8 100644 --- a/browser/components/newtab/test/browser/browser_asrouter_group_userprefs.js +++ b/browser/components/newtab/test/browser/browser_asrouter_group_userprefs.js @@ -14,7 +14,7 @@ const { CFRPageActions } = ChromeUtils.import( /** * Load and modify a message for the test. */ -add_task(async function setup() { +add_setup(async function() { const initialMsgCount = ASRouter.state.messages.length; const heartbeatMsg = (await CFRMessageProvider.getMessages()).find( m => m.id === "HEARTBEAT_TACTIC_2" diff --git a/browser/components/newtab/test/browser/browser_newtab_trigger.js b/browser/components/newtab/test/browser/browser_newtab_trigger.js index cb58642d2b7d9..f3afe6eb89cac 100644 --- a/browser/components/newtab/test/browser/browser_newtab_trigger.js +++ b/browser/components/newtab/test/browser/browser_newtab_trigger.js @@ -9,7 +9,7 @@ const { ASRouter } = ChromeUtils.import( let sendTriggerMessageSpy; -add_task(function setup() { +add_setup(function() { let sandbox = sinon.createSandbox(); sendTriggerMessageSpy = sandbox.spy(ASRouter, "sendTriggerMessage"); diff --git a/browser/components/newtab/test/browser/browser_trigger_listeners.js b/browser/components/newtab/test/browser/browser_trigger_listeners.js index 02d4cb78b22ba..0d18cfb711844 100644 --- a/browser/components/newtab/test/browser/browser_trigger_listeners.js +++ b/browser/components/newtab/test/browser/browser_trigger_listeners.js @@ -2,7 +2,7 @@ const { ASRouterTriggerListeners } = ChromeUtils.import( "resource://activity-stream/lib/ASRouterTriggerListeners.jsm" ); -add_task(async function setup() { +add_setup(async function() { registerCleanupFunction(() => { const trigger = ASRouterTriggerListeners.get("openURL"); trigger.uninit(); diff --git a/browser/components/newtab/test/xpcshell/test_AboutHomeStartupCacheWorker.js b/browser/components/newtab/test/xpcshell/test_AboutHomeStartupCacheWorker.js index 5b52e52426d77..116036ea30804 100644 --- a/browser/components/newtab/test/xpcshell/test_AboutHomeStartupCacheWorker.js +++ b/browser/components/newtab/test/xpcshell/test_AboutHomeStartupCacheWorker.js @@ -55,7 +55,7 @@ const NEWTAB_RENDER_URL = * a dynamic layout, and then have that layout point to a local feed rather * than one from the Pocket CDN. */ -add_task(async function setup() { +add_setup(async function() { do_get_profile(); // The SearchService is also needed in order to construct the initial state, // which means that the AddonManager needs to be available. diff --git a/browser/components/originattributes/test/browser/browser_favicon_firstParty.js b/browser/components/originattributes/test/browser/browser_favicon_firstParty.js index 40c8274796401..cd5bc824fd6b2 100644 --- a/browser/components/originattributes/test/browser/browser_favicon_firstParty.js +++ b/browser/components/originattributes/test/browser/browser_favicon_firstParty.js @@ -379,7 +379,7 @@ async function doTestForAllTabsFavicon( tabBrowser.removeAttribute("overflow"); } -add_task(async function setup() { +add_setup(async function() { // Make sure first party isolation is enabled. await SpecialPowers.pushPrefEnv({ set: [ diff --git a/browser/components/originattributes/test/browser/browser_favicon_userContextId.js b/browser/components/originattributes/test/browser/browser_favicon_userContextId.js index ddde65e35d3a5..a53ebe296150d 100644 --- a/browser/components/originattributes/test/browser/browser_favicon_userContextId.js +++ b/browser/components/originattributes/test/browser/browser_favicon_userContextId.js @@ -328,7 +328,7 @@ async function doTestForAllTabsFavicon(aTestPage, aFaviconHost, aFaviconURL) { tabBrowser.removeAttribute("overflow"); } -add_task(async function setup() { +add_setup(async function() { // Make sure userContext is enabled. await SpecialPowers.pushPrefEnv({ set: [ diff --git a/browser/components/originattributes/test/browser/browser_firstPartyIsolation.js b/browser/components/originattributes/test/browser/browser_firstPartyIsolation.js index a526d84a57978..471f4c77500ea 100644 --- a/browser/components/originattributes/test/browser/browser_firstPartyIsolation.js +++ b/browser/components/originattributes/test/browser/browser_firstPartyIsolation.js @@ -3,7 +3,7 @@ const BASE_URL = const EXAMPLE_BASE_URL = BASE_URL.replace("mochi.test:8888", "example.com"); const BASE_DOMAIN = "mochi.test"; -add_task(async function setup() { +add_setup(async function() { Services.prefs.setBoolPref("privacy.firstparty.isolate", true); Services.prefs.setBoolPref("dom.security.https_first", false); registerCleanupFunction(function() { diff --git a/browser/components/originattributes/test/browser/browser_firstPartyIsolation_aboutPages.js b/browser/components/originattributes/test/browser/browser_firstPartyIsolation_aboutPages.js index c17ef66af1da4..f9256440061ca 100644 --- a/browser/components/originattributes/test/browser/browser_firstPartyIsolation_aboutPages.js +++ b/browser/components/originattributes/test/browser/browser_firstPartyIsolation_aboutPages.js @@ -2,7 +2,7 @@ if (SpecialPowers.useRemoteSubframes) { requestLongerTimeout(2); } -add_task(async function setup() { +add_setup(async function() { Services.prefs.setBoolPref("privacy.firstparty.isolate", true); // Bug 1617611: Fix all the tests broken by "cookies SameSite=lax by default" Services.prefs.setBoolPref("network.cookie.sameSite.laxByDefault", false); diff --git a/browser/components/originattributes/test/browser/browser_firstPartyIsolation_about_newtab.js b/browser/components/originattributes/test/browser/browser_firstPartyIsolation_about_newtab.js index a861a1c06f92e..ccb52fa96f37c 100644 --- a/browser/components/originattributes/test/browser/browser_firstPartyIsolation_about_newtab.js +++ b/browser/components/originattributes/test/browser/browser_firstPartyIsolation_about_newtab.js @@ -1,4 +1,4 @@ -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.newtab.preload", false], diff --git a/browser/components/originattributes/test/browser/browser_firstPartyIsolation_blobURI.js b/browser/components/originattributes/test/browser/browser_firstPartyIsolation_blobURI.js index bfe85f3416ba6..4e19f8fe6ad13 100644 --- a/browser/components/originattributes/test/browser/browser_firstPartyIsolation_blobURI.js +++ b/browser/components/originattributes/test/browser/browser_firstPartyIsolation_blobURI.js @@ -1,4 +1,4 @@ -add_task(async function setup() { +add_setup(async function() { Services.prefs.setBoolPref("privacy.firstparty.isolate", true); registerCleanupFunction(function() { diff --git a/browser/components/originattributes/test/browser/browser_firstPartyIsolation_js_uri.js b/browser/components/originattributes/test/browser/browser_firstPartyIsolation_js_uri.js index 3ffc6d55ac328..2b44e21c6db1a 100644 --- a/browser/components/originattributes/test/browser/browser_firstPartyIsolation_js_uri.js +++ b/browser/components/originattributes/test/browser/browser_firstPartyIsolation_js_uri.js @@ -1,4 +1,4 @@ -add_task(async function setup() { +add_setup(async function() { Services.prefs.setBoolPref("privacy.firstparty.isolate", true); registerCleanupFunction(function() { diff --git a/browser/components/originattributes/test/browser/browser_firstPartyIsolation_saveAs.js b/browser/components/originattributes/test/browser/browser_firstPartyIsolation_saveAs.js index e229aa6a76ac4..ec8ba9cbfd86c 100644 --- a/browser/components/originattributes/test/browser/browser_firstPartyIsolation_saveAs.js +++ b/browser/components/originattributes/test/browser/browser_firstPartyIsolation_saveAs.js @@ -32,7 +32,7 @@ MockFilePicker.init(window); const tempDir = createTemporarySaveDirectory(); MockFilePicker.displayDirectory = tempDir; -add_task(async function setup() { +add_setup(async function() { info("Setting the prefs."); await SpecialPowers.pushPrefEnv({ diff --git a/browser/components/originattributes/test/browser/browser_postMessage.js b/browser/components/originattributes/test/browser/browser_postMessage.js index e8860bd94b0d9..9cfe8c44a293f 100644 --- a/browser/components/originattributes/test/browser/browser_postMessage.js +++ b/browser/components/originattributes/test/browser/browser_postMessage.js @@ -7,7 +7,7 @@ const FPD_TWO = "http://example.org"; const TEST_BASE = "/browser/browser/components/originattributes/test/browser/"; -add_task(async function setup() { +add_setup(async function() { // Make sure first party isolation is enabled. await SpecialPowers.pushPrefEnv({ set: [ diff --git a/browser/components/originattributes/test/browser/browser_sanitize.js b/browser/components/originattributes/test/browser/browser_sanitize.js index 8f83f2309bcc9..625dd85c65230 100644 --- a/browser/components/originattributes/test/browser/browser_sanitize.js +++ b/browser/components/originattributes/test/browser/browser_sanitize.js @@ -77,7 +77,7 @@ function checkCacheExists(aShouldExist) { }; } -add_task(async function setup() { +add_setup(async function() { Services.cache2.clear(); }); diff --git a/browser/components/places/tests/browser/browser_autoshow_bookmarks_toolbar.js b/browser/components/places/tests/browser/browser_autoshow_bookmarks_toolbar.js index 8f2c7a4a65fee..81394ca3edea4 100644 --- a/browser/components/places/tests/browser/browser_autoshow_bookmarks_toolbar.js +++ b/browser/components/places/tests/browser/browser_autoshow_bookmarks_toolbar.js @@ -8,7 +8,7 @@ const TOOLBAR_VISIBILITY_PREF = "browser.toolbars.bookmarks.visibility"; let bookmarkPanel; let win; -add_task(async function setup() { +add_setup(async function() { Services.prefs.clearUserPref(LOCATION_PREF); await PlacesUtils.bookmarks.eraseEverything(); diff --git a/browser/components/places/tests/browser/browser_bookmarkMenu_hiddenWindow.js b/browser/components/places/tests/browser/browser_bookmarkMenu_hiddenWindow.js index 4473a01119c02..f897092e93fb6 100644 --- a/browser/components/places/tests/browser/browser_bookmarkMenu_hiddenWindow.js +++ b/browser/components/places/tests/browser/browser_bookmarkMenu_hiddenWindow.js @@ -4,7 +4,7 @@ "use strict"; -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.menuGuid, url: "http://example.com/", diff --git a/browser/components/places/tests/browser/browser_bookmarkProperties_cancel.js b/browser/components/places/tests/browser/browser_bookmarkProperties_cancel.js index f4362d2a11160..e178875e932cd 100644 --- a/browser/components/places/tests/browser/browser_bookmarkProperties_cancel.js +++ b/browser/components/places/tests/browser/browser_bookmarkProperties_cancel.js @@ -12,7 +12,7 @@ registerCleanupFunction(async function() { let bookmarks; // Bookmarks added via insertTree. -add_task(async function setup() { +add_setup(async function() { bookmarks = await PlacesUtils.bookmarks.insertTree({ guid: PlacesUtils.bookmarks.unfiledGuid, children: [ diff --git a/browser/components/places/tests/browser/browser_bookmarkProperties_folderSelection.js b/browser/components/places/tests/browser/browser_bookmarkProperties_folderSelection.js index 0c22002e00ebf..9e07a07396e06 100644 --- a/browser/components/places/tests/browser/browser_bookmarkProperties_folderSelection.js +++ b/browser/components/places/tests/browser/browser_bookmarkProperties_folderSelection.js @@ -7,7 +7,7 @@ let bookmarkPanel; let folders; let win; -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.bookmarks.eraseEverything(); Services.prefs.clearUserPref("browser.bookmarks.defaultLocation"); diff --git a/browser/components/places/tests/browser/browser_bookmarkProperties_newFolder.js b/browser/components/places/tests/browser/browser_bookmarkProperties_newFolder.js index cd12522606049..b08a39fad8962 100644 --- a/browser/components/places/tests/browser/browser_bookmarkProperties_newFolder.js +++ b/browser/components/places/tests/browser/browser_bookmarkProperties_newFolder.js @@ -7,7 +7,7 @@ StarUI._createPanelIfNeeded(); const bookmarkPanel = document.getElementById("editBookmarkPanel"); let folders; -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.bookmarks.eraseEverything(); bookmarkPanel.setAttribute("animate", false); diff --git a/browser/components/places/tests/browser/browser_bookmarkProperties_remember_folders.js b/browser/components/places/tests/browser/browser_bookmarkProperties_remember_folders.js index 82ffe56bdd8c3..716aca1e5b61a 100644 --- a/browser/components/places/tests/browser/browser_bookmarkProperties_remember_folders.js +++ b/browser/components/places/tests/browser/browser_bookmarkProperties_remember_folders.js @@ -84,7 +84,7 @@ async function assertRecentFolders(expectedGuids, msg) { ); } -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.bookmarks.eraseEverything(); await PlacesUtils.metadata.delete(PlacesUIUtils.LAST_USED_FOLDERS_META_KEY); diff --git a/browser/components/places/tests/browser/browser_bookmarkProperties_speculativeConnection.js b/browser/components/places/tests/browser/browser_bookmarkProperties_speculativeConnection.js index d590991a7026b..342e12c71d5b7 100644 --- a/browser/components/places/tests/browser/browser_bookmarkProperties_speculativeConnection.js +++ b/browser/components/places/tests/browser/browser_bookmarkProperties_speculativeConnection.js @@ -13,7 +13,7 @@ let spy = sandbox .stub(PlacesUIUtils, "setupSpeculativeConnection") .returns(Promise.resolve()); -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.bookmarks.eraseEverything(); let toolbar = document.getElementById("PersonalToolbar"); diff --git a/browser/components/places/tests/browser/browser_bookmark_add_tags.js b/browser/components/places/tests/browser/browser_bookmark_add_tags.js index 36d2c0d6dc678..e09cd7c88f863 100644 --- a/browser/components/places/tests/browser/browser_bookmark_add_tags.js +++ b/browser/components/places/tests/browser/browser_bookmark_add_tags.js @@ -24,7 +24,7 @@ async function hideBookmarksPanel(callback) { await hiddenPromise; } -add_task(function setup() { +add_setup(function() { let oldTimeout = StarUI._autoCloseTimeout; bookmarkPanel.setAttribute("animate", false); diff --git a/browser/components/places/tests/browser/browser_bookmark_backup_export_import.js b/browser/components/places/tests/browser/browser_bookmark_backup_export_import.js index 5a1eeefde3c76..d50019cf383f8 100644 --- a/browser/components/places/tests/browser/browser_bookmark_backup_export_import.js +++ b/browser/components/places/tests/browser/browser_bookmark_backup_export_import.js @@ -113,7 +113,7 @@ async function promiseImportExport(aWindow) { }); } -add_task(async function setup() { +add_setup(async function() { await promisePlacesInitComplete(); await PlacesUtils.bookmarks.eraseEverything(); await generateTestBookmarks(); diff --git a/browser/components/places/tests/browser/browser_bookmark_change_location.js b/browser/components/places/tests/browser/browser_bookmark_change_location.js index a5808157708be..da133004a1d9a 100644 --- a/browser/components/places/tests/browser/browser_bookmark_change_location.js +++ b/browser/components/places/tests/browser/browser_bookmark_change_location.js @@ -12,7 +12,7 @@ const TEST_URL2 = "about:config"; const TEST_URL3 = "about:credits"; // Setup. -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["browser.toolbars.bookmarks.visibility", "always"]], }); diff --git a/browser/components/places/tests/browser/browser_bookmark_context_menu_contents.js b/browser/components/places/tests/browser/browser_bookmark_context_menu_contents.js index 37e847fab68b1..fdd6d4c81233a 100644 --- a/browser/components/places/tests/browser/browser_bookmark_context_menu_contents.js +++ b/browser/components/places/tests/browser/browser_bookmark_context_menu_contents.js @@ -24,7 +24,7 @@ const bookmarksInfo = [ ]; const TEST_URL = "about:mozilla"; -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.bookmarks.eraseEverything(); let toolbar = document.getElementById("PersonalToolbar"); diff --git a/browser/components/places/tests/browser/browser_bookmark_popup.js b/browser/components/places/tests/browser/browser_bookmark_popup.js index c2dc804cdb446..a7b9a8b137b5e 100644 --- a/browser/components/places/tests/browser/browser_bookmark_popup.js +++ b/browser/components/places/tests/browser/browser_bookmark_popup.js @@ -22,7 +22,7 @@ const TEST_URL = "data:text/html,"; StarUI._closePanelQuickForTesting = true; -add_task(async function setup() { +add_setup(async function() { bookmarkPanel.setAttribute("animate", false); registerCleanupFunction(() => { bookmarkPanel.removeAttribute("animate"); diff --git a/browser/components/places/tests/browser/browser_bookmark_remove_tags.js b/browser/components/places/tests/browser/browser_bookmark_remove_tags.js index fce4a8e923c56..af85e5c7f47a4 100644 --- a/browser/components/places/tests/browser/browser_bookmark_remove_tags.js +++ b/browser/components/places/tests/browser/browser_bookmark_remove_tags.js @@ -7,7 +7,7 @@ const TEST_URL = "about:buildconfig"; const TEST_URI = Services.io.newURI(TEST_URL); // Setup. -add_task(async function setup() { +add_setup(async function() { let toolbar = document.getElementById("PersonalToolbar"); let wasCollapsed = toolbar.collapsed; diff --git a/browser/components/places/tests/browser/browser_bookmarks_change_title.js b/browser/components/places/tests/browser/browser_bookmarks_change_title.js index dcf82a37206e3..a6361f33d5057 100644 --- a/browser/components/places/tests/browser/browser_bookmarks_change_title.js +++ b/browser/components/places/tests/browser/browser_bookmarks_change_title.js @@ -17,7 +17,7 @@ function getToolbarNodeForItemGuid(aItemGuid) { } // Setup. -add_task(async function setup() { +add_setup(async function() { let toolbar = document.getElementById("PersonalToolbar"); let wasCollapsed = toolbar.collapsed; diff --git a/browser/components/places/tests/browser/browser_click_bookmarks_on_toolbar.js b/browser/components/places/tests/browser/browser_click_bookmarks_on_toolbar.js index 468cbb932ef63..b4f4b07b63758 100644 --- a/browser/components/places/tests/browser/browser_click_bookmarks_on_toolbar.js +++ b/browser/components/places/tests/browser/browser_click_bookmarks_on_toolbar.js @@ -65,7 +65,7 @@ function waitForNewTab(url, inBackground) { }); } -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.bookmarks.eraseEverything(); let bookmarks = await Promise.all( TEST_PAGES.map((url, index) => { diff --git a/browser/components/places/tests/browser/browser_controller_onDrop.js b/browser/components/places/tests/browser/browser_controller_onDrop.js index 6f51b670daf9f..7197c0c6420c4 100644 --- a/browser/components/places/tests/browser/browser_controller_onDrop.js +++ b/browser/components/places/tests/browser/browser_controller_onDrop.js @@ -8,7 +8,7 @@ var bookmarks; var bookmarkIds; var library; -add_task(async function setup() { +add_setup(async function() { registerCleanupFunction(async function() { await PlacesUtils.bookmarks.eraseEverything(); await PlacesUtils.history.clear(); diff --git a/browser/components/places/tests/browser/browser_controller_onDrop_query.js b/browser/components/places/tests/browser/browser_controller_onDrop_query.js index ed3604e0104e8..212e5940e60a5 100644 --- a/browser/components/places/tests/browser/browser_controller_onDrop_query.js +++ b/browser/components/places/tests/browser/browser_controller_onDrop_query.js @@ -5,7 +5,7 @@ const TEST_URL = "about:buildconfig"; -add_task(async function setup() { +add_setup(async function() { // Clean before and after so we don't have anything in the folders. await PlacesUtils.bookmarks.eraseEverything(); diff --git a/browser/components/places/tests/browser/browser_controller_onDrop_sidebar.js b/browser/components/places/tests/browser/browser_controller_onDrop_sidebar.js index 79c12c47abe73..ebf7d1b1e9760 100644 --- a/browser/components/places/tests/browser/browser_controller_onDrop_sidebar.js +++ b/browser/components/places/tests/browser/browser_controller_onDrop_sidebar.js @@ -5,7 +5,7 @@ const TEST_URL = "about:buildconfig"; -add_task(async function setup() { +add_setup(async function() { // Clean before and after so we don't have anything in the folders. await PlacesUtils.bookmarks.eraseEverything(); diff --git a/browser/components/places/tests/browser/browser_controller_onDrop_tagFolder.js b/browser/components/places/tests/browser/browser_controller_onDrop_tagFolder.js index 199dda25d8e86..c138c3a783888 100644 --- a/browser/components/places/tests/browser/browser_controller_onDrop_tagFolder.js +++ b/browser/components/places/tests/browser/browser_controller_onDrop_tagFolder.js @@ -12,7 +12,7 @@ const TAG_NAME = "testTag"; var bookmarks; var bookmarkId; -add_task(async function setup() { +add_setup(async function() { registerCleanupFunction(async function() { sandbox.restore(); await PlacesUtils.bookmarks.eraseEverything(); diff --git a/browser/components/places/tests/browser/browser_default_bookmark_location.js b/browser/components/places/tests/browser/browser_default_bookmark_location.js index 16ec05e7cceef..247603b776af9 100644 --- a/browser/components/places/tests/browser/browser_default_bookmark_location.js +++ b/browser/components/places/tests/browser/browser_default_bookmark_location.js @@ -8,7 +8,7 @@ const TEST_URL = "about:about"; let bookmarkPanel; let win; -add_task(async function setup() { +add_setup(async function() { Services.prefs.clearUserPref(LOCATION_PREF); await PlacesUtils.bookmarks.eraseEverything(); diff --git a/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js b/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js index a4bd3686bea64..4607cad5658c8 100644 --- a/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js +++ b/browser/components/places/tests/browser/browser_drag_bookmarks_on_toolbar.js @@ -167,7 +167,7 @@ function getExpectedDataForPlacesNode(aNode) { return [wrappedNode]; } -add_task(async function setup() { +add_setup(async function() { var toolbar = document.getElementById("PersonalToolbar"); var wasCollapsed = toolbar.collapsed; diff --git a/browser/components/places/tests/browser/browser_drag_folder_on_newTab.js b/browser/components/places/tests/browser/browser_drag_folder_on_newTab.js index 5179d7c2435c9..beefae9e8d300 100644 --- a/browser/components/places/tests/browser/browser_drag_folder_on_newTab.js +++ b/browser/components/places/tests/browser/browser_drag_folder_on_newTab.js @@ -3,7 +3,7 @@ "use strict"; -add_task(async function setup() { +add_setup(async function() { let toolbar = document.getElementById("PersonalToolbar"); let wasCollapsed = toolbar.collapsed; diff --git a/browser/components/places/tests/browser/browser_library_bookmark_pages.js b/browser/components/places/tests/browser/browser_library_bookmark_pages.js index 7c9139af35394..9dfc180541678 100644 --- a/browser/components/places/tests/browser/browser_library_bookmark_pages.js +++ b/browser/components/places/tests/browser/browser_library_bookmark_pages.js @@ -11,7 +11,7 @@ const TEST_URIS = ["https://example1.com/", "https://example2.com/"]; let library; -add_task(async function setup() { +add_setup(async function() { await PlacesTestUtils.addVisits(TEST_URIS); library = await promiseLibrary("History"); diff --git a/browser/components/places/tests/browser/browser_library_openFlatContainer.js b/browser/components/places/tests/browser/browser_library_openFlatContainer.js index 5e56c7179da29..3847325682d01 100644 --- a/browser/components/places/tests/browser/browser_library_openFlatContainer.js +++ b/browser/components/places/tests/browser/browser_library_openFlatContainer.js @@ -9,7 +9,7 @@ var library; -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.bookmarks.eraseEverything(); await PlacesUtils.history.clear(); diff --git a/browser/components/places/tests/browser/browser_library_open_all.js b/browser/components/places/tests/browser/browser_library_open_all.js index 5443e0346d6ff..dcb95405ce0c7 100644 --- a/browser/components/places/tests/browser/browser_library_open_all.js +++ b/browser/components/places/tests/browser/browser_library_open_all.js @@ -2,7 +2,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.bookmarks.eraseEverything(); const TEST_EXAMPLE_URL = "http://example.com/"; const TEST_EXAMPLE_PARAMS = "?foo=1|2"; diff --git a/browser/components/places/tests/browser/browser_library_open_all_with_separator.js b/browser/components/places/tests/browser/browser_library_open_all_with_separator.js index 32cdacdefea5a..6afbeec0bc074 100644 --- a/browser/components/places/tests/browser/browser_library_open_all_with_separator.js +++ b/browser/components/places/tests/browser/browser_library_open_all_with_separator.js @@ -2,7 +2,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.bookmarks.eraseEverything(); await PlacesUtils.bookmarks.insertTree({ diff --git a/browser/components/places/tests/browser/browser_library_views_liveupdate.js b/browser/components/places/tests/browser/browser_library_views_liveupdate.js index d05565804f439..e4483785075e7 100644 --- a/browser/components/places/tests/browser/browser_library_views_liveupdate.js +++ b/browser/components/places/tests/browser/browser_library_views_liveupdate.js @@ -8,7 +8,7 @@ let gLibrary = null; -add_task(async function setup() { +add_setup(async function() { gLibrary = await promiseLibrary(); await PlacesUtils.bookmarks.eraseEverything(); diff --git a/browser/components/places/tests/browser/browser_library_warnOnOpen.js b/browser/components/places/tests/browser/browser_library_warnOnOpen.js index d53c6b167e9ba..323765163f73f 100644 --- a/browser/components/places/tests/browser/browser_library_warnOnOpen.js +++ b/browser/components/places/tests/browser/browser_library_warnOnOpen.js @@ -10,7 +10,7 @@ var gLibrary = null; -add_task(async function setup() { +add_setup(async function() { // Temporarily disable history, so we won't record pages navigation. await SpecialPowers.pushPrefEnv({ set: [["places.history.enabled", false]] }); diff --git a/browser/components/places/tests/browser/browser_paste_bookmarks.js b/browser/components/places/tests/browser/browser_paste_bookmarks.js index e7155a121861c..12fd97bc73154 100644 --- a/browser/components/places/tests/browser/browser_paste_bookmarks.js +++ b/browser/components/places/tests/browser/browser_paste_bookmarks.js @@ -9,7 +9,7 @@ const TEST_URL1 = "https://example.com/otherbrowser/"; var PlacesOrganizer; var ContentTree; -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.bookmarks.eraseEverything(); let organizer = await promiseLibrary(); diff --git a/browser/components/places/tests/browser/browser_paste_resets_cut_highlights.js b/browser/components/places/tests/browser/browser_paste_resets_cut_highlights.js index f6636f63a0df8..6efaedfdff7e5 100644 --- a/browser/components/places/tests/browser/browser_paste_resets_cut_highlights.js +++ b/browser/components/places/tests/browser/browser_paste_resets_cut_highlights.js @@ -9,7 +9,7 @@ const TEST_URL1 = "https://example.com/otherbrowser/"; var PlacesOrganizer; var ContentTree; -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.bookmarks.eraseEverything(); let organizer = await promiseLibrary(); diff --git a/browser/components/places/tests/browser/browser_remove_bookmarks.js b/browser/components/places/tests/browser/browser_remove_bookmarks.js index bf81440a673db..2b2bbcff61bb3 100644 --- a/browser/components/places/tests/browser/browser_remove_bookmarks.js +++ b/browser/components/places/tests/browser/browser_remove_bookmarks.js @@ -10,7 +10,7 @@ const TEST_URL = "about:mozilla"; -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.bookmarks.eraseEverything(); let toolbar = document.getElementById("PersonalToolbar"); diff --git a/browser/components/places/tests/browser/browser_sidebar_open_bookmarks.js b/browser/components/places/tests/browser/browser_sidebar_open_bookmarks.js index 85ca2f07770ca..41af88985eab9 100644 --- a/browser/components/places/tests/browser/browser_sidebar_open_bookmarks.js +++ b/browser/components/places/tests/browser/browser_sidebar_open_bookmarks.js @@ -7,7 +7,7 @@ const PREF_LOAD_BOOKMARKS_IN_TABS = "browser.tabs.loadBookmarksInTabs"; var gBms; -add_task(async function setup() { +add_setup(async function() { gBms = await PlacesUtils.bookmarks.insertTree({ guid: PlacesUtils.bookmarks.unfiledGuid, children: [ diff --git a/browser/components/places/tests/browser/browser_toolbar_library_open_recent.js b/browser/components/places/tests/browser/browser_toolbar_library_open_recent.js index 12fc49fcaf29a..cffe9feafa08d 100644 --- a/browser/components/places/tests/browser/browser_toolbar_library_open_recent.js +++ b/browser/components/places/tests/browser/browser_toolbar_library_open_recent.js @@ -122,7 +122,7 @@ async function getRecentlyBookmarkedItems() { return Array.from(items).slice(0, 2); } -add_task(async function setup() { +add_setup(async function() { let libraryButton = CustomizableUI.getPlacementOfWidget("library-button"); if (!libraryButton) { CustomizableUI.addWidgetToArea( diff --git a/browser/components/places/tests/browser/browser_toolbar_other_bookmarks.js b/browser/components/places/tests/browser/browser_toolbar_other_bookmarks.js index 6147f7cd0386b..d09724f387b25 100644 --- a/browser/components/places/tests/browser/browser_toolbar_other_bookmarks.js +++ b/browser/components/places/tests/browser/browser_toolbar_other_bookmarks.js @@ -25,7 +25,7 @@ const bookmarksInfo = [ */ // Setup. -add_task(async function setup() { +add_setup(async function() { let toolbar = document.getElementById("PersonalToolbar"); let wasCollapsed = toolbar.collapsed; diff --git a/browser/components/places/tests/browser/browser_toolbar_overflow.js b/browser/components/places/tests/browser/browser_toolbar_overflow.js index 028b1a99f6d27..82612171756e0 100644 --- a/browser/components/places/tests/browser/browser_toolbar_overflow.js +++ b/browser/components/places/tests/browser/browser_toolbar_overflow.js @@ -11,7 +11,7 @@ var gChevron = document.getElementById("PlacesChevron"); const BOOKMARKS_COUNT = 250; -add_task(async function setup() { +add_setup(async function() { let wasCollapsed = gToolbar.collapsed; await PlacesUtils.bookmarks.eraseEverything(); diff --git a/browser/components/places/tests/browser/interactions/browser_interactions_blocklist.js b/browser/components/places/tests/browser/interactions/browser_interactions_blocklist.js index d905522a5a0e3..5bd8c6fcc172e 100644 --- a/browser/components/places/tests/browser/interactions/browser_interactions_blocklist.js +++ b/browser/components/places/tests/browser/interactions/browser_interactions_blocklist.js @@ -13,7 +13,7 @@ XPCOMUtils.defineLazyModuleGetters(this, { InteractionsBlocklist: "resource:///modules/InteractionsBlocklist.jsm", }); -add_task(async function setup() { +add_setup(async function() { let oldBlocklistValue = Services.prefs.getStringPref( "places.interactions.customBlocklist", "[]" diff --git a/browser/components/preferences/tests/browser_applications_selection.js b/browser/components/preferences/tests/browser_applications_selection.js index 9c5093a118e13..0ae5985b3e55d 100644 --- a/browser/components/preferences/tests/browser_applications_selection.js +++ b/browser/components/preferences/tests/browser_applications_selection.js @@ -65,7 +65,7 @@ function scrubMailtoHandlers(handlerInfo) { } } -add_task(async function setup() { +add_setup(async function() { // Create our dummy handlers let handler1 = Cc["@mozilla.org/uriloader/web-handler-app;1"].createInstance( Ci.nsIWebHandlerApp diff --git a/browser/components/preferences/tests/browser_cloud_storage.js b/browser/components/preferences/tests/browser_cloud_storage.js index 038496ede71de..3d6b57c5d4856 100644 --- a/browser/components/preferences/tests/browser_cloud_storage.js +++ b/browser/components/preferences/tests/browser_cloud_storage.js @@ -76,7 +76,7 @@ async function mock_dropbox() { }); } -add_task(async function setup() { +add_setup(async function() { // Create mock Dropbox download folder for cloudstorage API // Set prefs required to display second radio option // 'Save to Dropbox' under Downloads diff --git a/browser/components/preferences/tests/browser_containers_name_input.js b/browser/components/preferences/tests/browser_containers_name_input.js index a59ea35b19301..b456c693f851d 100644 --- a/browser/components/preferences/tests/browser_containers_name_input.js +++ b/browser/components/preferences/tests/browser_containers_name_input.js @@ -1,7 +1,7 @@ const CONTAINERS_URL = "chrome://browser/content/preferences/dialogs/containers.xhtml"; -add_task(async function setup() { +add_setup(async function() { await openPreferencesViaOpenPreferencesAPI("containers", { leaveOpen: true }); registerCleanupFunction(async function() { BrowserTestUtils.removeTab(gBrowser.selectedTab); diff --git a/browser/components/preferences/tests/browser_contentblocking_standard_tcp_toggle.js b/browser/components/preferences/tests/browser_contentblocking_standard_tcp_toggle.js index b8eed1269f534..68b863425a37a 100644 --- a/browser/components/preferences/tests/browser_contentblocking_standard_tcp_toggle.js +++ b/browser/components/preferences/tests/browser_contentblocking_standard_tcp_toggle.js @@ -64,7 +64,7 @@ async function waitForAndAssertPrefState(pref, expectedValue, message) { }); } -add_task(async function setup() { +add_setup(async function() { const defaultPrefs = Services.prefs.getDefaultBranch(""); const previousDefaultCB = defaultPrefs.getIntPref(COOKIE_BEHAVIOR_PREF); diff --git a/browser/components/preferences/tests/browser_engines.js b/browser/components/preferences/tests/browser_engines.js index 8bc2850c06b5d..ca6e8c6425714 100644 --- a/browser/components/preferences/tests/browser_engines.js +++ b/browser/components/preferences/tests/browser_engines.js @@ -8,7 +8,7 @@ function getCellText(tree, i, cellName) { return tree.view.getCellText(i, tree.columns.getNamedColumn(cellName)); } -add_task(async function setup() { +add_setup(async function() { await SearchTestUtils.installSearchExtension({ keyword: ["testing", "customkeyword"], search_url: "https://example.com/engine1", diff --git a/browser/components/preferences/tests/browser_filetype_dialog.js b/browser/components/preferences/tests/browser_filetype_dialog.js index 5839cbaee9f2c..343e32f15dcc4 100644 --- a/browser/components/preferences/tests/browser_filetype_dialog.js +++ b/browser/components/preferences/tests/browser_filetype_dialog.js @@ -77,7 +77,7 @@ function scrubMailtoHandlers(handlerInfo) { ("use strict"); -add_task(async function setup() { +add_setup(async function() { // Create our dummy handlers let handler1 = Cc["@mozilla.org/uriloader/web-handler-app;1"].createInstance( Ci.nsIWebHandlerApp diff --git a/browser/components/preferences/tests/browser_homepages_use_bookmark.js b/browser/components/preferences/tests/browser_homepages_use_bookmark.js index 7f839c6de6a68..a84376e84426c 100644 --- a/browser/components/preferences/tests/browser_homepages_use_bookmark.js +++ b/browser/components/preferences/tests/browser_homepages_use_bookmark.js @@ -6,7 +6,7 @@ const TEST_URL1 = "http://example.com/1"; const TEST_URL2 = "http://example.com/2"; -add_task(async function setup() { +add_setup(async function() { let oldHomepagePref = Services.prefs.getCharPref("browser.startup.homepage"); await openPreferencesViaOpenPreferencesAPI("paneHome", { leaveOpen: true }); diff --git a/browser/components/preferences/tests/browser_permissions_dialog_default_perm.js b/browser/components/preferences/tests/browser_permissions_dialog_default_perm.js index 4c44a1c2b9d51..5c5bd87d52df4 100644 --- a/browser/components/preferences/tests/browser_permissions_dialog_default_perm.js +++ b/browser/components/preferences/tests/browser_permissions_dialog_default_perm.js @@ -69,7 +69,7 @@ async function openPermissionsDialog() { await sitePermissionsDialog.document.mozSubdialogReady; } -add_task(async function setup() { +add_setup(async function() { await addDefaultTestPermissions(); }); diff --git a/browser/components/preferences/tests/browser_sanitizeOnShutdown_prefLocked.js b/browser/components/preferences/tests/browser_sanitizeOnShutdown_prefLocked.js index d927423c24513..9811ed62d1c6d 100644 --- a/browser/components/preferences/tests/browser_sanitizeOnShutdown_prefLocked.js +++ b/browser/components/preferences/tests/browser_sanitizeOnShutdown_prefLocked.js @@ -24,7 +24,7 @@ function testPrefStateMatchesLockedState() { gBrowser.removeCurrentTab(); } -add_task(function setup() { +add_setup(function() { registerCleanupFunction(function resetPreferences() { Services.prefs.unlockPref("privacy.sanitize.sanitizeOnShutdown"); Services.prefs.clearUserPref("privacy.history.custom"); diff --git a/browser/components/preferences/tests/browser_searchDefaultEngine.js b/browser/components/preferences/tests/browser_searchDefaultEngine.js index 2005f339cd389..cee6fe5f6cde2 100644 --- a/browser/components/preferences/tests/browser_searchDefaultEngine.js +++ b/browser/components/preferences/tests/browser_searchDefaultEngine.js @@ -7,7 +7,7 @@ const { SearchTestUtils } = ChromeUtils.import( SearchTestUtils.init(this); -add_task(async function setup() { +add_setup(async function() { await SearchTestUtils.installSearchExtension({ name: "engine1", search_url: "https://example.com/engine1", diff --git a/browser/components/preferences/tests/browser_searchsuggestions.js b/browser/components/preferences/tests/browser_searchsuggestions.js index d304b630c2562..918ee41cb5955 100644 --- a/browser/components/preferences/tests/browser_searchsuggestions.js +++ b/browser/components/preferences/tests/browser_searchsuggestions.js @@ -5,7 +5,7 @@ const PRIVATE_PREF_NAME = "browser.search.suggest.enabled.private"; let initialUrlbarSuggestValue; let initialSuggestionsInPrivateValue; -add_task(async function setup() { +add_setup(async function() { const originalSuggest = Services.prefs.getBoolPref(SUGGEST_PREF_NAME); initialUrlbarSuggestValue = Services.prefs.getBoolPref( URLBAR_SUGGEST_PREF_NAME diff --git a/browser/components/preferences/tests/browser_security-1.js b/browser/components/preferences/tests/browser_security-1.js index 31cd91b69dd9e..246e45704e98e 100644 --- a/browser/components/preferences/tests/browser_security-1.js +++ b/browser/components/preferences/tests/browser_security-1.js @@ -24,7 +24,7 @@ registerCleanupFunction(function() { // each time that it wants to test various preference combinations. We // only use one tab (instead of opening/closing for each test) for all // to help improve test times on debug builds. -add_task(async function setup() { +add_setup(async function() { await openPreferencesViaOpenPreferencesAPI("privacy", { leaveOpen: true }); registerCleanupFunction(async function() { BrowserTestUtils.removeTab(gBrowser.selectedTab); diff --git a/browser/components/preferences/tests/browser_security-2.js b/browser/components/preferences/tests/browser_security-2.js index f7748df68203a..07e571cd2e62d 100644 --- a/browser/components/preferences/tests/browser_security-2.js +++ b/browser/components/preferences/tests/browser_security-2.js @@ -24,7 +24,7 @@ registerCleanupFunction(function() { // each time that it wants to test various preference combinations. We // only use one tab (instead of opening/closing for each test) for all // to help improve test times on debug builds. -add_task(async function setup() { +add_setup(async function() { await openPreferencesViaOpenPreferencesAPI("privacy", { leaveOpen: true }); registerCleanupFunction(async function() { BrowserTestUtils.removeTab(gBrowser.selectedTab); diff --git a/browser/components/preferences/tests/browser_sync_pairing.js b/browser/components/preferences/tests/browser_sync_pairing.js index 40b829c5572e8..16b8141403641 100644 --- a/browser/components/preferences/tests/browser_sync_pairing.js +++ b/browser/components/preferences/tests/browser_sync_pairing.js @@ -13,7 +13,7 @@ const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm"); let flowCounter = 0; -add_task(async function setup() { +add_setup(async function() { Services.prefs.setBoolPref("identity.fxaccounts.pairing.enabled", true); // Sync start-up might interfere with our tests, don't let UIState send UI updates. const origNotifyStateUpdated = UIState._internal.notifyStateUpdated; diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js index 591d4d3ab291b..e2822bdd71577 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about.js @@ -37,7 +37,7 @@ async function testLinkOpensUrl({ win, tab, elementId, expectedUrl }) { let expectedEngineAlias; let expectedIconURL; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.search.separatePrivateDefault", true], diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about_messaging.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about_messaging.js index c7f89dae5a92a..da4c937b88a42 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about_messaging.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about_messaging.js @@ -58,7 +58,7 @@ async function setupMSExperimentWithMessage(message) { return doExperimentCleanup; } -add_task(async function setup() { +add_setup(async function() { let { win } = await openAboutPrivateBrowsing(); await BrowserTestUtils.closeWindow(win); }); diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about_search_banner.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about_search_banner.js index d36f52a730986..c97592f62389d 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about_search_banner.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_about_search_banner.js @@ -16,7 +16,7 @@ const PREF_MAX_SEARCH_BANNER_SHOW_COUNT = "browser.search.separatePrivateDefault.ui.banner.max"; const MAX_SHOW_COUNT = 5; -add_task(async function setup() { +add_setup(async function() { SpecialPowers.pushPrefEnv({ set: [ [PREF_UI_ENABLED, false], diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_concurrent.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_concurrent.js index 976f02dc68b8c..5b8be666fca30 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_concurrent.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_concurrent.js @@ -11,7 +11,7 @@ // Step 3: load a page in the tab from step 1 that checks the value of test2 is value2 and the total count in non-private storage is 1 // Step 4: load a page in the tab from step 2 that checks the value of test is value and the total count in private storage is 1 -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["dom.ipc.processCount", 1]], }); diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_rememberprompt.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_rememberprompt.js index 57c067e5a6fe2..e930922969460 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_rememberprompt.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_rememberprompt.js @@ -5,7 +5,7 @@ // This test makes sure that the geolocation prompt does not show a remember // control inside the private browsing mode. -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["dom.vr.always_support_vr", true]], }); diff --git a/browser/components/protections/test/browser/browser_protections_proxy.js b/browser/components/protections/test/browser/browser_protections_proxy.js index ff02df2946998..14af593483028 100644 --- a/browser/components/protections/test/browser/browser_protections_proxy.js +++ b/browser/components/protections/test/browser/browser_protections_proxy.js @@ -8,7 +8,7 @@ XPCOMUtils.defineLazyModuleGetters(this, { Region: "resource://gre/modules/Region.jsm", }); -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.contentblocking.report.monitor.enabled", false], diff --git a/browser/components/protections/test/browser/browser_protections_report_ui.js b/browser/components/protections/test/browser/browser_protections_report_ui.js index 0abff5485ec49..34bf24b41fc53 100644 --- a/browser/components/protections/test/browser/browser_protections_report_ui.js +++ b/browser/components/protections/test/browser/browser_protections_report_ui.js @@ -29,7 +29,7 @@ const SQL = { selectAll: "SELECT * FROM events", }; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.contentblocking.database.enabled", true], diff --git a/browser/components/protections/test/browser/browser_protections_telemetry.js b/browser/components/protections/test/browser/browser_protections_telemetry.js index 0f92dd2eaf9b2..113c1d05b6ee3 100644 --- a/browser/components/protections/test/browser/browser_protections_telemetry.js +++ b/browser/components/protections/test/browser/browser_protections_telemetry.js @@ -43,7 +43,7 @@ const LOG = { requestLongerTimeout(2); -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.vpn_promo.enabled", true], diff --git a/browser/components/protections/test/browser/browser_protections_vpn.js b/browser/components/protections/test/browser/browser_protections_vpn.js index f44b29c0d7e17..23107841f4bdd 100644 --- a/browser/components/protections/test/browser/browser_protections_vpn.js +++ b/browser/components/protections/test/browser/browser_protections_vpn.js @@ -64,7 +64,7 @@ async function revertRegions() { setHomeRegion(initialHomeRegion); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.contentblocking.report.monitor.enabled", false], diff --git a/browser/components/resistfingerprinting/test/browser/browser_dynamical_window_rounding.js b/browser/components/resistfingerprinting/test/browser/browser_dynamical_window_rounding.js index 3a7612d77b827..3c5dc5e745157 100644 --- a/browser/components/resistfingerprinting/test/browser/browser_dynamical_window_rounding.js +++ b/browser/components/resistfingerprinting/test/browser/browser_dynamical_window_rounding.js @@ -346,7 +346,7 @@ async function test_findbar(aWindow) { BrowserTestUtils.removeTab(tab); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["privacy.resistFingerprinting.letterboxing", true], diff --git a/browser/components/resistfingerprinting/test/browser/browser_roundedWindow_dialogWindow.js b/browser/components/resistfingerprinting/test/browser/browser_roundedWindow_dialogWindow.js index 63d14aeb4532b..57f60f4153a27 100644 --- a/browser/components/resistfingerprinting/test/browser/browser_roundedWindow_dialogWindow.js +++ b/browser/components/resistfingerprinting/test/browser/browser_roundedWindow_dialogWindow.js @@ -33,7 +33,7 @@ async function test_dialog_window() { await BrowserTestUtils.closeWindow(diagWin); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["privacy.resistFingerprinting", true]], }); diff --git a/browser/components/resistfingerprinting/test/browser/browser_roundedWindow_newWindow.js b/browser/components/resistfingerprinting/test/browser/browser_roundedWindow_newWindow.js index 1a18edb1925ae..aa7290a9004d6 100644 --- a/browser/components/resistfingerprinting/test/browser/browser_roundedWindow_newWindow.js +++ b/browser/components/resistfingerprinting/test/browser/browser_roundedWindow_newWindow.js @@ -8,7 +8,7 @@ const CC = Components.Constructor; let gMaxAvailWidth; let gMaxAvailHeight; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["privacy.resistFingerprinting", true]], }); diff --git a/browser/components/resistfingerprinting/test/browser/browser_spoofing_keyboard_event.js b/browser/components/resistfingerprinting/test/browser/browser_spoofing_keyboard_event.js index aae35f6aa7864..9703fca055edc 100644 --- a/browser/components/resistfingerprinting/test/browser/browser_spoofing_keyboard_event.js +++ b/browser/components/resistfingerprinting/test/browser/browser_spoofing_keyboard_event.js @@ -2147,7 +2147,7 @@ function eventConsumer(aEvent) { aEvent.preventDefault(); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["privacy.resistFingerprinting", true]], }); diff --git a/browser/components/resistfingerprinting/test/browser/browser_timezone.js b/browser/components/resistfingerprinting/test/browser/browser_timezone.js index f7d9b5e7d0002..5baa13124e73a 100644 --- a/browser/components/resistfingerprinting/test/browser/browser_timezone.js +++ b/browser/components/resistfingerprinting/test/browser/browser_timezone.js @@ -3,7 +3,7 @@ * UTC timezone after fingerprinting resistance is enabled. */ -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["privacy.resistFingerprinting", true]], }); diff --git a/browser/components/search/test/browser/browser_contentSearchUI.js b/browser/components/search/test/browser/browser_contentSearchUI.js index c032dd89b7680..dc017791170e0 100644 --- a/browser/components/search/test/browser/browser_contentSearchUI.js +++ b/browser/components/search/test/browser/browser_contentSearchUI.js @@ -251,7 +251,7 @@ let extension1; let extension2; let currentEngineName; -add_task(async function setup() { +add_setup(async function() { let originalOnMessageSearch = ContentSearch._onMessageSearch; let originalOnMessageManageEngines = ContentSearch._onMessageManageEngines; diff --git a/browser/components/search/test/browser/browser_contentSearchUI_default.js b/browser/components/search/test/browser/browser_contentSearchUI_default.js index 893f090776203..19c1e84af688a 100644 --- a/browser/components/search/test/browser/browser_contentSearchUI_default.js +++ b/browser/components/search/test/browser/browser_contentSearchUI_default.js @@ -9,7 +9,7 @@ let extension; let defaultEngine; let addedEngine; -add_task(async function setup() { +add_setup(async function() { // Disable window occlusion. Bug 1733955 if (navigator.platform.indexOf("Win") == 0) { await SpecialPowers.pushPrefEnv({ diff --git a/browser/components/search/test/browser/browser_contextSearchTabPosition.js b/browser/components/search/test/browser/browser_contextSearchTabPosition.js index 889e094ba566d..5c39b5fa1bf55 100644 --- a/browser/components/search/test/browser/browser_contextSearchTabPosition.js +++ b/browser/components/search/test/browser/browser_contextSearchTabPosition.js @@ -4,7 +4,7 @@ let engine; -add_task(async function setup() { +add_setup(async function() { engine = await SearchTestUtils.promiseNewSearchEngine( getRootDirectory(gTestPath) + "testEngine.xml" ); diff --git a/browser/components/search/test/browser/browser_contextmenu.js b/browser/components/search/test/browser/browser_contextmenu.js index 346ae02230e6a..a569cff279e6f 100644 --- a/browser/components/search/test/browser/browser_contextmenu.js +++ b/browser/components/search/test/browser/browser_contextmenu.js @@ -26,7 +26,7 @@ let extensions = []; let oldDefaultEngine; let oldDefaultPrivateEngine; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.search.separatePrivateDefault", true], diff --git a/browser/components/search/test/browser/browser_contextmenu_whereToOpenLink.js b/browser/components/search/test/browser/browser_contextmenu_whereToOpenLink.js index 192a1681508ac..bd4c0fc0b460d 100644 --- a/browser/components/search/test/browser/browser_contextmenu_whereToOpenLink.js +++ b/browser/components/search/test/browser/browser_contextmenu_whereToOpenLink.js @@ -14,7 +14,7 @@ const ENGINE_NAME = "mozSearch"; const ENGINE_URL = "https://example.com/browser/browser/components/search/test/browser/mozsearch.sjs"; -add_task(async function setup() { +add_setup(async function() { await Services.search.init(); await SearchTestUtils.installSearchExtension({ diff --git a/browser/components/search/test/browser/browser_google_behavior.js b/browser/components/search/test/browser/browser_google_behavior.js index 726d23418d9bc..e0ce9180ac96c 100644 --- a/browser/components/search/test/browser/browser_google_behavior.js +++ b/browser/components/search/test/browser/browser_google_behavior.js @@ -84,7 +84,7 @@ function promiseContentSearchReady(browser) { }); } -add_task(async function setup() { +add_setup(async function() { await Services.search.init(); }); diff --git a/browser/components/search/test/browser/browser_ime_composition.js b/browser/components/search/test/browser/browser_ime_composition.js index b25e64b8c8e51..2e16ec8a35ddc 100644 --- a/browser/components/search/test/browser/browser_ime_composition.js +++ b/browser/components/search/test/browser/browser_ime_composition.js @@ -3,7 +3,7 @@ // Tests ime composition handling on searchbar. -add_task(async function setup() { +add_setup(async function() { await gCUITestUtils.addSearchBar(); await SearchTestUtils.installSearchExtension(); diff --git a/browser/components/search/test/browser/browser_search_telemetry_aboutHome.js b/browser/components/search/test/browser/browser_search_telemetry_aboutHome.js index 9356d0761780d..649510d7a7cb1 100644 --- a/browser/components/search/test/browser/browser_search_telemetry_aboutHome.js +++ b/browser/components/search/test/browser/browser_search_telemetry_aboutHome.js @@ -2,7 +2,7 @@ const SCALAR_ABOUT_HOME = "browser.engagement.navigation.about_home"; -add_task(async function setup() { +add_setup(async function() { // about:home uses IndexedDB. However, the test finishes too quickly and doesn't // allow it enougth time to save. So it throws. This disables all the uncaught // exception in this file and that's the reason why we split about:home tests diff --git a/browser/components/search/test/browser/browser_search_telemetry_content.js b/browser/components/search/test/browser/browser_search_telemetry_content.js index 35df332b25f7e..ee2c3c30b9503 100644 --- a/browser/components/search/test/browser/browser_search_telemetry_content.js +++ b/browser/components/search/test/browser/browser_search_telemetry_content.js @@ -4,7 +4,7 @@ const BASE_PROBE_NAME = "browser.engagement.navigation."; const SCALAR_CONTEXT_MENU = BASE_PROBE_NAME + "contextmenu"; const SCALAR_ABOUT_NEWTAB = BASE_PROBE_NAME + "about_newtab"; -add_task(async function setup() { +add_setup(async function() { // Create two new search engines. Mark one as the default engine, so // the test don't crash. We need to engines for this test as the searchbar // in content doesn't display the default search engine among the one-off engines. diff --git a/browser/components/search/test/browser/browser_search_telemetry_searchbar.js b/browser/components/search/test/browser/browser_search_telemetry_searchbar.js index 2023f18ca2a18..eecd0ed6f7043 100644 --- a/browser/components/search/test/browser/browser_search_telemetry_searchbar.js +++ b/browser/components/search/test/browser/browser_search_telemetry_searchbar.js @@ -48,7 +48,7 @@ function clickSearchbarSuggestion(entryName, clickOptions = {}) { EventUtils.synthesizeMouseAtCenter(richlistitem, clickOptions); } -add_task(async function setup() { +add_setup(async function() { await gCUITestUtils.addSearchBar(); const url = getRootDirectory(gTestPath) + "telemetrySearchSuggestions.xml"; suggestionEngine = await SearchTestUtils.promiseNewSearchEngine(url, ""); diff --git a/browser/components/search/test/browser/browser_search_telemetry_sources.js b/browser/components/search/test/browser/browser_search_telemetry_sources.js index 8aaf6e931b834..4e7f59161bb5f 100644 --- a/browser/components/search/test/browser/browser_search_telemetry_sources.js +++ b/browser/components/search/test/browser/browser_search_telemetry_sources.js @@ -68,7 +68,7 @@ async function waitForIdle() { SearchTestUtils.init(this); UrlbarTestUtils.init(this); -add_task(async function setup() { +add_setup(async function() { SearchSERPTelemetry.overrideSearchTelemetryForTests(TEST_PROVIDER_INFO); await waitForIdle(); await SpecialPowers.pushPrefEnv({ diff --git a/browser/components/search/test/browser/browser_search_telemetry_sources_ads.js b/browser/components/search/test/browser/browser_search_telemetry_sources_ads.js index db8c0bc85bb8e..6aa9505e4672c 100644 --- a/browser/components/search/test/browser/browser_search_telemetry_sources_ads.js +++ b/browser/components/search/test/browser/browser_search_telemetry_sources_ads.js @@ -49,7 +49,7 @@ async function waitForIdle() { } } -add_task(async function setup() { +add_setup(async function() { SearchSERPTelemetry.overrideSearchTelemetryForTests(TEST_PROVIDER_INFO); await waitForIdle(); // Enable local telemetry recording for the duration of the tests. diff --git a/browser/components/search/test/browser/browser_search_telemetry_sources_navigation.js b/browser/components/search/test/browser/browser_search_telemetry_sources_navigation.js index 531f328c797f8..f7b886020d766 100644 --- a/browser/components/search/test/browser/browser_search_telemetry_sources_navigation.js +++ b/browser/components/search/test/browser/browser_search_telemetry_sources_navigation.js @@ -70,7 +70,7 @@ UrlbarTestUtils.init(this); let tab; -add_task(async function setup() { +add_setup(async function() { searchCounts.clear(); Services.telemetry.clearScalars(); diff --git a/browser/components/search/test/browser/browser_searchbar_addEngine.js b/browser/components/search/test/browser/browser_searchbar_addEngine.js index 0aef75ec2b557..d2e61e5093b53 100644 --- a/browser/components/search/test/browser/browser_searchbar_addEngine.js +++ b/browser/components/search/test/browser/browser_searchbar_addEngine.js @@ -14,7 +14,7 @@ const { PromptTestUtils } = ChromeUtils.import( const searchPopup = document.getElementById("PopupSearchAutoComplete"); let searchbar; -add_task(async function setup() { +add_setup(async function() { searchbar = await gCUITestUtils.addSearchBar(); registerCleanupFunction(async function() { diff --git a/browser/components/search/test/browser/browser_searchbar_context.js b/browser/components/search/test/browser/browser_searchbar_context.js index 481e3dfa4f524..8f4387ca950e3 100644 --- a/browser/components/search/test/browser/browser_searchbar_context.js +++ b/browser/components/search/test/browser/browser_searchbar_context.js @@ -9,7 +9,7 @@ let win; -add_task(async function setup() { +add_setup(async function() { await gCUITestUtils.addSearchBar(); win = await BrowserTestUtils.openNewBrowserWindow(); diff --git a/browser/components/search/test/browser/browser_searchbar_default.js b/browser/components/search/test/browser/browser_searchbar_default.js index 1b5c6fa17b1e5..1433025b67d77 100644 --- a/browser/components/search/test/browser/browser_searchbar_default.js +++ b/browser/components/search/test/browser/browser_searchbar_default.js @@ -16,7 +16,7 @@ const templatePrivate = "https://example.com/?query="; const searchPopup = document.getElementById("PopupSearchAutoComplete"); -add_task(async function setup() { +add_setup(async function() { await gCUITestUtils.addSearchBar(); await SpecialPowers.pushPrefEnv({ diff --git a/browser/components/search/test/browser/browser_searchbar_enter.js b/browser/components/search/test/browser/browser_searchbar_enter.js index 04e94ceafce82..c6a3cbcc74b06 100644 --- a/browser/components/search/test/browser/browser_searchbar_enter.js +++ b/browser/components/search/test/browser/browser_searchbar_enter.js @@ -5,7 +5,7 @@ // Test the behavior for enter key. -add_task(async function setup() { +add_setup(async function() { await gCUITestUtils.addSearchBar(); await SearchTestUtils.installSearchExtension(); diff --git a/browser/components/search/test/browser/browser_searchbar_keyboard_navigation.js b/browser/components/search/test/browser/browser_searchbar_keyboard_navigation.js index 504dd3aef5d48..95b32fc4fb0d2 100644 --- a/browser/components/search/test/browser/browser_searchbar_keyboard_navigation.js +++ b/browser/components/search/test/browser/browser_searchbar_keyboard_navigation.js @@ -47,7 +47,7 @@ async function checkHeader(engine) { ); } -add_task(async function setup() { +add_setup(async function() { searchbar = await gCUITestUtils.addSearchBar(); textbox = searchbar.textbox; diff --git a/browser/components/search/test/browser/browser_searchbar_openpopup.js b/browser/components/search/test/browser/browser_searchbar_openpopup.js index 1d8c49a5bb7e6..2d0177b03b751 100644 --- a/browser/components/search/test/browser/browser_searchbar_openpopup.js +++ b/browser/components/search/test/browser/browser_searchbar_openpopup.js @@ -34,7 +34,7 @@ let searchIcon; let goButton; let engine; -add_task(async function setup() { +add_setup(async function() { searchbar = await gCUITestUtils.addSearchBar(); textbox = searchbar.textbox; searchIcon = searchbar.querySelector(".searchbar-search-button"); diff --git a/browser/components/search/test/browser/browser_searchbar_results.js b/browser/components/search/test/browser/browser_searchbar_results.js index 1744ce0dacaf7..283a333f71e8e 100644 --- a/browser/components/search/test/browser/browser_searchbar_results.js +++ b/browser/components/search/test/browser/browser_searchbar_results.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -add_task(async function setup() { +add_setup(async function() { await gCUITestUtils.addSearchBar(); await clearSearchbarHistory(); let defaultEngine = await Services.search.getDefault(); diff --git a/browser/components/search/test/browser/browser_searchbar_smallpanel_keyboard_navigation.js b/browser/components/search/test/browser/browser_searchbar_smallpanel_keyboard_navigation.js index 86c50dfd4de76..fe199e1a2e4da 100644 --- a/browser/components/search/test/browser/browser_searchbar_smallpanel_keyboard_navigation.js +++ b/browser/components/search/test/browser/browser_searchbar_smallpanel_keyboard_navigation.js @@ -23,7 +23,7 @@ let searchbar; let textbox; let searchIcon; -add_task(async function setup() { +add_setup(async function() { searchbar = await gCUITestUtils.addSearchBar(); registerCleanupFunction(() => { gCUITestUtils.removeSearchBar(); diff --git a/browser/components/sessionstore/test/browser_350525.js b/browser/components/sessionstore/test/browser_350525.js index b046b1c65c627..812e5f1310313 100644 --- a/browser/components/sessionstore/test/browser_350525.js +++ b/browser/components/sessionstore/test/browser_350525.js @@ -1,6 +1,6 @@ "use strict"; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["dom.ipc.processCount", 1]], }); diff --git a/browser/components/sessionstore/test/browser_354894_perwindowpb.js b/browser/components/sessionstore/test/browser_354894_perwindowpb.js index d0e3aa99e0871..43114f69dd658 100644 --- a/browser/components/sessionstore/test/browser_354894_perwindowpb.js +++ b/browser/components/sessionstore/test/browser_354894_perwindowpb.js @@ -75,7 +75,7 @@ function getBrowserWindowsCount() { return { open, winstates }; } -add_task(async function setup() { +add_setup(async function() { // Make sure we've only got one browser window to start with let { open, winstates } = getBrowserWindowsCount(); is(open, 1, "Should only be one open window"); diff --git a/browser/components/sessionstore/test/browser_393716.js b/browser/components/sessionstore/test/browser_393716.js index ff94dc7481db7..6a98435724535 100644 --- a/browser/components/sessionstore/test/browser_393716.js +++ b/browser/components/sessionstore/test/browser_393716.js @@ -5,7 +5,7 @@ const URL = "about:config"; -add_task(async function setup() { +add_setup(async function() { // Make sure that the field of which we restore the state is visible on load. await SpecialPowers.pushPrefEnv({ set: [["browser.aboutConfig.showWarning", false]], diff --git a/browser/components/sessionstore/test/browser_625016.js b/browser/components/sessionstore/test/browser_625016.js index c6da28d2e9843..e5f32d40df0a9 100644 --- a/browser/components/sessionstore/test/browser_625016.js +++ b/browser/components/sessionstore/test/browser_625016.js @@ -1,7 +1,7 @@ /* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ -add_task(async function setup() { +add_setup(async function() { /** Test for Bug 625016 - Restore windows closed in succession to quit (non-OSX only) **/ // We'll test this by opening a new window, waiting for the save diff --git a/browser/components/sessionstore/test/browser_background_tab_crash.js b/browser/components/sessionstore/test/browser_background_tab_crash.js index c74fdc5eba10b..a500d489b192c 100644 --- a/browser/components/sessionstore/test/browser_background_tab_crash.js +++ b/browser/components/sessionstore/test/browser_background_tab_crash.js @@ -111,7 +111,7 @@ async function crashBackgroundTabs(tabs) { } } -add_task(async function setup() { +add_setup(async function() { // We'll simplify by making sure we only ever one content process for this // test. await SpecialPowers.pushPrefEnv({ diff --git a/browser/components/sessionstore/test/browser_formdata_xpath.js b/browser/components/sessionstore/test/browser_formdata_xpath.js index 99087a56009de..37644d7c5bff8 100644 --- a/browser/components/sessionstore/test/browser_formdata_xpath.js +++ b/browser/components/sessionstore/test/browser_formdata_xpath.js @@ -8,7 +8,7 @@ const URL = ROOT + "browser_formdata_xpath_sample.html"; /** * Bug 346337 - Generic form data restoration tests. */ -add_task(function setup() { +add_setup(function() { // make sure we don't save form data at all (except for tab duplication) Services.prefs.setIntPref("browser.sessionstore.privacy_level", 2); diff --git a/browser/components/sessionstore/test/browser_pinned_tabs.js b/browser/components/sessionstore/test/browser_pinned_tabs.js index 2f03e04d4cead..a4d1cce85bd60 100644 --- a/browser/components/sessionstore/test/browser_pinned_tabs.js +++ b/browser/components/sessionstore/test/browser_pinned_tabs.js @@ -33,7 +33,7 @@ function promiseSessionStoreLoads(numberOfLoads) { }); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.sessionstore.restore_on_demand", true], diff --git a/browser/components/sessionstore/test/browser_restore_container_tabs_oa.js b/browser/components/sessionstore/test/browser_restore_container_tabs_oa.js index 6bfe5c53670e8..fc22ab917fd2e 100644 --- a/browser/components/sessionstore/test/browser_restore_container_tabs_oa.js +++ b/browser/components/sessionstore/test/browser_restore_container_tabs_oa.js @@ -34,7 +34,7 @@ function handleEventLocal(aEvent) { var NUM_DIFF_TAB_MODES = NUM_USER_CONTEXTS + 1; /** regular tab */ -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ // Set the pref to true so we know exactly how many tabs should be restoring at diff --git a/browser/components/sessionstore/test/browser_restore_private_tab_os.js b/browser/components/sessionstore/test/browser_restore_private_tab_os.js index 655ffe48e8e35..feecfe327a84a 100644 --- a/browser/components/sessionstore/test/browser_restore_private_tab_os.js +++ b/browser/components/sessionstore/test/browser_restore_private_tab_os.js @@ -8,7 +8,7 @@ const TEST_URI = "https://example.com/" + "browser/browser/components/sessionstore/test/empty.html"; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ // Set the pref to true so we know exactly how many tabs should be restoring at diff --git a/browser/components/sessionstore/test/browser_restore_reversed_z_order.js b/browser/components/sessionstore/test/browser_restore_reversed_z_order.js index 6cb4964c13dae..298f8ccaab79d 100644 --- a/browser/components/sessionstore/test/browser_restore_reversed_z_order.js +++ b/browser/components/sessionstore/test/browser_restore_reversed_z_order.js @@ -10,7 +10,7 @@ let gTestURLsMap = new Map([ ]); let gBrowserState; -add_task(async function setup() { +add_setup(async function() { let windows = []; let count = 0; for (let url of gTestURLsMap.keys()) { diff --git a/browser/components/sessionstore/test/browser_revive_crashed_bg_tabs.js b/browser/components/sessionstore/test/browser_revive_crashed_bg_tabs.js index 036ec27bfcfda..08225fa6d67e5 100644 --- a/browser/components/sessionstore/test/browser_revive_crashed_bg_tabs.js +++ b/browser/components/sessionstore/test/browser_revive_crashed_bg_tabs.js @@ -14,7 +14,7 @@ const PAGE_1 = const PAGE_2 = "data:text/html,Another%20regular,%20everyday,%20normal%20page."; -add_task(async function setup() { +add_setup(async function() { await pushPrefs( ["dom.ipc.processCount", 1], ["browser.sessionstore.restore_on_demand", false] diff --git a/browser/components/sessionstore/test/browser_tabs_in_urlbar.js b/browser/components/sessionstore/test/browser_tabs_in_urlbar.js index 2582a25ae2272..08fdaebb8495d 100644 --- a/browser/components/sessionstore/test/browser_tabs_in_urlbar.js +++ b/browser/components/sessionstore/test/browser_tabs_in_urlbar.js @@ -27,7 +27,7 @@ const { UrlbarTestUtils } = ChromeUtils.import( var stateBackup = ss.getBrowserState(); -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ // Set the pref to true so we know exactly how many tabs should be restoring at diff --git a/browser/components/sessionstore/test/browser_windowStateContainer.js b/browser/components/sessionstore/test/browser_windowStateContainer.js index bf255b99c43de..d416fb8e3d06d 100644 --- a/browser/components/sessionstore/test/browser_windowStateContainer.js +++ b/browser/components/sessionstore/test/browser_windowStateContainer.js @@ -2,7 +2,7 @@ requestLongerTimeout(2); -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["dom.ipc.processCount", 1]], }); diff --git a/browser/components/sessionstore/test/unit/test_final_write_cleanup.js b/browser/components/sessionstore/test/unit/test_final_write_cleanup.js index 951a91bb174d6..3660c156c2604 100644 --- a/browser/components/sessionstore/test/unit/test_final_write_cleanup.js +++ b/browser/components/sessionstore/test/unit/test_final_write_cleanup.js @@ -31,7 +31,7 @@ async function prepareWithLimit(back, fwd) { await SessionWriter.wipe(); } -add_task(async function setup() { +add_setup(async function() { registerCleanupFunction(() => SessionWriter.wipe()); }); diff --git a/browser/components/shell/test/unit/test_macOS_showSecurityPreferences.js b/browser/components/shell/test/unit/test_macOS_showSecurityPreferences.js index 69e09db70aaaf..8550f0331a0a0 100644 --- a/browser/components/shell/test/unit/test_macOS_showSecurityPreferences.js +++ b/browser/components/shell/test/unit/test_macOS_showSecurityPreferences.js @@ -15,7 +15,7 @@ function killSystemPreferences() { return process.exitValue; } -add_task(async function setup() { +add_setup(async function() { info("Ensure System Preferences isn't already running"); killSystemPreferences(); }); diff --git a/browser/components/tests/browser/browser_initial_tab_remoteType.js b/browser/components/tests/browser/browser_initial_tab_remoteType.js index 93f5eb682ad71..de486bfeb0dfc 100644 --- a/browser/components/tests/browser/browser_initial_tab_remoteType.js +++ b/browser/components/tests/browser/browser_initial_tab_remoteType.js @@ -99,7 +99,7 @@ function constructOnePageCmdLine(aURL) { ); } -add_task(async function setup() { +add_setup(async function() { NewTabPagePreloading.removePreloadedBrowser(window); await SpecialPowers.pushPrefEnv({ diff --git a/browser/components/translation/test/browser_translation_bing.js b/browser/components/translation/test/browser_translation_bing.js index 741fbd248daf4..8462833888565 100644 --- a/browser/components/translation/test/browser_translation_bing.js +++ b/browser/components/translation/test/browser_translation_bing.js @@ -16,7 +16,7 @@ const { TranslationDocument } = ChromeUtils.import( "resource:///modules/translation/TranslationDocument.jsm" ); -add_task(async function setup() { +add_setup(async function() { Services.prefs.setCharPref(kClientIdPref, "testClient"); Services.prefs.setCharPref(kClientSecretPref, "testSecret"); diff --git a/browser/components/translation/test/browser_translation_telemetry.js b/browser/components/translation/test/browser_translation_telemetry.js index 3af9cd993fc99..768daea7c18be 100644 --- a/browser/components/translation/test/browser_translation_telemetry.js +++ b/browser/components/translation/test/browser_translation_telemetry.js @@ -167,7 +167,7 @@ function simulateUserSelectInMenulist(menulist, value) { menulist.doCommand(); } -add_task(async function setup() { +add_setup(async function() { const setupPrefs = prefs => { let prefsBackup = {}; for (let p of prefs) { diff --git a/browser/components/translation/test/browser_translation_yandex.js b/browser/components/translation/test/browser_translation_yandex.js index fa9559556acb1..723cc5946b2e3 100644 --- a/browser/components/translation/test/browser_translation_yandex.js +++ b/browser/components/translation/test/browser_translation_yandex.js @@ -25,7 +25,7 @@ const { Translation } = ChromeUtils.import( "resource:///modules/translation/TranslationParent.jsm" ); -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ [kEnginePref, "Yandex"], diff --git a/browser/components/uitour/test/browser_UITour_showProtectionReport.js b/browser/components/uitour/test/browser_UITour_showProtectionReport.js index 2c23362b4cfac..78ac10dc2d517 100644 --- a/browser/components/uitour/test/browser_UITour_showProtectionReport.js +++ b/browser/components/uitour/test/browser_UITour_showProtectionReport.js @@ -8,7 +8,7 @@ var gContentAPI; add_task(setup_UITourTest); -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.contentblocking.database.enabled", false], diff --git a/browser/components/uitour/test/browser_UITour_sync.js b/browser/components/uitour/test/browser_UITour_sync.js index 9859853ef1571..59abcb0d791c0 100644 --- a/browser/components/uitour/test/browser_UITour_sync.js +++ b/browser/components/uitour/test/browser_UITour_sync.js @@ -15,7 +15,7 @@ registerCleanupFunction(function() { add_task(setup_UITourTest); -add_task(async function setup() { +add_setup(async function() { Services.prefs.setCharPref( "identity.fxaccounts.remote.root", "https://example.com" diff --git a/browser/components/urlbar/tests/browser/browser_action_searchengine.js b/browser/components/urlbar/tests/browser/browser_action_searchengine.js index 18d77cef15b42..70c65fa4abeef 100644 --- a/browser/components/urlbar/tests/browser/browser_action_searchengine.js +++ b/browser/components/urlbar/tests/browser/browser_action_searchengine.js @@ -6,7 +6,7 @@ * expected URL for the engine. */ -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.search.separatePrivateDefault.ui.enabled", true], diff --git a/browser/components/urlbar/tests/browser/browser_autoFill_trimURLs.js b/browser/components/urlbar/tests/browser/browser_autoFill_trimURLs.js index 1d4b8056819bc..b33ca5c4555d7 100644 --- a/browser/components/urlbar/tests/browser/browser_autoFill_trimURLs.js +++ b/browser/components/urlbar/tests/browser/browser_autoFill_trimURLs.js @@ -6,7 +6,7 @@ "use strict"; -add_task(async function setup() { +add_setup(async function() { const PREF_TRIMURL = "browser.urlbar.trimURLs"; const PREF_AUTOFILL = "browser.urlbar.autoFill"; diff --git a/browser/components/urlbar/tests/browser/browser_autocomplete_enter_race.js b/browser/components/urlbar/tests/browser/browser_autocomplete_enter_race.js index 10318620ddb2b..2c725d2cffb4d 100644 --- a/browser/components/urlbar/tests/browser/browser_autocomplete_enter_race.js +++ b/browser/components/urlbar/tests/browser/browser_autocomplete_enter_race.js @@ -9,7 +9,7 @@ // The order of these tests matters! -add_task(async function setup() { +add_setup(async function() { let bm = await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid, url: "http://example.com/?q=%s", diff --git a/browser/components/urlbar/tests/browser/browser_edit_invalid_url.js b/browser/components/urlbar/tests/browser/browser_edit_invalid_url.js index a74196a129eb5..31ac70672d7b7 100644 --- a/browser/components/urlbar/tests/browser/browser_edit_invalid_url.js +++ b/browser/components/urlbar/tests/browser/browser_edit_invalid_url.js @@ -7,7 +7,7 @@ const url = BrowserUIUtils.trimURLProtocol + "invalid.somehost/mytest"; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["browser.urlbar.trimURLs", true]], }); diff --git a/browser/components/urlbar/tests/browser/browser_enter.js b/browser/components/urlbar/tests/browser/browser_enter.js index 439496bd9bde9..252e4ee5eade0 100644 --- a/browser/components/urlbar/tests/browser/browser_enter.js +++ b/browser/components/urlbar/tests/browser/browser_enter.js @@ -6,7 +6,7 @@ const TEST_VALUE = "example.com/\xF7?\xF7"; const START_VALUE = "example.com/%C3%B7?%C3%B7"; -add_task(async function setup() { +add_setup(async function() { const engine = await SearchTestUtils.promiseNewSearchEngine( getRootDirectory(gTestPath) + "searchSuggestionEngine.xml" ); diff --git a/browser/components/urlbar/tests/browser/browser_inputHistory.js b/browser/components/urlbar/tests/browser/browser_inputHistory.js index 3974da3d2c80b..e6af195b36bc3 100644 --- a/browser/components/urlbar/tests/browser/browser_inputHistory.js +++ b/browser/components/urlbar/tests/browser/browser_inputHistory.js @@ -53,7 +53,7 @@ async function decayInputHistory() { await PlacesTestUtils.promiseAsyncUpdates(); } -add_task(async function setup() { +add_setup(async function() { // Use new window to avoid timeout failure for autocomplete popup happens on Linux TV. win = await BrowserTestUtils.openNewBrowserWindow(); diff --git a/browser/components/urlbar/tests/browser/browser_inputHistory_emptystring.js b/browser/components/urlbar/tests/browser/browser_inputHistory_emptystring.js index 8fc44329ff78d..607de4065223c 100644 --- a/browser/components/urlbar/tests/browser/browser_inputHistory_emptystring.js +++ b/browser/components/urlbar/tests/browser/browser_inputHistory_emptystring.js @@ -56,7 +56,7 @@ async function do_test(openFn, pickMethod) { ); } -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.history.clear(); for (let i = 0; i < 5; i++) { await PlacesTestUtils.addVisits(TEST_URL); diff --git a/browser/components/urlbar/tests/browser/browser_keyword.js b/browser/components/urlbar/tests/browser/browser_keyword.js index 8b6d84ec396fe..f8f2d66f71166 100644 --- a/browser/components/urlbar/tests/browser/browser_keyword.js +++ b/browser/components/urlbar/tests/browser/browser_keyword.js @@ -32,7 +32,7 @@ function assertURL(result, expectedUrl, keyword, input, postData) { const TEST_URL = `${TEST_BASE_URL}print_postdata.sjs`; -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.keywords.insert({ keyword: "get", url: TEST_URL + "?q=%s", diff --git a/browser/components/urlbar/tests/browser/browser_keywordBookmarklets.js b/browser/components/urlbar/tests/browser/browser_keywordBookmarklets.js index 97220fc2682d6..1f9465a08fcb5 100644 --- a/browser/components/urlbar/tests/browser/browser_keywordBookmarklets.js +++ b/browser/components/urlbar/tests/browser/browser_keywordBookmarklets.js @@ -3,7 +3,7 @@ "use strict"; -add_task(async function setup() { +add_setup(async function() { let bm = await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid, title: "bookmarklet", diff --git a/browser/components/urlbar/tests/browser/browser_keywordSearch.js b/browser/components/urlbar/tests/browser/browser_keywordSearch.js index 5ba5805589cf1..47eafeed4b2f6 100644 --- a/browser/components/urlbar/tests/browser/browser_keywordSearch.js +++ b/browser/components/urlbar/tests/browser/browser_keywordSearch.js @@ -16,7 +16,7 @@ var gTests = [ }, ]; -add_task(async function setup() { +add_setup(async function() { let engine = await SearchTestUtils.promiseNewSearchEngine( getRootDirectory(gTestPath) + "searchSuggestionEngine.xml" ); diff --git a/browser/components/urlbar/tests/browser/browser_keywordSearch_postData.js b/browser/components/urlbar/tests/browser/browser_keywordSearch_postData.js index 8484cd778dfdb..d7bce19165b02 100644 --- a/browser/components/urlbar/tests/browser/browser_keywordSearch_postData.js +++ b/browser/components/urlbar/tests/browser/browser_keywordSearch_postData.js @@ -21,7 +21,7 @@ var gTests = [ }, ]; -add_task(async function setup() { +add_setup(async function() { let engine = await SearchTestUtils.promiseNewSearchEngine( getRootDirectory(gTestPath) + "POSTSearchEngine.xml" ); diff --git a/browser/components/urlbar/tests/browser/browser_loadRace.js b/browser/components/urlbar/tests/browser/browser_loadRace.js index 4e1e48e5d6578..db9b46905c5bf 100644 --- a/browser/components/urlbar/tests/browser/browser_loadRace.js +++ b/browser/components/urlbar/tests/browser/browser_loadRace.js @@ -7,7 +7,7 @@ // a page load whilst we're getting the search url, then we don't handle the // original search query. -add_task(async function setup() { +add_setup(async function() { sandbox = sinon.createSandbox(); registerCleanupFunction(async () => { diff --git a/browser/components/urlbar/tests/browser/browser_locationBarCommand.js b/browser/components/urlbar/tests/browser/browser_locationBarCommand.js index aeffac30456ab..a611a3d15b8ab 100644 --- a/browser/components/urlbar/tests/browser/browser_locationBarCommand.js +++ b/browser/components/urlbar/tests/browser/browser_locationBarCommand.js @@ -9,7 +9,7 @@ const TEST_VALUE = "example.com"; const START_VALUE = "example.org"; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.altClickSave", true], diff --git a/browser/components/urlbar/tests/browser/browser_paste_multi_lines.js b/browser/components/urlbar/tests/browser/browser_paste_multi_lines.js index 046e27b78ed3f..c50504c29a456 100644 --- a/browser/components/urlbar/tests/browser/browser_paste_multi_lines.js +++ b/browser/components/urlbar/tests/browser/browser_paste_multi_lines.js @@ -120,7 +120,7 @@ const TEST_DATA = [ }, ]; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ // There are cases that URLBar loses focus before assertion of this test. diff --git a/browser/components/urlbar/tests/browser/browser_placeholder.js b/browser/components/urlbar/tests/browser/browser_placeholder.js index 95b85bb7640c4..7c0b9883e7351 100644 --- a/browser/components/urlbar/tests/browser/browser_placeholder.js +++ b/browser/components/urlbar/tests/browser/browser_placeholder.js @@ -13,7 +13,7 @@ var tabs = []; var noEngineString; -add_task(async function setup() { +add_setup(async function() { originalEngine = await Services.search.getDefault(); [noEngineString, expectedString] = ( await document.l10n.formatMessages([ diff --git a/browser/components/urlbar/tests/browser/browser_remotetab.js b/browser/components/urlbar/tests/browser/browser_remotetab.js index e985e274e1f26..c76a2508466e5 100644 --- a/browser/components/urlbar/tests/browser/browser_remotetab.js +++ b/browser/components/urlbar/tests/browser/browser_remotetab.js @@ -32,7 +32,7 @@ const REMOTE_TAB = { ], }; -add_task(async function setup() { +add_setup(async function() { sandbox = sinon.createSandbox(); let originalSyncedTabsInternal = SyncedTabs._internal; diff --git a/browser/components/urlbar/tests/browser/browser_remove_match.js b/browser/components/urlbar/tests/browser/browser_remove_match.js index b377c0a230679..69fde8aba66fc 100644 --- a/browser/components/urlbar/tests/browser/browser_remove_match.js +++ b/browser/components/urlbar/tests/browser/browser_remove_match.js @@ -5,7 +5,7 @@ XPCOMUtils.defineLazyModuleGetters(this, { FormHistory: "resource://gre/modules/FormHistory.jsm", }); -add_task(async function setup() { +add_setup(async function() { await SearchTestUtils.installSearchExtension(); let engine = Services.search.getEngineByName("Example"); diff --git a/browser/components/urlbar/tests/browser/browser_retainedResultsOnFocus.js b/browser/components/urlbar/tests/browser/browser_retainedResultsOnFocus.js index c990e30a6c4e4..a82b24810efde 100644 --- a/browser/components/urlbar/tests/browser/browser_retainedResultsOnFocus.js +++ b/browser/components/urlbar/tests/browser/browser_retainedResultsOnFocus.js @@ -69,7 +69,7 @@ async function checkDoesNotOpenOnFocus(win) { await promiseState; } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["browser.urlbar.autoFill", true]], }); diff --git a/browser/components/urlbar/tests/browser/browser_searchHistoryLimit.js b/browser/components/urlbar/tests/browser/browser_searchHistoryLimit.js index 02c129e164fd0..8a39fc5261125 100644 --- a/browser/components/urlbar/tests/browser/browser_searchHistoryLimit.js +++ b/browser/components/urlbar/tests/browser/browser_searchHistoryLimit.js @@ -15,7 +15,7 @@ const { SearchSuggestionController } = ChromeUtils.import( let gEngine; -add_task(async function setup() { +add_setup(async function() { await SearchTestUtils.installSearchExtension(); gEngine = Services.search.getEngineByName("Example"); let oldDefaultEngine = await Services.search.getDefault(); diff --git a/browser/components/urlbar/tests/browser/browser_searchMode_alias_replacement.js b/browser/components/urlbar/tests/browser/browser_searchMode_alias_replacement.js index 397b7585f22ad..7cdb2f2a8f3a6 100644 --- a/browser/components/urlbar/tests/browser/browser_searchMode_alias_replacement.js +++ b/browser/components/urlbar/tests/browser/browser_searchMode_alias_replacement.js @@ -18,7 +18,7 @@ const TEST_SPACES = [" ", "\u3000", " \u3000", "\u3000 "]; let defaultEngine, aliasEngine; -add_task(async function setup() { +add_setup(async function() { defaultEngine = await SearchTestUtils.promiseNewSearchEngine( getRootDirectory(gTestPath) + TEST_ENGINE_BASENAME ); diff --git a/browser/components/urlbar/tests/browser/browser_searchMode_autofill.js b/browser/components/urlbar/tests/browser/browser_searchMode_autofill.js index 037cbcfd8aa76..36838e8f5834a 100644 --- a/browser/components/urlbar/tests/browser/browser_searchMode_autofill.js +++ b/browser/components/urlbar/tests/browser/browser_searchMode_autofill.js @@ -8,7 +8,7 @@ "use strict"; -add_task(async function setup() { +add_setup(async function() { for (let i = 0; i < 5; i++) { await PlacesTestUtils.addVisits([{ uri: "http://example.com/" }]); } diff --git a/browser/components/urlbar/tests/browser/browser_searchMode_excludeResults.js b/browser/components/urlbar/tests/browser/browser_searchMode_excludeResults.js index 8063c991ff879..9ea58d9e5686b 100644 --- a/browser/components/urlbar/tests/browser/browser_searchMode_excludeResults.js +++ b/browser/components/urlbar/tests/browser/browser_searchMode_excludeResults.js @@ -12,7 +12,7 @@ XPCOMUtils.defineLazyModuleGetters(this, { SyncedTabs: "resource://services-sync/SyncedTabs.jsm", }); -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.urlbar.suggest.searches", false], diff --git a/browser/components/urlbar/tests/browser/browser_searchMode_heuristic.js b/browser/components/urlbar/tests/browser/browser_searchMode_heuristic.js index bb2ec593f711a..7cf7942b42ef9 100644 --- a/browser/components/urlbar/tests/browser/browser_searchMode_heuristic.js +++ b/browser/components/urlbar/tests/browser/browser_searchMode_heuristic.js @@ -7,7 +7,7 @@ "use strict"; -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.history.clear(); await PlacesUtils.bookmarks.eraseEverything(); diff --git a/browser/components/urlbar/tests/browser/browser_searchMode_indicator.js b/browser/components/urlbar/tests/browser/browser_searchMode_indicator.js index 7b8defc4d2daf..b4a755b95a8a6 100644 --- a/browser/components/urlbar/tests/browser/browser_searchMode_indicator.js +++ b/browser/components/urlbar/tests/browser/browser_searchMode_indicator.js @@ -22,7 +22,7 @@ const TOP_SITES_URLS = [ let suggestionsEngine; let defaultEngine; -add_task(async function setup() { +add_setup(async function() { suggestionsEngine = await SearchTestUtils.promiseNewSearchEngine( getRootDirectory(gTestPath) + SUGGESTIONS_ENGINE_NAME ); diff --git a/browser/components/urlbar/tests/browser/browser_searchMode_localOneOffs_actionText.js b/browser/components/urlbar/tests/browser/browser_searchMode_localOneOffs_actionText.js index c4c5f271c2b5f..705734d66025b 100644 --- a/browser/components/urlbar/tests/browser/browser_searchMode_localOneOffs_actionText.js +++ b/browser/components/urlbar/tests/browser/browser_searchMode_localOneOffs_actionText.js @@ -13,7 +13,7 @@ const SUGGESTIONS_ENGINE_NAME = "searchSuggestionEngine.xml"; let engine; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["browser.urlbar.suggest.searches", true]], }); diff --git a/browser/components/urlbar/tests/browser/browser_searchMode_no_results.js b/browser/components/urlbar/tests/browser/browser_searchMode_no_results.js index 96da1d97218fd..fc2950051af32 100644 --- a/browser/components/urlbar/tests/browser/browser_searchMode_no_results.js +++ b/browser/components/urlbar/tests/browser/browser_searchMode_no_results.js @@ -9,7 +9,7 @@ const TEST_ENGINE_BASENAME = "searchSuggestionEngine.xml"; -add_task(async function setup() { +add_setup(async function() { // In order to open the view without any results, we need to be in search mode // with an empty search string so that no heuristic result is shown, and the // empty search must yield zero additional results. We'll enter search mode diff --git a/browser/components/urlbar/tests/browser/browser_searchMode_oneOffButton.js b/browser/components/urlbar/tests/browser/browser_searchMode_oneOffButton.js index 1be595aadcf82..ae2e45bfed9e9 100644 --- a/browser/components/urlbar/tests/browser/browser_searchMode_oneOffButton.js +++ b/browser/components/urlbar/tests/browser/browser_searchMode_oneOffButton.js @@ -9,7 +9,7 @@ const TEST_ENGINE_NAME = "test engine"; -add_task(async function setup() { +add_setup(async function() { await SearchTestUtils.installSearchExtension({ name: TEST_ENGINE_NAME, keyword: "@test", diff --git a/browser/components/urlbar/tests/browser/browser_searchMode_pickResult.js b/browser/components/urlbar/tests/browser/browser_searchMode_pickResult.js index 98416ee10663f..97b58c5cafd5f 100644 --- a/browser/components/urlbar/tests/browser/browser_searchMode_pickResult.js +++ b/browser/components/urlbar/tests/browser/browser_searchMode_pickResult.js @@ -9,7 +9,7 @@ const BOOKMARK_URL = "http://www.example.com/browser_searchMode_pickResult.js"; -add_task(async function setup() { +add_setup(async function() { // Add a bookmark so we can enter bookmarks search mode and pick it. await PlacesUtils.bookmarks.eraseEverything(); await PlacesUtils.bookmarks.insert({ diff --git a/browser/components/urlbar/tests/browser/browser_searchMode_preview.js b/browser/components/urlbar/tests/browser/browser_searchMode_preview.js index 7ffc0868f5f76..2e9152bf20469 100644 --- a/browser/components/urlbar/tests/browser/browser_searchMode_preview.js +++ b/browser/components/urlbar/tests/browser/browser_searchMode_preview.js @@ -11,7 +11,7 @@ const TEST_ENGINE_NAME = "Test"; let win; -add_task(async function setup() { +add_setup(async function() { win = await BrowserTestUtils.openNewBrowserWindow(); await SearchTestUtils.installSearchExtension({ diff --git a/browser/components/urlbar/tests/browser/browser_searchMode_suggestions.js b/browser/components/urlbar/tests/browser/browser_searchMode_suggestions.js index 86fc1ddff1a01..f7b6fabf54abb 100644 --- a/browser/components/urlbar/tests/browser/browser_searchMode_suggestions.js +++ b/browser/components/urlbar/tests/browser/browser_searchMode_suggestions.js @@ -15,7 +15,7 @@ const MAX_RESULT_COUNT = UrlbarPrefs.get("maxRichResults"); let suggestionsEngine; let expectedFormHistoryResults = []; -add_task(async function setup() { +add_setup(async function() { suggestionsEngine = await SearchTestUtils.promiseNewSearchEngine( getRootDirectory(gTestPath) + SUGGESTIONS_ENGINE_NAME ); diff --git a/browser/components/urlbar/tests/browser/browser_searchSingleWordNotification.js b/browser/components/urlbar/tests/browser/browser_searchSingleWordNotification.js index 0ee9f771ea182..47225e614b53b 100644 --- a/browser/components/urlbar/tests/browser/browser_searchSingleWordNotification.js +++ b/browser/components/urlbar/tests/browser/browser_searchSingleWordNotification.js @@ -3,7 +3,7 @@ let gDNSResolved = false; let gRealDNSService = gDNSService; -add_task(async function setup() { +add_setup(async function() { gDNSService = { asyncResolve() { gDNSResolved = true; diff --git a/browser/components/urlbar/tests/browser/browser_separatePrivateDefault.js b/browser/components/urlbar/tests/browser/browser_separatePrivateDefault.js index 5f6a709e4ef3e..ba5b99f0b8dab 100644 --- a/browser/components/urlbar/tests/browser/browser_separatePrivateDefault.js +++ b/browser/components/urlbar/tests/browser/browser_separatePrivateDefault.js @@ -13,7 +13,7 @@ const serverInfo = { port: 20709, // Must be identical to what is in searchSuggestionEngine2.xml }; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.search.separatePrivateDefault.ui.enabled", true], diff --git a/browser/components/urlbar/tests/browser/browser_separatePrivateDefault_differentEngine.js b/browser/components/urlbar/tests/browser/browser_separatePrivateDefault_differentEngine.js index d422e6191461f..ca6216be98e61 100644 --- a/browser/components/urlbar/tests/browser/browser_separatePrivateDefault_differentEngine.js +++ b/browser/components/urlbar/tests/browser/browser_separatePrivateDefault_differentEngine.js @@ -14,7 +14,7 @@ const serverInfo = { let gAliasEngine; let gPrivateEngine; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.search.separatePrivateDefault.ui.enabled", true], diff --git a/browser/components/urlbar/tests/browser/browser_shortcuts_add_search_engine.js b/browser/components/urlbar/tests/browser/browser_shortcuts_add_search_engine.js index 1d950f00759b1..717518ed42199 100644 --- a/browser/components/urlbar/tests/browser/browser_shortcuts_add_search_engine.js +++ b/browser/components/urlbar/tests/browser/browser_shortcuts_add_search_engine.js @@ -13,7 +13,7 @@ const { PromptTestUtils } = ChromeUtils.import( const BASE_URL = "http://mochi.test:8888/browser/browser/components/urlbar/tests/browser/"; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["browser.urlbar.suggest.searches", false]], }); diff --git a/browser/components/urlbar/tests/browser/browser_speculative_connect.js b/browser/components/urlbar/tests/browser/browser_speculative_connect.js index 2b4d132812442..1af1c18bb93fd 100644 --- a/browser/components/urlbar/tests/browser/browser_speculative_connect.js +++ b/browser/components/urlbar/tests/browser/browser_speculative_connect.js @@ -17,7 +17,7 @@ const serverInfo = { port: 20709, // Must be identical to what is in searchSuggestionEngine2.xml }; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.urlbar.autoFill", true], diff --git a/browser/components/urlbar/tests/browser/browser_speculative_connect_not_with_client_cert.js b/browser/components/urlbar/tests/browser/browser_speculative_connect_not_with_client_cert.js index 0dc7e2667214c..72b9130699a47 100644 --- a/browser/components/urlbar/tests/browser/browser_speculative_connect_not_with_client_cert.js +++ b/browser/components/urlbar/tests/browser/browser_speculative_connect_not_with_client_cert.js @@ -118,7 +118,7 @@ function startServer(cert) { let server; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.urlbar.autoFill", true], diff --git a/browser/components/urlbar/tests/browser/browser_suppressFocusBorder.js b/browser/components/urlbar/tests/browser/browser_suppressFocusBorder.js index c29cd56d80bb9..20038d837ceb6 100644 --- a/browser/components/urlbar/tests/browser/browser_suppressFocusBorder.js +++ b/browser/components/urlbar/tests/browser/browser_suppressFocusBorder.js @@ -37,7 +37,7 @@ class AwaitPromiseProvider extends UrlbarTestUtils.TestProvider { } } -add_task(async function setup() { +add_setup(async function() { await SearchTestUtils.installSearchExtension(); let engine = Services.search.getEngineByName("Example"); let oldDefaultEngine = Services.search.defaultEngine; diff --git a/browser/components/urlbar/tests/browser/browser_switchTab_inputHistory.js b/browser/components/urlbar/tests/browser/browser_switchTab_inputHistory.js index 4110ff0b38df1..943a8eb050e65 100644 --- a/browser/components/urlbar/tests/browser/browser_switchTab_inputHistory.js +++ b/browser/components/urlbar/tests/browser/browser_switchTab_inputHistory.js @@ -8,7 +8,7 @@ "use strict"; -add_task(async function setup() { +add_setup(async function() { registerCleanupFunction(async () => { await PlacesUtils.history.clear(); }); diff --git a/browser/components/urlbar/tests/browser/browser_tabToSearch.js b/browser/components/urlbar/tests/browser/browser_tabToSearch.js index 5bff9c1054bdb..93f38b089e57e 100644 --- a/browser/components/urlbar/tests/browser/browser_tabToSearch.js +++ b/browser/components/urlbar/tests/browser/browser_tabToSearch.js @@ -18,7 +18,7 @@ XPCOMUtils.defineLazyModuleGetters(this, { "resource:///modules/UrlbarProviderTabToSearch.jsm", }); -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.history.clear(); await SpecialPowers.pushPrefEnv({ set: [ diff --git a/browser/components/urlbar/tests/browser/browser_typed_value.js b/browser/components/urlbar/tests/browser/browser_typed_value.js index a01ee3e08eef9..cd3b107e0859a 100644 --- a/browser/components/urlbar/tests/browser/browser_typed_value.js +++ b/browser/components/urlbar/tests/browser/browser_typed_value.js @@ -5,7 +5,7 @@ "use strict"; -add_task(async function setup() { +add_setup(async function() { registerCleanupFunction(async function() { Services.prefs.clearUserPref("browser.urlbar.autoFill"); gURLBar.handleRevert(); diff --git a/browser/components/urlbar/tests/browser/browser_unitConversion.js b/browser/components/urlbar/tests/browser/browser_unitConversion.js index 7a877ef56dcec..ab057c8241e89 100644 --- a/browser/components/urlbar/tests/browser/browser_unitConversion.js +++ b/browser/components/urlbar/tests/browser/browser_unitConversion.js @@ -7,7 +7,7 @@ * Tests unit conversion on browser. */ -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["browser.urlbar.unitConversion.enabled", true]], }); diff --git a/browser/components/urlbar/tests/browser/browser_urlbar_selection.js b/browser/components/urlbar/tests/browser/browser_urlbar_selection.js index e890ed17cf493..23d942630191a 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbar_selection.js +++ b/browser/components/urlbar/tests/browser/browser_urlbar_selection.js @@ -82,7 +82,7 @@ function checkPrimarySelection(expectedVal = "") { } } -add_task(async function setup() { +add_setup(async function() { // On macOS, we must "warm up" the Urlbar to get the first test to pass. gURLBar.value = ""; await click(gURLBar.inputField); diff --git a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry.js b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry.js index f6eb0fb407554..5682426fe7943 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry.js +++ b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry.js @@ -86,7 +86,7 @@ async function withNewSearchEngine(taskFn) { } } -add_task(async function setup() { +add_setup(async function() { await SearchTestUtils.installSearchExtension({ name: "MozSearch", keyword: "mozalias", diff --git a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_extension.js b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_extension.js index 19bebf8918194..2e728fff55712 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_extension.js +++ b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_extension.js @@ -94,7 +94,7 @@ function assertTelemetryResults(histograms, type, index, method) { ); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ // Disable search suggestions in the urlbar. diff --git a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_handoff.js b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_handoff.js index 234e4b90f38e7..97b9d454839f8 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_handoff.js +++ b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_handoff.js @@ -33,7 +33,7 @@ async function waitForIdle() { } } -add_task(async function setup() { +add_setup(async function() { SearchSERPTelemetry.overrideSearchTelemetryForTests(TEST_PROVIDER_INFO); await waitForIdle(); diff --git a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_places.js b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_places.js index ed69500afc468..800db9f4dc264 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_places.js +++ b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_places.js @@ -109,7 +109,7 @@ function assertTelemetryResults(histograms, type, index, method) { ); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ // Disable search suggestions in the urlbar. diff --git a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_remotetab.js b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_remotetab.js index 38585316c1c97..886e372ee1e28 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_remotetab.js +++ b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_remotetab.js @@ -95,7 +95,7 @@ function assertTelemetryResults(histograms, type, index, method) { ); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ // Disable search suggestions in the urlbar. diff --git a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_searchmode.js b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_searchmode.js index 0b2f047f1b852..c3fdca3ffc1d1 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_searchmode.js +++ b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_searchmode.js @@ -82,7 +82,7 @@ function assertSearchModeScalars(entry, engineOrSource, resultIndex = -1) { Services.telemetry.clearEvents(); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ // Disable tab-to-search onboarding results for general tests. They are diff --git a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_sponsored_topsites.js b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_sponsored_topsites.js index 8d580abb78d73..71a7ceaa51c4c 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_sponsored_topsites.js +++ b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_sponsored_topsites.js @@ -26,7 +26,7 @@ function submitHandler(request, response) { // Spy for telemetry sender let spy; -add_task(async function setup() { +add_setup(async function() { sandbox = sinon.createSandbox(); spy = sandbox.spy( PartnerLinkAttribution._pingCentre, diff --git a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_tabtosearch.js b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_tabtosearch.js index f50d6f4a7cc88..d69e1b1f62357 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_tabtosearch.js +++ b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_tabtosearch.js @@ -103,7 +103,7 @@ async function checkForTabToSearchResult(engineName, isOnboarding) { } } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["browser.urlbar.tabToSearch.onboard.interactionsLeft", 0]], }); diff --git a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_tip.js b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_tip.js index a23fffdb3fafc..74770844b2893 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_tip.js +++ b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_tip.js @@ -61,7 +61,7 @@ function assertTelemetryResults(histograms, type, index, method) { ); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ // Disable search suggestions in the urlbar. diff --git a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_topsite.js b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_topsite.js index 352e08cf8f5a5..6759b2cffbf92 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_topsite.js +++ b/browser/components/urlbar/tests/browser/browser_urlbar_telemetry_topsite.js @@ -89,7 +89,7 @@ async function updateTopSites(condition, searchShortcuts = false) { }, "Waiting for top sites to be updated"); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.urlbar.suggest.topsites", true], diff --git a/browser/components/urlbar/tests/browser/browser_view_resultDisplay.js b/browser/components/urlbar/tests/browser/browser_view_resultDisplay.js index 63de1909355d0..1cf6d3be29769 100644 --- a/browser/components/urlbar/tests/browser/browser_view_resultDisplay.js +++ b/browser/components/urlbar/tests/browser/browser_view_resultDisplay.js @@ -8,7 +8,7 @@ * we expect them to be. */ -add_task(async function setup() { +add_setup(async function() { await PlacesUtils.history.clear(); registerCleanupFunction(async function() { diff --git a/browser/components/urlbar/tests/browser/browser_view_resultTypes_display.js b/browser/components/urlbar/tests/browser/browser_view_resultTypes_display.js index 05d5de2408d51..e2d150d74f12a 100644 --- a/browser/components/urlbar/tests/browser/browser_view_resultTypes_display.js +++ b/browser/components/urlbar/tests/browser/browser_view_resultTypes_display.js @@ -30,7 +30,7 @@ function assertElementsDisplayed(details, expected) { ); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.urlbar.suggest.searches", false], diff --git a/browser/components/urlbar/tests/quicksuggest/browser/browser_quicksuggest_onboardingDialog.js b/browser/components/urlbar/tests/quicksuggest/browser/browser_quicksuggest_onboardingDialog.js index 07c0fd67487c9..f3eda4b651f17 100644 --- a/browser/components/urlbar/tests/quicksuggest/browser/browser_quicksuggest_onboardingDialog.js +++ b/browser/components/urlbar/tests/quicksuggest/browser/browser_quicksuggest_onboardingDialog.js @@ -32,7 +32,7 @@ if (AppConstants.platform == "macosx") { // Whether the tab key can move the focus. On macOS with full keyboard access // disabled (which is default), this will be false. See `canTabMoveFocus`. let gCanTabMoveFocus; -add_task(async function setup() { +add_setup(async function() { gCanTabMoveFocus = await canTabMoveFocus(); }); diff --git a/browser/extensions/formautofill/test/browser/creditCard/browser_editCreditCardDialog.js b/browser/extensions/formautofill/test/browser/creditCard/browser_editCreditCardDialog.js index e724ee4e2918f..7d2e081a73111 100644 --- a/browser/extensions/formautofill/test/browser/creditCard/browser_editCreditCardDialog.js +++ b/browser/extensions/formautofill/test/browser/creditCard/browser_editCreditCardDialog.js @@ -2,7 +2,7 @@ "use strict"; -add_task(async function setup() { +add_setup(async function() { let { formAutofillStorage } = ChromeUtils.import( "resource://autofill/FormAutofillStorage.jsm" ); diff --git a/browser/extensions/formautofill/test/browser/head.js b/browser/extensions/formautofill/test/browser/head.js index 709f6b904a401..7bee7b7dc8fd6 100644 --- a/browser/extensions/formautofill/test/browser/head.js +++ b/browser/extensions/formautofill/test/browser/head.js @@ -732,7 +732,7 @@ async function testDialog(url, testFn, arg = undefined) { return unloadPromise; } -add_task(function setup() { +add_setup(function() { OSKeyStoreTestUtils.setup(); }); diff --git a/browser/extensions/search-detection/tests/browser/browser_client_side_redirection.js b/browser/extensions/search-detection/tests/browser/browser_client_side_redirection.js index 13720926ed626..05cc207f436a0 100644 --- a/browser/extensions/search-detection/tests/browser/browser_client_side_redirection.js +++ b/browser/extensions/search-detection/tests/browser/browser_client_side_redirection.js @@ -78,7 +78,7 @@ async function testClientSideRedirect({ ); } -add_task(async function setup() { +add_setup(async function() { const searchEngineName = "test search engine"; let searchEngine; diff --git a/browser/extensions/webcompat/tests/browser/browser_shims.js b/browser/extensions/webcompat/tests/browser/browser_shims.js index cd07bb7390eed..87604c0a6fd81 100644 --- a/browser/extensions/webcompat/tests/browser/browser_shims.js +++ b/browser/extensions/webcompat/tests/browser/browser_shims.js @@ -5,7 +5,7 @@ registerCleanupFunction(() => { Services.prefs.clearUserPref(TRACKING_PREF); }); -add_task(async function setup() { +add_setup(async function() { await UrlClassifierTestUtils.addTestTrackers(); }); diff --git a/browser/modules/test/browser/browser_ContentSearch.js b/browser/modules/test/browser/browser_ContentSearch.js index a3c26cbff1fba..adb26cf7e6eff 100644 --- a/browser/modules/test/browser/browser_ContentSearch.js +++ b/browser/modules/test/browser/browser_ContentSearch.js @@ -30,7 +30,7 @@ function sendEventToContent(browser, data) { ); } -add_task(async function setup() { +add_setup(async function() { const originalEngine = await Services.search.getDefault(); const originalPrivateEngine = await Services.search.getDefaultPrivate(); diff --git a/browser/modules/test/browser/browser_PartnerLinkAttribution.js b/browser/modules/test/browser/browser_PartnerLinkAttribution.js index 1f27bcba8b800..b9732798ade28 100644 --- a/browser/modules/test/browser/browser_PartnerLinkAttribution.js +++ b/browser/modules/test/browser/browser_PartnerLinkAttribution.js @@ -36,7 +36,7 @@ function submitHandler(request, response) { response.setStatusLine(request.httpVersion, 200, "Ok"); } -add_task(async function setup() { +add_setup(async function() { // Ensure the initial init is complete. await Services.search.init(); diff --git a/browser/modules/test/browser/browser_ProcessHangNotifications.js b/browser/modules/test/browser/browser_ProcessHangNotifications.js index 44aa98b64680d..f0a770407d141 100644 --- a/browser/modules/test/browser/browser_ProcessHangNotifications.js +++ b/browser/modules/test/browser/browser_ProcessHangNotifications.js @@ -106,7 +106,7 @@ TestHangReport.prototype = { // on dev edition we add a button for js debugging of hung scripts. let buttonCount = AppConstants.MOZ_DEV_EDITION ? 2 : 1; -add_task(async function setup() { +add_setup(async function() { // Create a fake WebExtensionPolicy that we can use for // the add-on hang notification. const uuidGen = Services.uuid; diff --git a/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js b/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js index c3a613b04a218..40a6dbd1113df 100644 --- a/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js +++ b/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js @@ -197,7 +197,7 @@ function waitForIgnoredReports(reportIDs) { return Promise.all(promises); } -add_task(async function setup() { +add_setup(async function() { // Pending crash reports are stored in the UAppData folder, // which exists outside of the profile folder. In order to // not overwrite / clear pending crash reports for the poor diff --git a/devtools/client/performance-new/test/browser/browser_split-toolbar-button.js b/devtools/client/performance-new/test/browser/browser_split-toolbar-button.js index f923675370376..cb38e675e9f57 100644 --- a/devtools/client/performance-new/test/browser/browser_split-toolbar-button.js +++ b/devtools/client/performance-new/test/browser/browser_split-toolbar-button.js @@ -39,7 +39,7 @@ async function waitForProfileAndCloseTab() { var button; var dropmarker; -add_task(async function setup() { +add_setup(async function() { info( "Add the profiler button to the toolbar and ensure capturing a profile loads a local url." ); diff --git a/devtools/server/tests/browser/browser_animation_actor-lifetime.js b/devtools/server/tests/browser/browser_animation_actor-lifetime.js index c8c4fce119eaf..3e117b263bc48 100644 --- a/devtools/server/tests/browser/browser_animation_actor-lifetime.js +++ b/devtools/server/tests/browser/browser_animation_actor-lifetime.js @@ -5,7 +5,7 @@ // Test for Bug 1247243 -add_task(async function setup() { +add_setup(async function() { info("Setting up inspector and animation actors."); const { animations, walker } = await initAnimationsFrontForUrl( MAIN_DOMAIN + "animation-data.html" diff --git a/devtools/server/tests/browser/browser_inspector-insert.js b/devtools/server/tests/browser/browser_inspector-insert.js index b5b55c2d63b42..c2a5a55b6ed0c 100644 --- a/devtools/server/tests/browser/browser_inspector-insert.js +++ b/devtools/server/tests/browser/browser_inspector-insert.js @@ -3,7 +3,7 @@ "use strict"; -add_task(async function setup() { +add_setup(async function() { const { walker } = await initInspectorFront( MAIN_DOMAIN + "inspector-traversal-data.html" ); diff --git a/docshell/test/browser/browser_data_load_inherit_csp.js b/docshell/test/browser/browser_data_load_inherit_csp.js index 806803d2b5191..17d9ad9e16e23 100644 --- a/docshell/test/browser/browser_data_load_inherit_csp.js +++ b/docshell/test/browser/browser_data_load_inherit_csp.js @@ -35,7 +35,7 @@ function verifyCSP(aTestName, aBrowser, aDataURI) { ); } -add_task(async function setup() { +add_setup(async function() { // allow top level data: URI navigations, otherwise clicking data: link fails await SpecialPowers.pushPrefEnv({ set: [["security.data_uri.block_toplevel_data_uri_navigations", false]], diff --git a/docshell/test/browser/browser_uriFixupIntegration.js b/docshell/test/browser/browser_uriFixupIntegration.js index a2c4e362abe6d..e5530742e101f 100644 --- a/docshell/test/browser/browser_uriFixupIntegration.js +++ b/docshell/test/browser/browser_uriFixupIntegration.js @@ -17,7 +17,7 @@ const kSearchEngineURL = "https://example.com/?search={searchTerms}"; const kPrivateSearchEngineID = "browser_urifixup_search_engine_private"; const kPrivateSearchEngineURL = "https://example.com/?private={searchTerms}"; -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [ ["browser.search.separatePrivateDefault.ui.enabled", true], diff --git a/dom/base/test/browser_promiseDocumentFlushed.js b/dom/base/test/browser_promiseDocumentFlushed.js index 2dbd47cc7d46c..a3fc93cf88f4d 100644 --- a/dom/base/test/browser_promiseDocumentFlushed.js +++ b/dom/base/test/browser_promiseDocumentFlushed.js @@ -64,7 +64,7 @@ async function cleanTheDOM() { await window.promiseDocumentFlushed(() => {}); } -add_task(async function setup() { +add_setup(async function() { registerCleanupFunction(cleanTheDOM); }); diff --git a/dom/base/test/browser_timeout_throttling_with_audio_playback.js b/dom/base/test/browser_timeout_throttling_with_audio_playback.js index 6f952949088e9..c859dd3dc2136 100644 --- a/dom/base/test/browser_timeout_throttling_with_audio_playback.js +++ b/dom/base/test/browser_timeout_throttling_with_audio_playback.js @@ -58,7 +58,7 @@ async function runTest(url) { BrowserTestUtils.removeTab(newTab); } -add_task(async function setup() { +add_setup(async function() { await SpecialPowers.pushPrefEnv({ set: [["dom.min_background_timeout_value", kMinTimeoutBackground]], }); diff --git a/dom/base/test/chrome/test_fileconstructor.xhtml b/dom/base/test/chrome/test_fileconstructor.xhtml index cc4f3f47641ec..709ecad8fab93 100644 --- a/dom/base/test/chrome/test_fileconstructor.xhtml +++ b/dom/base/test/chrome/test_fileconstructor.xhtml @@ -30,6 +30,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=607114.xul /** Test for Bug 607114 **/ +// eslint-disable-next-line mozilla/no-addtask-setup add_task(async function setup() { await SpecialPowers.pushPrefEnv({ set: [[ "dom.file.createInChild", true ]]}); }); diff --git a/dom/events/test/pointerevents/test_multiple_touches.html b/dom/events/test/pointerevents/test_multiple_touches.html index f17d07f137c61..b316c79000d2a 100644 --- a/dom/events/test/pointerevents/test_multiple_touches.html +++ b/dom/events/test/pointerevents/test_multiple_touches.html @@ -129,6 +129,7 @@ return promise; } +// eslint-disable-next-line mozilla/no-addtask-setup add_task(async function setup() { await SimpleTest.promiseFocus(); await SpecialPowers.pushPrefEnv({ diff --git a/dom/html/test/test_bug1322678.html b/dom/html/test/test_bug1322678.html index f05da46d4d731..57b43f039c0bd 100644 --- a/dom/html/test/test_bug1322678.html +++ b/dom/html/test/test_bug1322678.html @@ -72,6 +72,7 @@ }); } +// eslint-disable-next-line mozilla/no-addtask-setup add_task(async function setup() { await SpecialPowers.pushPrefEnv({"set": [ ["browser.enable_automatic_image_resizing", true], diff --git a/dom/html/test/test_inputmode.html b/dom/html/test/test_inputmode.html index f38b2b21302ce..56bb101e8a3af 100644 --- a/dom/html/test/test_inputmode.html +++ b/dom/html/test/test_inputmode.html @@ -44,6 +44,7 @@