Bug 1516957 - Part 1 - Remove uses of ContentTask from the new "about:config" tests. r=bgrins
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Mon, 31 Dec 2018 11:41:48 +0000
changeset 509339 c762e770dec4e6e968809dd22bcc59f27d1a4a1b
parent 509338 9264db4a86077ae257815435c887303cb1230d86
child 509340 214d0e9f78255628d8f302e543fe4a4740ec33f3
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1516957
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1516957 - Part 1 - Remove uses of ContentTask from the new "about:config" tests. r=bgrins Uses of ContentTask can be removed because the page will continue to be loaded in the parent process for the time being. We don't want to give generic write access to preferences to the content processes until there is a way to separate privileged browser pages from regular web content using different process types. Differential Revision: https://phabricator.services.mozilla.com/D15513
browser/components/aboutconfig/test/browser/browser_basic.js
browser/components/aboutconfig/test/browser/browser_edit.js
browser/components/aboutconfig/test/browser/browser_locked.js
browser/components/aboutconfig/test/browser/browser_search.js
browser/components/aboutconfig/test/browser/browser_warning.js
--- a/browser/components/aboutconfig/test/browser/browser_basic.js
+++ b/browser/components/aboutconfig/test/browser/browser_basic.js
@@ -10,65 +10,59 @@ add_task(async function setup() {
     ],
   });
 });
 
 add_task(async function test_load_title() {
   await BrowserTestUtils.withNewTab({
     gBrowser,
     url: PAGE_URL,
-  }, browser => {
+  }, async browser => {
     info("about:config loaded");
-    return ContentTask.spawn(browser, null, async () => {
-      await content.document.l10n.ready;
-      Assert.equal(content.document.title, "about:config");
-    });
+    await content.document.l10n.ready;
+    Assert.equal(content.document.title, "about:config");
   });
 });
 
 add_task(async function test_load_settings() {
   await BrowserTestUtils.withNewTab({
     gBrowser,
     url: PAGE_URL,
-  }, browser => {
+  }, async browser => {
     content.document.querySelector("button").click();
 
-    return ContentTask.spawn(browser, null, () => {
-      ChromeUtils.import("resource://gre/modules/Services.jsm");
+    let list = [...content.document.getElementById("prefs")
+      .getElementsByTagName("tr")];
+    function getRow(name) {
+      return list.find(row => row.querySelector("td").textContent == name);
+    }
+    function getValue(name) {
+      return getRow(name).querySelector("td.cell-value").textContent;
+    }
 
-      let list = [...content.document.getElementById("prefs")
-        .getElementsByTagName("tr")];
-      function getRow(name) {
-        return list.find(row => row.querySelector("td").textContent == name);
-      }
-      function getValue(name) {
-        return getRow(name).querySelector("td.cell-value").textContent;
-      }
-
-      // Test if page contains elements.
-      Assert.ok(getRow("plugins.testmode"));
-      Assert.ok(getRow("dom.vr.enabled"));
-      Assert.ok(getRow("accessibility.AOM.enabled"));
+    // Test if page contains elements.
+    Assert.ok(getRow("plugins.testmode"));
+    Assert.ok(getRow("dom.vr.enabled"));
+    Assert.ok(getRow("accessibility.AOM.enabled"));
 
-      // Test if the modified state is displayed for the right prefs.
-      let prefArray = Services.prefs.getChildList("");
-      let nameOfEdited = prefArray.find(
-        name => Services.prefs.prefHasUserValue(name));
-      let nameOfDefault = prefArray.find(
-        name => !Services.prefs.prefHasUserValue(name));
-      Assert.ok(!getRow(nameOfDefault).classList.contains("has-user-value"));
-      Assert.ok(getRow(nameOfEdited).classList.contains("has-user-value"));
+    // Test if the modified state is displayed for the right prefs.
+    let prefArray = Services.prefs.getChildList("");
+    let nameOfEdited = prefArray.find(
+      name => Services.prefs.prefHasUserValue(name));
+    let nameOfDefault = prefArray.find(
+      name => !Services.prefs.prefHasUserValue(name));
+    Assert.ok(!getRow(nameOfDefault).classList.contains("has-user-value"));
+    Assert.ok(getRow(nameOfEdited).classList.contains("has-user-value"));
 
-      // Test to see if values are localized.
-      Assert.equal(getValue("font.language.group"), "x-western");
-      Assert.equal(getValue("intl.ellipsis"), "\u2026");
-      Assert.equal(
-        getValue("gecko.handlerService.schemes.mailto.1.uriTemplate"),
-        "https://mail.google.com/mail/?extsrc=mailto&url=%s");
+    // Test to see if values are localized.
+    Assert.equal(getValue("font.language.group"), "x-western");
+    Assert.equal(getValue("intl.ellipsis"), "\u2026");
+    Assert.equal(
+      getValue("gecko.handlerService.schemes.mailto.1.uriTemplate"),
+      "https://mail.google.com/mail/?extsrc=mailto&url=%s");
 
-      // Test to see if user created value is not empty string when it matches /^chrome:\/\/.+\/locale\/.+\.properties/.
-      Assert.equal(getValue("random.user.pref"),
-        "chrome://test/locale/testing.properties");
-      // Test to see if empty string when value matches /^chrome:\/\/.+\/locale\/.+\.properties/ and an exception is thrown.
-      Assert.equal(getValue("gecko.handlerService.schemes.irc.1.name"), "");
-    });
+    // Test to see if user created value is not empty string when it matches /^chrome:\/\/.+\/locale\/.+\.properties/.
+    Assert.equal(getValue("random.user.pref"),
+      "chrome://test/locale/testing.properties");
+    // Test to see if empty string when value matches /^chrome:\/\/.+\/locale\/.+\.properties/ and an exception is thrown.
+    Assert.equal(getValue("gecko.handlerService.schemes.irc.1.name"), "");
   });
 });
--- a/browser/components/aboutconfig/test/browser/browser_edit.js
+++ b/browser/components/aboutconfig/test/browser/browser_edit.js
@@ -23,213 +23,182 @@ add_task(async function setup() {
 
 add_task(async function test_add_user_pref() {
   await BrowserTestUtils.withNewTab({
     gBrowser,
     url: PAGE_URL,
   }, async browser => {
     await content.document.querySelector("button").click();
 
-    await ContentTask.spawn(browser, null, () => {
-      Assert.ok(!Services.prefs.getChildList("").find(pref => pref == "testPref"));
-      let search = content.document.getElementById("search");
-      search.value = "testPref";
-      search.focus();
-    });
+    Assert.ok(!Services.prefs.getChildList("").find(pref => pref == "testPref"));
+    let search = content.document.getElementById("search");
+    search.value = "testPref";
+    search.focus();
 
     for (let [buttonSelector, expectedValue] of [
       [".add-true", true],
       [".add-false", false],
       [".add-Number", 0],
       [".add-String", ""],
     ]) {
       EventUtils.sendKey("return");
-      await ContentTask.spawn(browser, [buttonSelector, expectedValue],
-                                      // eslint-disable-next-line no-shadow
-                                      ([buttonSelector, expectedValue]) => {
-        ChromeUtils.import("resource://gre/modules/Preferences.jsm");
 
-        content.document.querySelector("#prefs button" + buttonSelector).click();
-        Assert.ok(Services.prefs.getChildList("").find(pref => pref == "testPref"));
-        Assert.ok(Preferences.get("testPref") === expectedValue);
-        content.document.querySelector("#prefs button[data-l10n-id='about-config-pref-delete']").click();
-        let search = content.document.getElementById("search");
-        search.value = "testPref";
-        search.focus();
-      });
+      content.document.querySelector("#prefs button" + buttonSelector).click();
+      Assert.ok(Services.prefs.getChildList("").find(pref => pref == "testPref"));
+      Assert.ok(Preferences.get("testPref") === expectedValue);
+      content.document.querySelector("#prefs button[data-l10n-id='about-config-pref-delete']").click();
+      search = content.document.getElementById("search");
+      search.value = "testPref";
+      search.focus();
     }
   });
 });
 
 add_task(async function test_delete_user_pref() {
   Services.prefs.setBoolPref("userAddedPref", true);
   await BrowserTestUtils.withNewTab({
     gBrowser,
     url: PAGE_URL,
   }, async browser => {
     await content.document.querySelector("button").click();
 
-    await ContentTask.spawn(browser, null, () => {
-      let list = [...content.document.getElementById("prefs")
-        .getElementsByTagName("tr")];
-      function getRow(name) {
-        return list.find(row => row.querySelector("td").textContent == name);
-      }
-      Assert.ok(getRow("userAddedPref"));
-      getRow("userAddedPref").lastChild.lastChild.click();
-      list = [...content.document.getElementById("prefs")
-        .getElementsByTagName("tr")];
-      Assert.ok(!getRow("userAddedPref"));
-      Assert.ok(!Services.prefs.getChildList("").includes("userAddedPref"));
+    let list = [...content.document.getElementById("prefs")
+      .getElementsByTagName("tr")];
+    function getRow(name) {
+      return list.find(row => row.querySelector("td").textContent == name);
+    }
+    Assert.ok(getRow("userAddedPref"));
+    getRow("userAddedPref").lastChild.lastChild.click();
+    list = [...content.document.getElementById("prefs")
+      .getElementsByTagName("tr")];
+    Assert.ok(!getRow("userAddedPref"));
+    Assert.ok(!Services.prefs.getChildList("").includes("userAddedPref"));
 
-      // Search for nothing to test gPrefArray
-      let search = content.document.getElementById("search");
-      search.focus();
-    });
-
+    // Search for nothing to test gPrefArray
+    let search = content.document.getElementById("search");
+    search.focus();
     EventUtils.sendKey("return");
-    await ContentTask.spawn(browser, null, () => {
-      let list = [...content.document.getElementById("prefs")
-        .getElementsByTagName("tr")];
-      function getRow(name) {
-        return list.find(row => row.querySelector("td").textContent == name);
-      }
-      Assert.ok(!getRow("userAddedPref"));
-    });
+
+    list = [...content.document.getElementById("prefs")
+      .getElementsByTagName("tr")];
+    Assert.ok(!getRow("userAddedPref"));
   });
 });
 
 add_task(async function test_reset_user_pref() {
   await SpecialPowers.pushPrefEnv({"set": [["browser.autofocus", false]]});
 
   await BrowserTestUtils.withNewTab({
     gBrowser,
     url: PAGE_URL,
   }, async browser => {
     await content.document.querySelector("button").click();
 
-    await ContentTask.spawn(browser, null, () => {
-      ChromeUtils.import("resource://gre/modules/Preferences.jsm");
-
-      function getRow(name) {
-        return list.find(row => row.querySelector("td").textContent == name);
-      }
-      function getValue(name) {
-        return getRow(name).querySelector("td.cell-value").textContent;
-      }
-      let testPref = "browser.autofocus";
-      // Click reset.
-      let list = [...content.document.getElementById("prefs")
-        .getElementsByTagName("tr")];
-      let row = getRow(testPref);
-      row.lastChild.lastChild.click();
-      // Check new layout and reset.
-      list = [...content.document.getElementById("prefs")
-        .getElementsByTagName("tr")];
-      Assert.ok(!row.classList.contains("has-user-value"));
-      Assert.equal(row.lastChild.childNodes.length, 0);
-      Assert.ok(!Services.prefs.prefHasUserValue(testPref));
-      Assert.equal(getValue(testPref), "" + Preferences.get(testPref));
+    function getRow(name) {
+      return list.find(row => row.querySelector("td").textContent == name);
+    }
+    function getValue(name) {
+      return getRow(name).querySelector("td.cell-value").textContent;
+    }
+    let testPref = "browser.autofocus";
+    // Click reset.
+    let list = [...content.document.getElementById("prefs")
+      .getElementsByTagName("tr")];
+    let row = getRow(testPref);
+    row.lastChild.lastChild.click();
+    // Check new layout and reset.
+    list = [...content.document.getElementById("prefs")
+      .getElementsByTagName("tr")];
+    Assert.ok(!row.classList.contains("has-user-value"));
+    Assert.equal(row.lastChild.childNodes.length, 0);
+    Assert.ok(!Services.prefs.prefHasUserValue(testPref));
+    Assert.equal(getValue(testPref), "" + Preferences.get(testPref));
 
-      // Search for nothing to test gPrefArray
-      let search = content.document.getElementById("search");
-      search.focus();
-    });
-
+    // Search for nothing to test gPrefArray
+    let search = content.document.getElementById("search");
+    search.focus();
     EventUtils.sendKey("return");
-    await ContentTask.spawn(browser, null, () => {
-      function getRow(name) {
-        return list.find(row => row.querySelector("td").textContent == name);
-      }
-      function getValue(name) {
-        return getRow(name).querySelector("td.cell-value").textContent;
-      }
-      let testPref = "browser.autofocus";
-      // Check new layout and reset.
-      let list = [...content.document.getElementById("prefs")
-        .getElementsByTagName("tr")];
-      let row = getRow(testPref);
-      Assert.ok(!row.classList.contains("has-user-value"));
-      Assert.equal(row.lastChild.childNodes.length, 0);
-      Assert.equal(getValue(testPref), "" + Preferences.get(testPref));
-    });
+
+    // Check new layout and reset.
+    list = [...content.document.getElementById("prefs")
+      .getElementsByTagName("tr")];
+    row = getRow(testPref);
+    Assert.ok(!row.classList.contains("has-user-value"));
+    Assert.equal(row.lastChild.childNodes.length, 0);
+    Assert.equal(getValue(testPref), "" + Preferences.get(testPref));
   });
 });
 
 add_task(async function test_modify() {
   await BrowserTestUtils.withNewTab({
     gBrowser,
     url: PAGE_URL,
-  }, browser => {
+  }, async browser => {
     content.document.querySelector("button").click();
 
-    return ContentTask.spawn(browser, null, () => {
-      ChromeUtils.import("resource://gre/modules/Preferences.jsm");
+    function getRow(name, list) {
+      return list.find(row => row.querySelector("td").textContent == name);
+    }
+    function getValue(name, list) {
+      return getRow(name, list).querySelector("td.cell-value").textContent;
+    }
 
-      function getRow(name, list) {
-        return list.find(row => row.querySelector("td").textContent == name);
+    // Test toggle for boolean prefs.
+    let list = [...content.document.getElementById("prefs")
+      .getElementsByTagName("tr")];
+    for (let nameOfBoolPref of [
+      "test.aboutconfig.modify.boolean",
+      "accessibility.typeaheadfind.autostart",
+    ]) {
+      let row = getRow(nameOfBoolPref, list);
+      // Do this a two times to reset the pref.
+      for (let i = 0; i < 2; i++) {
+        row.querySelector("td.cell-edit").firstChild.click();
+        // Check new layout and saving in backend.
+        Assert.equal(getValue(nameOfBoolPref, list),
+          "" + Preferences.get(nameOfBoolPref));
+        let prefHasUserValue = Services.prefs.prefHasUserValue(nameOfBoolPref);
+        Assert.equal(row.classList.contains("has-user-value"), prefHasUserValue);
+        Assert.equal(row.lastChild.childNodes.length > 0, prefHasUserValue);
       }
-      function getValue(name, list) {
-        return getRow(name, list).querySelector("td.cell-value").textContent;
-      }
+    }
 
-      // Test toggle for boolean prefs.
-      let list = [...content.document.getElementById("prefs")
-        .getElementsByTagName("tr")];
-      for (let nameOfBoolPref of [
-        "test.aboutconfig.modify.boolean",
-        "accessibility.typeaheadfind.autostart",
-      ]) {
-        let row = getRow(nameOfBoolPref, list);
-        // Do this a two times to reset the pref.
-        for (let i = 0; i < 2; i++) {
-          row.querySelector("td.cell-edit").firstChild.click();
-          // Check new layout and saving in backend.
-          Assert.equal(getValue(nameOfBoolPref, list),
-            "" + Preferences.get(nameOfBoolPref));
-          let prefHasUserValue = Services.prefs.prefHasUserValue(nameOfBoolPref);
-          Assert.equal(row.classList.contains("has-user-value"), prefHasUserValue);
-          Assert.equal(row.lastChild.childNodes.length > 0, prefHasUserValue);
-        }
-      }
+    // Test abort of edit by starting with string and continuing with editing Int pref.
+    let row = getRow("test.aboutconfig.modify.string", list);
+    row.querySelector("td.cell-edit").firstChild.click();
+    row.querySelector("td.cell-value").firstChild.firstChild.value = "test";
+    let intRow = getRow("test.aboutconfig.modify.number", list);
+    intRow.querySelector("td.cell-edit").firstChild.click();
+    Assert.equal(intRow.querySelector("td.cell-value").firstChild.firstChild.value,
+      Preferences.get("test.aboutconfig.modify.number"));
+    Assert.equal(getValue("test.aboutconfig.modify.string", list),
+      "" + Preferences.get("test.aboutconfig.modify.string"));
+    Assert.equal(row.querySelector("td.cell-value").textContent,
+      Preferences.get("test.aboutconfig.modify.string"));
 
-      // Test abort of edit by starting with string and continuing with editing Int pref.
-      let row = getRow("test.aboutconfig.modify.string", list);
+    // Test regex check for Int pref.
+    intRow.querySelector("td.cell-value").firstChild.firstChild.value += "a";
+    intRow.querySelector("td.cell-edit").firstChild.click();
+    Assert.ok(!intRow.querySelector("td.cell-value").firstChild.firstChild.checkValidity());
+
+    // Test correct saving and DOM-update.
+    for (let prefName of [
+      "test.aboutconfig.modify.string",
+      "test.aboutconfig.modify.number",
+      "accessibility.typeaheadfind.soundURL",
+      "accessibility.typeaheadfind.casesensitive",
+    ]) {
+      row = getRow(prefName, list);
+      // Activate edit and check displaying.
       row.querySelector("td.cell-edit").firstChild.click();
-      row.querySelector("td.cell-value").firstChild.firstChild.value = "test";
-      let intRow = getRow("test.aboutconfig.modify.number", list);
-      intRow.querySelector("td.cell-edit").firstChild.click();
-      Assert.equal(intRow.querySelector("td.cell-value").firstChild.firstChild.value,
-        Preferences.get("test.aboutconfig.modify.number"));
-      Assert.equal(getValue("test.aboutconfig.modify.string", list),
-        "" + Preferences.get("test.aboutconfig.modify.string"));
-      Assert.equal(row.querySelector("td.cell-value").textContent,
-        Preferences.get("test.aboutconfig.modify.string"));
-
-      // Test regex check for Int pref.
-      intRow.querySelector("td.cell-value").firstChild.firstChild.value += "a";
-      intRow.querySelector("td.cell-edit").firstChild.click();
-      Assert.ok(!intRow.querySelector("td.cell-value").firstChild.firstChild.checkValidity());
-
-      // Test correct saving and DOM-update.
-      for (let prefName of [
-        "test.aboutconfig.modify.string",
-        "test.aboutconfig.modify.number",
-        "accessibility.typeaheadfind.soundURL",
-        "accessibility.typeaheadfind.casesensitive",
-      ]) {
-        row = getRow(prefName, list);
-        // Activate edit and check displaying.
-        row.querySelector("td.cell-edit").firstChild.click();
-        Assert.equal(row.querySelector("td.cell-value").firstChild.firstChild.value,
-          Preferences.get(prefName));
-        row.querySelector("td.cell-value").firstChild.firstChild.value = "42";
-        // Save and check saving.
-        row.querySelector("td.cell-edit").firstChild.click();
-        Assert.equal(getValue(prefName, list),
-          "" + Preferences.get(prefName));
-        let prefHasUserValue = Services.prefs.prefHasUserValue(prefName);
-        Assert.equal(row.lastChild.childNodes.length > 0, prefHasUserValue);
-        Assert.equal(row.classList.contains("has-user-value"), prefHasUserValue);
-      }
-    });
+      Assert.equal(row.querySelector("td.cell-value").firstChild.firstChild.value,
+        Preferences.get(prefName));
+      row.querySelector("td.cell-value").firstChild.firstChild.value = "42";
+      // Save and check saving.
+      row.querySelector("td.cell-edit").firstChild.click();
+      Assert.equal(getValue(prefName, list),
+        "" + Preferences.get(prefName));
+      let prefHasUserValue = Services.prefs.prefHasUserValue(prefName);
+      Assert.equal(row.lastChild.childNodes.length > 0, prefHasUserValue);
+      Assert.equal(row.classList.contains("has-user-value"), prefHasUserValue);
+    }
   });
 });
--- a/browser/components/aboutconfig/test/browser/browser_locked.js
+++ b/browser/components/aboutconfig/test/browser/browser_locked.js
@@ -22,51 +22,49 @@ add_task(async function test_locked() {
   Services.prefs.lockPref("test.aboutconfig.a");
   Services.prefs.lockPref("accessibility.AOM.enabled");
   await BrowserTestUtils.withNewTab({
     gBrowser,
     url: PAGE_URL,
   }, async browser => {
     await content.document.querySelector("button").click();
 
-    await ContentTask.spawn(browser, null, () => {
-      let list = [...content.document.getElementById("prefs")
-        .getElementsByTagName("tr")];
-      function getRow(name) {
-        return list.find(row => row.querySelector("td").textContent == name);
-      }
-      function getValue(name) {
-          return getRow(name).querySelector("td.cell-value").textContent;
-      }
-      function getButton(name) {
-        return getRow(name).querySelector("button");
-      }
+    let list = [...content.document.getElementById("prefs")
+      .getElementsByTagName("tr")];
+    function getRow(name) {
+      return list.find(row => row.querySelector("td").textContent == name);
+    }
+    function getValue(name) {
+        return getRow(name).querySelector("td.cell-value").textContent;
+    }
+    function getButton(name) {
+      return getRow(name).querySelector("button");
+    }
 
-      // Test locked default string pref.
-      let lockedPref = getRow("browser.search.searchEnginesURL");
-      Assert.ok(lockedPref.classList.contains("locked"));
-      Assert.equal(getValue("browser.search.searchEnginesURL"), "https://addons.mozilla.org/%LOCALE%/firefox/search-engines/");
-      Assert.ok(getButton("browser.search.searchEnginesURL").classList.contains("button-edit"));
-      Assert.equal(getButton("browser.search.searchEnginesURL").disabled, true);
+    // Test locked default string pref.
+    let lockedPref = getRow("browser.search.searchEnginesURL");
+    Assert.ok(lockedPref.classList.contains("locked"));
+    Assert.equal(getValue("browser.search.searchEnginesURL"), "https://addons.mozilla.org/%LOCALE%/firefox/search-engines/");
+    Assert.ok(getButton("browser.search.searchEnginesURL").classList.contains("button-edit"));
+    Assert.equal(getButton("browser.search.searchEnginesURL").disabled, true);
 
-      // Test locked default boolean pref.
-      lockedPref = getRow("accessibility.AOM.enabled");
-      Assert.ok(lockedPref.classList.contains("locked"));
-      Assert.equal(getValue("accessibility.AOM.enabled"), "false");
-      Assert.ok(getButton("accessibility.AOM.enabled").classList.contains("button-toggle"));
-      Assert.equal(getButton("accessibility.AOM.enabled").disabled, true);
+    // Test locked default boolean pref.
+    lockedPref = getRow("accessibility.AOM.enabled");
+    Assert.ok(lockedPref.classList.contains("locked"));
+    Assert.equal(getValue("accessibility.AOM.enabled"), "false");
+    Assert.ok(getButton("accessibility.AOM.enabled").classList.contains("button-toggle"));
+    Assert.equal(getButton("accessibility.AOM.enabled").disabled, true);
 
-      // Test locked user added pref.
-      lockedPref = getRow("test.aboutconfig.a");
-      Assert.ok(lockedPref.classList.contains("locked"));
-      Assert.equal(getValue("test.aboutconfig.a"), "");
-      Assert.ok(getButton("test.aboutconfig.a").classList.contains("button-edit"));
-      Assert.equal(getButton("test.aboutconfig.a").disabled, true);
+    // Test locked user added pref.
+    lockedPref = getRow("test.aboutconfig.a");
+    Assert.ok(lockedPref.classList.contains("locked"));
+    Assert.equal(getValue("test.aboutconfig.a"), "");
+    Assert.ok(getButton("test.aboutconfig.a").classList.contains("button-edit"));
+    Assert.equal(getButton("test.aboutconfig.a").disabled, true);
 
-      // Test pref not locked
-      let unlockedPref = getRow("accessibility.indicator.enabled");
-      Assert.equal(unlockedPref.classList.contains("locked"), false);
-      Assert.equal(getValue("accessibility.indicator.enabled"), "false");
-      Assert.ok(getButton("accessibility.indicator.enabled").classList.contains("button-toggle"));
-      Assert.equal(getButton("accessibility.indicator.enabled").disabled, false);
-    });
+    // Test pref not locked
+    let unlockedPref = getRow("accessibility.indicator.enabled");
+    Assert.equal(unlockedPref.classList.contains("locked"), false);
+    Assert.equal(getValue("accessibility.indicator.enabled"), "false");
+    Assert.ok(getButton("accessibility.indicator.enabled").classList.contains("button-toggle"));
+    Assert.equal(getButton("accessibility.indicator.enabled").disabled, false);
   });
 });
--- a/browser/components/aboutconfig/test/browser/browser_search.js
+++ b/browser/components/aboutconfig/test/browser/browser_search.js
@@ -18,77 +18,63 @@ add_task(async function setup() {
 add_task(async function test_search() {
   await BrowserTestUtils.withNewTab({
     gBrowser,
     url: PAGE_URL,
   }, async browser => {
     let prefArray = Services.prefs.getChildList("");
     await content.document.querySelector("button").click();
 
-    // Test page loaded with correct number of prefs.
-    await ContentTask.spawn(browser, prefArray, aPrefArray => {
-      // The total number of preferences may change at any time because of
-      // operations running in the background, so we only test approximately.
-      // The change in count would be because of one or two added preferences,
-      // but we tolerate a difference of up to 50 preferences just to be safe.
-      // We want thousands of prefs instead of a few dozen that are filtered.
-      Assert.greater(content.document.getElementById("prefs").childElementCount,
-                     aPrefArray.length - 50);
+    // The total number of preferences may change at any time because of
+    // operations running in the background, so we only test approximately.
+    // The change in count would be because of one or two added preferences,
+    // but we tolerate a difference of up to 50 preferences just to be safe.
+    // We want thousands of prefs instead of a few dozen that are filtered.
+    Assert.greater(content.document.getElementById("prefs").childElementCount,
+                   prefArray.length - 50);
 
-      // Filter a subset of preferences. The "browser.download." branch is
-      // chosen because it is very unlikely that its preferences would be
-      // modified by other code during the execution of this test.
-      let search = content.document.getElementById("search");
-      search.value = "wser.down   ";
-      search.focus();
-    });
-
+    // Filter a subset of preferences. The "browser.download." branch is
+    // chosen because it is very unlikely that its preferences would be
+    // modified by other code during the execution of this test.
+    let search = content.document.getElementById("search");
+    search.value = "wser.down   ";
+    search.focus();
     EventUtils.sendKey("return");
-    await ContentTask.spawn(browser, prefArray, aPrefArray => {
-      let filteredPrefArray =
-          aPrefArray.filter(pref => pref.includes("wser.down"));
-      // Adding +1 to the list since button does not match an exact
-      // preference name then a row is added for the user to add a
-      // new button preference if desired
-      Assert.equal(content.document.getElementById("prefs").childElementCount,
-                   filteredPrefArray.length + 1);
 
-      // Test empty search returns all preferences.
-      let search = content.document.getElementById("search");
-      search.value = "";
-      search.focus();
-    });
+    let filteredPrefArray =
+        prefArray.filter(pref => pref.includes("wser.down"));
+    // Adding +1 to the list since button does not match an exact
+    // preference name then a row is added for the user to add a
+    // new button preference if desired
+    Assert.equal(content.document.getElementById("prefs").childElementCount,
+                 filteredPrefArray.length + 1);
 
-    EventUtils.sendKey("return");
-    await ContentTask.spawn(browser, prefArray, aPrefArray => {
-      // The total number of preferences may change at any time because of
-      // operations running in the background, so we only test approximately.
-      // The change in count would be because of one or two added preferences,
-      // but we tolerate a difference of up to 50 preferences just to be safe.
-      // We want thousands of prefs instead of a few dozen that are filtered.
-      Assert.greater(content.document.getElementById("prefs").childElementCount,
-                     aPrefArray.length - 50);
-
-      // Test invalid search returns no preferences.
-      let search = content.document.getElementById("search");
-      search.value = "aJunkValueasdf";
-      search.focus();
-    });
-
+    // Test empty search returns all preferences.
+    search.value = "";
+    search.focus();
     EventUtils.sendKey("return");
-    await ContentTask.spawn(browser, prefArray, aPrefArray => {
-      // Expecting 1 row to be returned since it offers the ability to add
-      Assert.equal(content.document.getElementById("prefs").childElementCount,
-                   1);
+
+    // The total number of preferences may change at any time because of
+    // operations running in the background, so we only test approximately.
+    // The change in count would be because of one or two added preferences,
+    // but we tolerate a difference of up to 50 preferences just to be safe.
+    // We want thousands of prefs instead of a few dozen that are filtered.
+    Assert.greater(content.document.getElementById("prefs").childElementCount,
+                   prefArray.length - 50);
 
-      // Test added preferences search returns 2 preferences.
-      let search = content.document.getElementById("search");
-      search.value = "test.aboutconfig.a";
-      search.focus();
-    });
+    // Test invalid search returns no preferences.
+    search.value = "aJunkValueasdf";
+    search.focus();
+    EventUtils.sendKey("return");
 
+    // Expecting 1 row to be returned since it offers the ability to add
+    Assert.equal(content.document.getElementById("prefs").childElementCount,
+                 1);
+
+    // Test added preferences search returns 2 preferences.
+    search.value = "test.aboutconfig.a";
+    search.focus();
     EventUtils.sendKey("return");
-    await ContentTask.spawn(browser, prefArray, aPrefArray => {
-      Assert.equal(content.document.getElementById("prefs").childElementCount,
-                   2);
-    });
+
+    Assert.equal(content.document.getElementById("prefs").childElementCount,
+                 2);
   });
 });
--- a/browser/components/aboutconfig/test/browser/browser_warning.js
+++ b/browser/components/aboutconfig/test/browser/browser_warning.js
@@ -10,29 +10,27 @@ add_task(async function setup() {
     ],
   });
 });
 
 add_task(async function test_load_warningpage() {
   await BrowserTestUtils.withNewTab({
     gBrowser,
     url: PAGE_URL,
-  }, browser => {
+  }, async browser => {
     info("about:config loaded");
-    return ContentTask.spawn(browser, null, async () => {
-      // Test that the warning page is presented:
-      Assert.equal(content.document.getElementsByTagName("button").length, 1);
-      Assert.equal(content.document.getElementById("search"), undefined);
-      Assert.equal(content.document.getElementById("prefs"), undefined);
+    // Test that the warning page is presented:
+    Assert.equal(content.document.getElementsByTagName("button").length, 1);
+    Assert.equal(content.document.getElementById("search"), undefined);
+    Assert.equal(content.document.getElementById("prefs"), undefined);
 
-      // Disable checkbox and reload.
-      content.document.getElementById("showWarningNextTime").click();
-      content.document.querySelector("button").click();
-    });
+    // Disable checkbox and reload.
+    content.document.getElementById("showWarningNextTime").click();
+    content.document.querySelector("button").click();
   });
   await BrowserTestUtils.withNewTab({
     gBrowser,
     url: PAGE_URL,
-  }, browser => {
+  }, async browser => {
     Assert.ok(content.document.getElementById("search"));
     Assert.ok(content.document.getElementById("prefs"));
   });
 });