Bug 1776576 - Use add_setup in some head.js test files. r?Gijs draft
authorMathew Hodson <mathew.hodson@gmail.com>
Sat, 02 Jul 2022 02:47:57 +0000
changeset 4480214 7aefc07d9898c0ba3ce2367fd4cd1b3f095f973f
parent 4480054 5140fba12e4a4c58953227b0ba20efbefbf8086b
child 4480215 13327199643ff7a60d720b8f918e3f5b726a3b03
push id827490
push userreviewbot
push dateSat, 02 Jul 2022 02:48:24 +0000
treeherdertry@13327199643f [default view] [failures only]
reviewersGijs
bugs1776576
milestone104.0a1
Bug 1776576 - Use add_setup in some head.js test files. r?Gijs Summary: Differential Revision: https://phabricator.services.mozilla.com/D150880 Depends on D150329 Test Plan: Reviewers: Gijs Subscribers: Bug #: 1776576 Differential Diff: PHID-DIFF-cb323stana6mbmsj4jbo
browser/components/resistfingerprinting/test/browser/head.js
browser/components/urlbar/tests/unit/head.js
browser/extensions/formautofill/test/unit/head.js
--- a/browser/components/resistfingerprinting/test/browser/head.js
+++ b/browser/components/resistfingerprinting/test/browser/head.js
@@ -490,17 +490,17 @@ async function testWindowSizeSetting(
 }
 
 class RoundedWindowTest {
   // testOuter is optional.  run() can be invoked with only 1 parameter.
   static run(testCases, testOuter) {
     // "this" is the calling class itself.
     // e.g. when invoked by RoundedWindowTest.run(), "this" is "class RoundedWindowTest".
     let test = new this(testCases);
-    add_task(async () => test.setup());
+    add_setup(async () => test.setup());
     add_task(async () => {
       if (testOuter == undefined) {
         // If testOuter is not given, do tests for both inner and outer.
         await test.doTests(false);
         await test.doTests(true);
       } else {
         await test.doTests(testOuter);
       }
--- a/browser/components/urlbar/tests/unit/head.js
+++ b/browser/components/urlbar/tests/unit/head.js
@@ -326,17 +326,17 @@ async function removeOpenPages(aUri, aCo
 }
 
 /**
  * Helper for tests that generate search results but aren't interested in
  * suggestions, such as autofill tests. Installs a test engine and disables
  * suggestions.
  */
 function testEngine_setup() {
-  add_task(async function setup() {
+  add_setup(async function() {
     await cleanupPlaces();
     let engine = await addTestSuggestionsEngine();
     let oldDefaultEngine = await Services.search.getDefault();
 
     registerCleanupFunction(async () => {
       Services.prefs.clearUserPref("browser.urlbar.suggest.searches");
       Services.prefs.clearUserPref(
         "browser.search.separatePrivateDefault.ui.enabled"
--- a/browser/extensions/formautofill/test/unit/head.js
+++ b/browser/extensions/formautofill/test/unit/head.js
@@ -199,17 +199,17 @@ function verifySectionFieldDetails(secti
     });
   });
 }
 
 var FormAutofillHeuristics, LabelUtils;
 var AddressDataLoader, FormAutofillUtils;
 
 async function runHeuristicsTest(patterns, fixturePathPrefix) {
-  add_task(async function setup() {
+  add_setup(async function() {
     ({ FormAutofillHeuristics } = ChromeUtils.import(
       "resource://autofill/FormAutofillHeuristics.jsm"
     ));
     ({ AddressDataLoader, FormAutofillUtils, LabelUtils } = ChromeUtils.import(
       "resource://autofill/FormAutofillUtils.jsm"
     ));
   });