Bug 1412778 - Enable ESLint rule no-cpows-in-tests across the whole tree. r=florian
authorMark Banner <standard8@mozilla.com>
Mon, 30 Oct 2017 09:55:39 +0000
changeset 389012 2157ae2dad2710918621ffbb6e44b2c0cda046f5
parent 389011 4453ff07bd9f5044f7b089dfdc4e2aa68b49550b
child 389013 703bff632e722ed178d178150e8c015eb33af655
push id32777
push userarchaeopteryx@coole-files.de
push dateMon, 30 Oct 2017 22:44:45 +0000
treeherdermozilla-central@dd0f265a1300 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1412778
milestone58.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 1412778 - Enable ESLint rule no-cpows-in-tests across the whole tree. r=florian MozReview-Commit-ID: 8pidN7x6MYh
browser/base/content/test/general/browser_bug423833.js
browser/base/content/test/general/browser_bug561636.js
browser/base/content/test/general/browser_bug575561.js
browser/base/content/test/general/browser_bug678392.js
browser/base/content/test/general/browser_bug767836_perwindowpb.js
browser/base/content/test/general/browser_e10s_about_page_triggeringprincipal.js
browser/base/content/test/general/browser_gZipOfflineChild.js
browser/base/content/test/general/browser_keywordSearch_postData.js
browser/base/content/test/general/browser_tabfocus.js
browser/base/content/test/newtab/browser_newtab_focus.js
browser/base/content/test/pageinfo/browser_pageinfo_image_info.js
browser/base/content/test/popupNotifications/browser_popupNotification_keyboard.js
browser/base/content/test/sidebar/browser_bug409481.js
browser/base/content/test/tabcrashed/browser_autoSubmitRequest.js
browser/base/content/test/tabcrashed/browser_clearEmail.js
browser/base/content/test/tabcrashed/browser_showForm.js
browser/base/content/test/tabcrashed/browser_shown.js
browser/base/content/test/webextensions/browser_extension_sideloading.js
browser/components/contextualidentity/test/browser/browser_usercontext.js
browser/components/customizableui/test/browser_947914_button_addons.js
browser/components/preferences/in-content/tests/browser_applications_selection.js
browser/components/preferences/in-content/tests/browser_basic_rebuild_fonts_test.js
browser/components/preferences/in-content/tests/browser_bug1018066_resetScrollPosition.js
browser/components/preferences/in-content/tests/browser_bug1020245_openPreferences_to_paneContent.js
browser/components/preferences/in-content/tests/browser_bug1184989_prevent_scrolling_when_preferences_flipped.js
browser/components/preferences/in-content/tests/browser_bug410900.js
browser/components/preferences/in-content/tests/browser_change_app_handler.js
browser/components/preferences/in-content/tests/browser_checkspelling.js
browser/components/preferences/in-content/tests/browser_cookies_exceptions.js
browser/components/preferences/in-content/tests/browser_engines.js
browser/components/preferences/in-content/tests/browser_extension_controlled.js
browser/components/preferences/in-content/tests/browser_homepages_filter_aboutpreferences.js
browser/components/preferences/in-content/tests/browser_layersacceleration.js
browser/components/preferences/in-content/tests/browser_masterpassword.js
browser/components/preferences/in-content/tests/browser_notifications_do_not_disturb.js
browser/components/preferences/in-content/tests/browser_performance.js
browser/components/preferences/in-content/tests/browser_performance_e10srollout.js
browser/components/preferences/in-content/tests/browser_performance_non_e10s.js
browser/components/preferences/in-content/tests/browser_permissions_urlFieldHidden.js
browser/components/preferences/in-content/tests/browser_sanitizeOnShutdown_prefLocked.js
browser/components/preferences/in-content/tests/browser_search_within_preferences_1.js
browser/components/preferences/in-content/tests/browser_search_within_preferences_2.js
browser/components/preferences/in-content/tests/browser_search_within_preferences_command.js
browser/components/preferences/in-content/tests/browser_security-1.js
browser/components/preferences/in-content/tests/browser_security-2.js
browser/components/preferences/in-content/tests/browser_siteData.js
browser/components/preferences/in-content/tests/browser_siteData2.js
browser/components/preferences/in-content/tests/browser_siteData3.js
browser/components/search/test/browser_aboutSearchReset.js
browser/components/sessionstore/test/browser_480893.js
browser/components/sessionstore/test/browser_590563.js
browser/components/sessionstore/test/browser_705597.js
browser/components/sessionstore/test/browser_707862.js
browser/components/sessionstore/test/browser_aboutSessionRestore.js
browser/components/sessionstore/test/browser_crashedTabs.js
browser/components/sessionstore/test/browser_swapDocShells.js
browser/extensions/formautofill/.eslintrc.js
browser/extensions/onboarding/test/browser/browser_onboarding_tourset.js
browser/extensions/shield-recipe-client/test/browser/browser_about_preferences.js
browser/extensions/shield-recipe-client/test/browser/browser_about_studies.js
toolkit/components/extensions/.eslintrc.js
toolkit/components/narrate/test/browser_narrate.js
toolkit/components/narrate/test/browser_narrate_language.js
toolkit/components/narrate/test/browser_voiceselect.js
toolkit/components/narrate/test/browser_word_highlight.js
toolkit/components/payments/.eslintrc.js
toolkit/components/satchel/.eslintrc.js
toolkit/components/viewsource/test/browser/browser_bug699356.js
toolkit/content/tests/browser/browser_save_resend_postdata.js
toolkit/mozapps/extensions/test/browser/browser_bug562797.js
toolkit/mozapps/extensions/test/browser/browser_discovery.js
toolkit/mozapps/extensions/test/browser/browser_discovery_install.js
tools/lint/eslint/eslint-plugin-mozilla/lib/configs/browser-test.js
--- a/browser/base/content/test/general/browser_bug423833.js
+++ b/browser/base/content/test/general/browser_bug423833.js
@@ -79,24 +79,26 @@ function test2Setup() {
   ok(test2tab, "openFrameInTab() opened a tab");
 
   gBrowser.selectedTab = test2tab;
 
   intervalID = setInterval(testOpenFrameInTab, 3000);
 }
 
 function testOpenFrameInTab() {
+  /* eslint-disable mozilla/no-cpows-in-tests */
   if (gBrowser.contentDocument.location.href == "about:blank")
     // Wait another cycle
     return;
 
   clearInterval(intervalID);
 
   // We should now have the error page in a new, active tab.
   is(gBrowser.contentDocument.location.href, invalidPage, "New tab should have page url, not about:neterror");
+  /* eslint-enable mozilla/no-cpows-in-tests */
 
   // Clear up the new tab, and punt to test 3
   gBrowser.removeCurrentTab();
 
   test3Setup();
 }
 
 function test3Setup() {
--- a/browser/base/content/test/general/browser_bug561636.js
+++ b/browser/base/content/test/general/browser_bug561636.js
@@ -280,16 +280,17 @@ add_task(async function() {
         gObserver.notifyInvalidSubmit = function() {};
         resolve();
       });
     };
 
     Services.obs.addObserver(gObserver, "invalidformsubmit");
 
     executeSoon(function() {
+      // eslint-disable-next-line mozilla/no-cpows-in-tests
       browser.contentDocument.getElementById("s").click();
     });
   });
 
   await notifierPromise;
 
   gBrowser.removeTab(gBrowser.getTabForBrowser(browser));
 });
@@ -325,16 +326,17 @@ add_task(async function() {
 
   let popupShownPromise = promiseWaitForEvent(gInvalidFormPopup, "popupshown");
   await clickChildElement(browser);
   await popupShownPromise;
 
   checkPopupShow();
   await checkChildFocus(browser, gInvalidFormPopup.firstChild.textContent);
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let inputPromise = promiseWaitForEvent(gBrowser.contentDocument.getElementById("i"), "input");
   EventUtils.synthesizeKey("f", {});
   await inputPromise;
 
   // Now, the element suffers from another error, the message should have
   // been updated.
   await new Promise((resolve, reject) => {
     // XXXndeakin This isn't really going to work when the content is another process
--- a/browser/base/content/test/general/browser_bug575561.js
+++ b/browser/base/content/test/general/browser_bug575561.js
@@ -69,16 +69,17 @@ async function testLink(aLinkIndexOrFunc
     });
   } else {
     promise = BrowserTestUtils.browserLoaded(browser, testSubFrame);
   }
 
   let href;
   if (typeof aLinkIndexOrFunction === "function") {
     ok(!browser.isRemoteBrowser, "don't pass a function for a remote browser");
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     let link = aLinkIndexOrFunction(browser.contentDocument);
     info("Clicking " + link.textContent);
     link.click();
     href = link.href;
   } else {
     href = await ContentTask.spawn(browser, [ testSubFrame, aLinkIndexOrFunction ], function([ subFrame, index ]) {
       let doc = subFrame ? content.document.querySelector("iframe").contentDocument : content.document;
       let link = doc.querySelectorAll("a")[index];
--- a/browser/base/content/test/general/browser_bug678392.js
+++ b/browser/base/content/test/general/browser_bug678392.js
@@ -31,16 +31,17 @@ function test() {
      "was successfully initialized when supported.");
 
   cleanupArray();
   load(gBrowser.selectedTab, HTTPROOT + "browser_bug678392-2.html", test0);
 }
 
 function load(aTab, aUrl, aCallback) {
   aTab.linkedBrowser.addEventListener("load", function(aEvent) {
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     waitForFocus(aCallback, content);
   }, {capture: true, once: true});
   aTab.linkedBrowser.loadURI(aUrl);
 }
 
 function cleanupArray() {
   let arr = gHistorySwipeAnimation._trackedSnapshots;
   while (arr.length > 0) {
--- a/browser/base/content/test/general/browser_bug767836_perwindowpb.js
+++ b/browser/base/content/test/general/browser_bug767836_perwindowpb.js
@@ -70,16 +70,17 @@ function test() {
   });
 }
 
 function openNewTab(aWindow, aCallback) {
   // Open a new tab
   aWindow.BrowserOpenTab();
 
   let browser = aWindow.gBrowser.selectedBrowser;
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   if (browser.contentDocument.readyState === "complete") {
     executeSoon(aCallback);
     return;
   }
 
   browser.addEventListener("load", function() {
     executeSoon(aCallback);
   }, {capture: true, once: true});
--- a/browser/base/content/test/general/browser_e10s_about_page_triggeringprincipal.js
+++ b/browser/base/content/test/general/browser_e10s_about_page_triggeringprincipal.js
@@ -11,16 +11,17 @@ const kAboutPagesRegistered = Promise.al
     registerCleanupFunction, "test-about-principal-parent", kParentPage,
     Ci.nsIAboutModule.ALLOW_SCRIPT)
 ]);
 
 add_task(async function test_principal_click() {
   await kAboutPagesRegistered;
   await BrowserTestUtils.withNewTab("about:test-about-principal-parent", async function(browser) {
     let loadPromise = BrowserTestUtils.browserLoaded(browser, false, "about:test-about-principal-child");
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     let myLink = browser.contentDocument.getElementById("aboutchildprincipal");
     myLink.click();
     await loadPromise;
 
     await ContentTask.spawn(gBrowser.selectedBrowser, {}, async function() {
       let channel = content.document.docShell.currentDocumentChannel;
       is(channel.originalURI.asciiSpec,
          "about:test-about-principal-child",
--- a/browser/base/content/test/general/browser_gZipOfflineChild.js
+++ b/browser/base/content/test/general/browser_gZipOfflineChild.js
@@ -67,13 +67,14 @@ function test() {
 
   Services.prefs.setBoolPref("offline-apps.allow_by_default", true);
 
   // Open a new tab.
   gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, URL);
   registerCleanupFunction(() => gBrowser.removeCurrentTab());
 
   BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     let window = gBrowser.selectedBrowser.contentWindow;
 
     window.addEventListener("message", handleMessageEvents);
   });
 }
--- a/browser/base/content/test/general/browser_keywordSearch_postData.js
+++ b/browser/base/content/test/general/browser_keywordSearch_postData.js
@@ -62,16 +62,17 @@ function nextTest() {
     finish();
   }
 }
 
 function doTest() {
   info("Running test: " + gCurrTest.name);
 
   waitForLoad(function() {
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     let loadedText = gBrowser.contentDocument.body.textContent;
     ok(loadedText, "search page loaded");
     let needle = "searchterms=" + gCurrTest.expectText;
     is(loadedText, needle, "The query POST data should be returned in the response");
     nextTest();
   });
 
   // Simulate a user entering search terms
--- a/browser/base/content/test/general/browser_tabfocus.js
+++ b/browser/base/content/test/general/browser_tabfocus.js
@@ -86,16 +86,17 @@ function focusInChild() {
 
   addEventListener("focus", eventListener, true);
   addEventListener("blur", eventListener, true);
 
   addMessageListener("Browser:ChangeFocus", function changeFocus(message) {
     content.document.getElementById(message.data.id)[message.data.type]();
   });
 
+  /* eslint-disable mozilla/no-cpows-in-tests */
   addMessageListener("Browser:GetFocusedElement", function getFocusedElement(message) {
     var focusedWindow = {};
     var node = contentFM.getFocusedElementForWindow(content, false, focusedWindow);
     var details = "Focus is " + (node ? node.id : "<none>");
 
     /* Check focus manager properties. Add an error onto the string if they are
        not what is expected which will cause matching to fail in the parent process. */
     let doc = content.document;
@@ -123,16 +124,17 @@ function focusElementInChild(elementid, 
   let browser = (elementid.indexOf("1") >= 0) ? browser1 : browser2;
   if (gMultiProcessBrowser) {
     browser.messageManager.sendAsyncMessage("Browser:ChangeFocus",
                                             { id: elementid, type });
   } else {
     browser.contentDocument.getElementById(elementid)[type]();
   }
 }
+/* eslint-enable mozilla/no-cpows-in-tests */
 
 add_task(async function() {
   tab1 = BrowserTestUtils.addTab(gBrowser);
   browser1 = gBrowser.getBrowserForTab(tab1);
 
   tab2 = BrowserTestUtils.addTab(gBrowser);
   browser2 = gBrowser.getBrowserForTab(tab2);
 
--- a/browser/base/content/test/newtab/browser_newtab_focus.js
+++ b/browser/base/content/test/newtab/browser_newtab_focus.js
@@ -62,17 +62,17 @@ function countFocus(aExpectedCount) {
 function promiseNoMuteNotificationOnFirstSession() {
   return SpecialPowers.pushPrefEnv({set: [["browser.onboarding.notification.mute-duration-on-first-session-ms", 0]]});
 }
 
 /**
  * Wait for the onboarding tour notification opens
  */
 function promiseTourNotificationOpened(browser) {
-  function isOpened() {
+  return ContentTask.spawn(browser, {}, function() {
     let doc = content && content.document;
     let notification = doc.querySelector("#onboarding-notification-bar");
     if (notification && notification.classList.contains("onboarding-opened")) {
       ok(true, "Should open tour notification");
       return Promise.resolve();
     }
     return new Promise(resolve => {
       let observer = new content.MutationObserver(mutations => {
@@ -83,11 +83,10 @@ function promiseTourNotificationOpened(b
             observer.disconnect();
             ok(true, "Should open tour notification");
             resolve();
           }
         });
       });
       observer.observe(doc.body, { childList: true });
     });
-  }
-  return ContentTask.spawn(browser, {}, isOpened);
+  });
 }
--- a/browser/base/content/test/pageinfo/browser_pageinfo_image_info.js
+++ b/browser/base/content/test/pageinfo/browser_pageinfo_image_info.js
@@ -9,16 +9,17 @@ function getImageInfo(imageElement) {
 }
 
 function test() {
   waitForExplicitFinish();
 
   gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
 
   gBrowser.selectedBrowser.addEventListener("load", function() {
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     var doc = gBrowser.contentDocument;
     var testImg = doc.getElementById("test-image");
     var pageInfo = BrowserPageInfo(gBrowser.selectedBrowser.currentURI.spec,
                                    "mediaTab", getImageInfo(testImg));
 
     pageInfo.addEventListener("load", function() {
       pageInfo.onFinished.push(function() {
         var pageInfoImg = pageInfo.document.getElementById("thepreviewimage");
--- a/browser/base/content/test/popupNotifications/browser_popupNotification_keyboard.js
+++ b/browser/base/content/test/popupNotifications/browser_popupNotification_keyboard.js
@@ -187,16 +187,17 @@ var tests = [
         await opened;
 
         // Check that the focused element in the chrome window
         // is either the browser in case we're running on e10s
         // or the input field in case of non-e10s.
         if (gMultiProcessBrowser) {
           is(Services.focus.focusedElement, browser);
         } else {
+          // eslint-disable-next-line mozilla/no-cpows-in-tests
           is(Services.focus.focusedElement, browser.contentDocument.getElementById("test-input"));
         }
 
         // Check that the input field is still focused inside the browser.
         await ContentTask.spawn(browser, {}, function() {
           is(content.document.activeElement, content.document.getElementById("test-input"));
         });
 
--- a/browser/base/content/test/sidebar/browser_bug409481.js
+++ b/browser/base/content/test/sidebar/browser_bug409481.js
@@ -32,19 +32,21 @@ function delayedRunTest() {
   setTimeout(runTest, 100);
 }
 
 function runTest(event) {
   var sidebar = document.getElementById("sidebar");
   sidebar.contentDocument.removeEventListener("load", delayedRunTest, true);
 
   var browser = sidebar.contentDocument.getElementById("web-panels-browser");
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   var div = browser && browser.contentDocument.getElementById("test_bug409481");
   ok(div && div.textContent == "Content!", "Sidebar content loaded");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   var link = browser && browser.contentDocument.getElementById("link");
   sidebar.contentDocument.addEventListener("popupshown", contextMenuOpened);
 
   EventUtils.synthesizeMouseAtCenter(link, { type: "contextmenu", button: 2 }, browser.contentWindow);
 }
 
 function contextMenuOpened() {
   var sidebar = document.getElementById("sidebar");
@@ -55,16 +57,17 @@ function contextMenuOpened() {
   copyLinkCommand.doCommand();
 }
 
 function copyLinkCommandExecuted(event) {
   event.target.removeEventListener("command", copyLinkCommandExecuted);
 
   var sidebar = document.getElementById("sidebar");
   var browser = sidebar.contentDocument.getElementById("web-panels-browser");
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   var textbox = browser && browser.contentDocument.getElementById("textbox");
   textbox.focus();
   document.commandDispatcher.getControllerForCommand("cmd_paste").doCommand("cmd_paste");
   is(textbox.value, "http://www.example.com/ctest", "copy link command");
 
   sidebar.contentDocument.addEventListener("popuphidden", contextMenuClosed);
   event.target.parentNode.hidePopup();
 }
--- a/browser/base/content/test/tabcrashed/browser_autoSubmitRequest.js
+++ b/browser/base/content/test/tabcrashed/browser_autoSubmitRequest.js
@@ -27,16 +27,17 @@ add_task(async function test_show_form()
   }, async function(browser) {
     // Make sure we've flushed the browser messages so that
     // we can restore it.
     await TabStateFlusher.flush(browser);
 
     // Now crash the browser.
     await BrowserTestUtils.crashBrowser(browser);
 
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     let doc = browser.contentDocument;
 
     // Ensure the request is visible. We can safely reach into
     // the content since about:tabcrashed is an in-process URL.
     let requestAutoSubmit = doc.getElementById("requestAutoSubmit");
     Assert.ok(!requestAutoSubmit.hidden,
               "Request for autosubmission is visible.");
 
@@ -71,16 +72,17 @@ add_task(async function test_show_form()
   return BrowserTestUtils.withNewTab({
     gBrowser,
     url: PAGE,
   }, async function(browser) {
     await TabStateFlusher.flush(browser);
     // Now crash the browser.
     await BrowserTestUtils.crashBrowser(browser);
 
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     let doc = browser.contentDocument;
 
     // Ensure the request is NOT visible. We can safely reach into
     // the content since about:tabcrashed is an in-process URL.
     let requestAutoSubmit = doc.getElementById("requestAutoSubmit");
     Assert.ok(requestAutoSubmit.hidden,
               "Request for autosubmission is not visible.");
 
--- a/browser/base/content/test/tabcrashed/browser_clearEmail.js
+++ b/browser/base/content/test/tabcrashed/browser_clearEmail.js
@@ -32,35 +32,36 @@ add_task(async function test_clear_email
     // crash
     prefs.setCharPref("email", EMAIL);
     prefs.setBoolPref("emailMe", true);
 
     let tab = gBrowser.getTabForBrowser(browser);
     await BrowserTestUtils.crashBrowser(browser,
                                         /* shouldShowTabCrashPage */ true,
                                         /* shouldClearMinidumps */ false);
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     let doc = browser.contentDocument;
 
     // Since about:tabcrashed will run in the parent process, we can safely
     // manipulate its DOM nodes directly
     let emailMe = doc.getElementById("emailMe");
     emailMe.checked = false;
 
     let crashReport = promiseCrashReport({
       Email: "",
     });
 
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     let restoreTab = browser.contentDocument.getElementById("restoreTab");
     restoreTab.click();
     await BrowserTestUtils.waitForEvent(tab, "SSTabRestored");
     await crashReport;
 
     is(prefs.getCharPref("email"), "", "No email address should be stored");
 
     // Submitting the crash report may have set some prefs regarding how to
     // send tab crash reports. Let's reset them for the next test.
     prefs.setBoolPref("sendReport", originalSendReport);
     prefs.setBoolPref("emailMe", originalEmailMe);
     prefs.setBoolPref("includeURL", originalIncludeURL);
     prefs.setCharPref("email", originalEmail);
   });
 });
-
--- a/browser/base/content/test/tabcrashed/browser_showForm.js
+++ b/browser/base/content/test/tabcrashed/browser_showForm.js
@@ -21,16 +21,17 @@ add_task(async function test_show_form()
     let pref = TabCrashHandler.prefs.root + "sendReport";
     await SpecialPowers.pushPrefEnv({
       set: [[pref, true]]
     });
 
     // Now crash the browser.
     await BrowserTestUtils.crashBrowser(browser);
 
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     let doc = browser.contentDocument;
 
     // Ensure the checkbox is checked. We can safely reach into
     // the content since about:tabcrashed is an in-process URL.
     let checkbox = doc.getElementById("sendReport");
     ok(checkbox.checked, "Send report checkbox is checked.");
 
     // Ensure the options form is displayed.
--- a/browser/base/content/test/tabcrashed/browser_shown.js
+++ b/browser/base/content/test/tabcrashed/browser_shown.js
@@ -51,16 +51,17 @@ function crashTabTestHelper(fieldValues,
     let prefs = TabCrashHandler.prefs;
     let originalSendReport = prefs.getBoolPref("sendReport");
     let originalEmailMe = prefs.getBoolPref("emailMe");
     let originalIncludeURL = prefs.getBoolPref("includeURL");
     let originalEmail = prefs.getCharPref("email");
 
     let tab = gBrowser.getTabForBrowser(browser);
     await BrowserTestUtils.crashBrowser(browser);
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     let doc = browser.contentDocument;
 
     // Since about:tabcrashed will run in the parent process, we can safely
     // manipulate its DOM nodes directly
     let comments = doc.getElementById("comments");
     let email = doc.getElementById("email");
     let emailMe = doc.getElementById("emailMe");
     let includeURL = doc.getElementById("includeURL");
@@ -77,16 +78,17 @@ function crashTabTestHelper(fieldValues,
       emailMe.checked = fieldValues.emailMe;
     }
 
     if (fieldValues.hasOwnProperty("includeURL")) {
       includeURL.checked = fieldValues.includeURL;
     }
 
     let crashReport = promiseCrashReport(expectedExtra);
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     let restoreTab = browser.contentDocument.getElementById("restoreTab");
     restoreTab.click();
     await BrowserTestUtils.waitForEvent(tab, "SSTabRestored");
     await crashReport;
 
     // Submitting the crash report may have set some prefs regarding how to
     // send tab crash reports. Let's reset them for the next test.
     prefs.setBoolPref("sendReport", originalSendReport);
@@ -173,9 +175,8 @@ add_task(async function test_send_all() 
     email: EMAIL,
     comments: COMMENTS,
   }, {
     "Comments": COMMENTS,
     "URL": PAGE,
     "Email": EMAIL,
   });
 });
-
--- a/browser/base/content/test/webextensions/browser_extension_sideloading.js
+++ b/browser/base/content/test/webextensions/browser_extension_sideloading.js
@@ -128,16 +128,17 @@ add_task(async function() {
   addons.children[0].click();
 
   // When we get the permissions prompt, we should be at the extensions
   // list in about:addons
   let panel = await popupPromise;
   is(gBrowser.currentURI.spec, "about:addons", "Foreground tab is at about:addons");
 
   const VIEW = "addons://list/extension";
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let win = gBrowser.selectedBrowser.contentWindow;
   ok(!win.gViewController.isLoading, "about:addons view is fully loaded");
   is(win.gViewController.currentViewId, VIEW, "about:addons is at extensions list");
 
   // Check the contents of the notification, then choose "Cancel"
   checkNotification(panel, /\/foo-icon\.png$/, [
     ["webextPerms.hostDescription.allUrls"],
     ["webextPerms.description.history"],
@@ -163,16 +164,17 @@ add_task(async function() {
   // Click the second sideloaded extension and wait for the notification
   popupPromise = promisePopupNotificationShown("addon-webext-permissions");
   addons.children[0].click();
   panel = await popupPromise;
 
   // Again we should be at the extentions list in about:addons
   is(gBrowser.currentURI.spec, "about:addons", "Foreground tab is at about:addons");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   win = gBrowser.selectedBrowser.contentWindow;
   ok(!win.gViewController.isLoading, "about:addons view is fully loaded");
   is(win.gViewController.currentViewId, VIEW, "about:addons is at extensions list");
 
   // Check the notification contents.
   checkNotification(panel, DEFAULT_ICON_URL, []);
 
   // This time accept the install.
--- a/browser/components/contextualidentity/test/browser/browser_usercontext.js
+++ b/browser/components/contextualidentity/test/browser/browser_usercontext.js
@@ -64,16 +64,17 @@ add_task(async function test() {
 
     let tab = openTabInUserContext(BASE_URI, userContextId);
 
     // wait for load
     let browser = gBrowser.getBrowserForTab(tab);
     await BrowserTestUtils.browserLoaded(browser);
 
     // get the title
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     let title = browser.contentDocument.title.trim().split("|");
 
     // check each item in the title and validate it meets expectatations
     for (let part of title) {
       let [storageMethodName, value] = part.split("=");
       is(value, expectedContext,
             "the title reflects the expected contextual identity of " +
             expectedContext + " for method " + storageMethodName + ": " + value);
--- a/browser/components/customizableui/test/browser_947914_button_addons.js
+++ b/browser/components/customizableui/test/browser_947914_button_addons.js
@@ -19,16 +19,17 @@ add_task(async function() {
   let addonsButton = document.getElementById("add-ons-button");
   ok(addonsButton, "Add-ons button exists in Panel Menu");
   addonsButton.click();
 
   newTab = gBrowser.selectedTab;
   await waitForCondition(() => gBrowser.currentURI &&
                                gBrowser.currentURI.spec == "about:addons");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let addonsPage = gBrowser.selectedBrowser.contentWindow.document.
                             getElementById("addons-page");
   ok(addonsPage, "Add-ons page was opened");
 });
 
 add_task(async function asyncCleanup() {
   CustomizableUI.reset();
   BrowserTestUtils.addTab(gBrowser, initialLocation);
--- a/browser/components/preferences/in-content/tests/browser_applications_selection.js
+++ b/browser/components/preferences/in-content/tests/browser_applications_selection.js
@@ -3,25 +3,27 @@ var feedItem;
 var container;
 
 SimpleTest.requestCompleteLog();
 
 add_task(async function setup() {
   await openPreferencesViaOpenPreferencesAPI("general", { leaveOpen: true });
   info("Preferences page opened on the general pane.");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   await gBrowser.selectedBrowser.contentWindow.promiseLoadHandlersList;
   info("Apps list loaded.");
 
   registerCleanupFunction(() => {
     gBrowser.removeCurrentTab();
   });
 });
 
 add_task(async function getFeedItem() {
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   win = gBrowser.selectedBrowser.contentWindow;
 
   container = win.document.getElementById("handlersView");
   feedItem = container.querySelector("richlistitem[type='application/vnd.mozilla.maybe.feed']");
   Assert.ok(feedItem, "feedItem is present in handlersView.");
 });
 
 add_task(async function selectInternalOptionForFeed() {
@@ -77,16 +79,17 @@ add_task(async function reselectInternal
   Assert.ok(list.selectedItem,
             "Should have a selected item");
   Assert.equal(list.selectedItem.getAttribute("action"),
                Ci.nsIHandlerInfo.handleInternally,
                "Selected item should still be the same as the previously selected item.");
 });
 
 add_task(async function sortingCheck() {
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   win = gBrowser.selectedBrowser.contentWindow;
 
   const handlerView = win.document.getElementById("handlersView");
   const typeColumn = win.document.getElementById("typeColumn");
   Assert.ok(typeColumn, "typeColumn is present in handlersView.");
 
   // Test default sorting
   assertSortByType("ascending");
--- a/browser/components/preferences/in-content/tests/browser_basic_rebuild_fonts_test.js
+++ b/browser/components/preferences/in-content/tests/browser_basic_rebuild_fonts_test.js
@@ -1,17 +1,19 @@
 Services.prefs.setBoolPref("browser.preferences.instantApply", true);
 
 registerCleanupFunction(function() {
   Services.prefs.clearUserPref("browser.preferences.instantApply");
 });
 
 add_task(async function() {
   await openPreferencesViaOpenPreferencesAPI("general", { leaveOpen: true });
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   await gBrowser.contentWindow.gMainPane._selectDefaultLanguageGroupPromise;
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
   var langGroup = Services.prefs.getComplexValue("font.language.group", Ci.nsIPrefLocalizedString).data;
   is(doc.getElementById("font.language.group").value, langGroup,
      "Language group should be set correctly.");
 
   let defaultFontType = Services.prefs.getCharPref("font.default." + langGroup);
   let fontFamily = Services.prefs.getCharPref("font.name." + defaultFontType + "." + langGroup);
   let fontFamilyField = doc.getElementById("defaultFont");
--- a/browser/components/preferences/in-content/tests/browser_bug1018066_resetScrollPosition.js
+++ b/browser/components/preferences/in-content/tests/browser_bug1018066_resetScrollPosition.js
@@ -8,16 +8,18 @@ registerCleanupFunction(function() {
     gBrowser.removeTab(gBrowser.tabs[1]);
 });
 
 add_task(async function() {
   originalWindowHeight = window.outerHeight;
   window.resizeTo(window.outerWidth, 300);
   let prefs = await openPreferencesViaOpenPreferencesAPI("paneSearch", {leaveOpen: true});
   is(prefs.selectedPane, "paneSearch", "Search pane was selected");
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let mainContent = gBrowser.contentDocument.querySelector(".main-content");
   mainContent.scrollTop = 50;
   is(mainContent.scrollTop, 50, "main-content should be scrolled 50 pixels");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   gBrowser.contentWindow.gotoPref("paneGeneral");
   is(mainContent.scrollTop, 0,
      "Switching to a different category should reset the scroll position");
 });
--- a/browser/components/preferences/in-content/tests/browser_bug1020245_openPreferences_to_paneContent.js
+++ b/browser/components/preferences/in-content/tests/browser_bug1020245_openPreferences_to_paneContent.js
@@ -1,11 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
+/* eslint-disable mozilla/no-cpows-in-tests */
+
 Services.prefs.setBoolPref("browser.preferences.instantApply", true);
 
 registerCleanupFunction(function() {
   Services.prefs.clearUserPref("browser.preferences.instantApply");
 });
 
 // Test opening to the differerent panes and subcategories in Preferences
 add_task(async function() {
--- a/browser/components/preferences/in-content/tests/browser_bug1184989_prevent_scrolling_when_preferences_flipped.js
+++ b/browser/components/preferences/in-content/tests/browser_bug1184989_prevent_scrolling_when_preferences_flipped.js
@@ -4,16 +4,17 @@ const {Utils} = Cu.import("resource://gr
 const triggeringPrincipal_base64 = Utils.SERIALIZED_SYSTEMPRINCIPAL;
 
 add_task(async function() {
   waitForExplicitFinish();
 
   const tabURL = getRootDirectory(gTestPath) + "browser_bug1184989_prevent_scrolling_when_preferences_flipped.xul";
 
   await BrowserTestUtils.withNewTab({ gBrowser, url: tabURL }, async function(browser) {
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     let doc = browser.contentDocument;
     let container = doc.getElementById("container");
 
     // Test button
     let button = doc.getElementById("button");
     button.focus();
     EventUtils.synthesizeKey(" ", {});
     await checkPageScrolling(container, "button");
@@ -36,16 +37,17 @@ add_task(async function() {
     // Test radio
     let radiogroup = doc.getElementById("radiogroup");
     radiogroup.focus();
     EventUtils.synthesizeKey(" ", {});
     await checkPageScrolling(container, "radio");
   });
 
   await BrowserTestUtils.withNewTab({ gBrowser, url: "about:preferences#search" }, async function(browser) {
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     let doc = browser.contentDocument;
     let container = doc.getElementsByClassName("main-content")[0];
 
     // Test search
     let engineList = doc.getElementById("engineList");
     engineList.focus();
     EventUtils.synthesizeKey(" ", {});
     is(engineList.view.selection.currentIndex, 0, "Search engineList is selected");
--- a/browser/components/preferences/in-content/tests/browser_bug410900.js
+++ b/browser/components/preferences/in-content/tests/browser_bug410900.js
@@ -17,19 +17,21 @@ function test() {
               getService(Ci.nsIExternalProtocolService);
   var info = extps.getProtocolHandlerInfo("apppanetest");
   info.possibleApplicationHandlers.appendElement(handler);
 
   var hserv = Cc["@mozilla.org/uriloader/handler-service;1"].
               getService(Ci.nsIHandlerService);
   hserv.store(info);
 
+  /* eslint-disable mozilla/no-cpows-in-tests */
   openPreferencesViaOpenPreferencesAPI("general", {leaveOpen: true})
   .then(() => gBrowser.selectedBrowser.contentWindow.promiseLoadHandlersList)
   .then(() => runTest(gBrowser.selectedBrowser.contentWindow));
+  /* eslint-enable mozilla/no-cpows-in-tests */
 }
 
 function runTest(win) {
   var rbox = win.document.getElementById("handlersView");
   ok(rbox, "handlersView is present");
 
   var items = rbox && rbox.getElementsByTagName("richlistitem");
   ok(items && items.length > 0, "App handler list populated");
--- a/browser/components/preferences/in-content/tests/browser_change_app_handler.js
+++ b/browser/components/preferences/in-content/tests/browser_change_app_handler.js
@@ -14,16 +14,17 @@ function setupFakeHandler() {
   gHandlerSvc.store(infoToModify);
 }
 
 add_task(async function() {
   setupFakeHandler();
 
   let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
   is(prefs.selectedPane, "paneGeneral", "General pane was selected");
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let win = gBrowser.selectedBrowser.contentWindow;
 
   let container = win.document.getElementById("handlersView");
   let ourItem = container.querySelector("richlistitem[type='text/x-test-handler']");
   ok(ourItem, "handlersView is present");
   ourItem.scrollIntoView();
   container.selectItem(ourItem);
   ok(ourItem.selected, "Should be able to select our item.");
@@ -93,9 +94,8 @@ add_task(async function() {
   gBrowser.removeCurrentTab();
   await tabRemovedPromise;
 });
 
 registerCleanupFunction(function() {
   let infoToModify = gMimeSvc.getFromTypeAndExtension("text/x-test-handler", null);
   gHandlerSvc.remove(infoToModify);
 });
-
--- a/browser/components/preferences/in-content/tests/browser_checkspelling.js
+++ b/browser/components/preferences/in-content/tests/browser_checkspelling.js
@@ -1,16 +1,17 @@
 add_task(async function() {
   SpecialPowers.pushPrefEnv({set: [
     ["layout.spellcheckDefault", 2]
   ]});
 
   let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
   is(prefs.selectedPane, "paneGeneral", "General pane was selected");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
   let checkbox = doc.querySelector("#checkSpelling");
   is(checkbox.checked,
      Services.prefs.getIntPref("layout.spellcheckDefault") == 2,
      "checkbox should represent pref value before clicking on checkbox");
   ok(checkbox.checked, "checkbox should be checked before clicking on checkbox");
 
   checkbox.click();
--- a/browser/components/preferences/in-content/tests/browser_cookies_exceptions.js
+++ b/browser/components/preferences/in-content/tests/browser_cookies_exceptions.js
@@ -323,16 +323,17 @@ var testRunner = {
         },
       };
 
       registerCleanupFunction(function() {
         Services.prefs.clearUserPref("privacy.history.custom");
       });
 
       openPreferencesViaOpenPreferencesAPI("panePrivacy", {leaveOpen: true}).then(function() {
+        // eslint-disable-next-line mozilla/no-cpows-in-tests
         let doc = gBrowser.contentDocument;
         let historyMode = doc.getElementById("historyMode");
         historyMode.value = "custom";
         historyMode.doCommand();
 
         let promiseSubDialogLoaded =
           promiseLoadSubDialog("chrome://browser/content/preferences/permissions.xul");
         doc.getElementById("cookieExceptions").doCommand();
--- a/browser/components/preferences/in-content/tests/browser_engines.js
+++ b/browser/components/preferences/in-content/tests/browser_engines.js
@@ -1,12 +1,13 @@
 // Test Engine list
 add_task(async function() {
   let prefs = await openPreferencesViaOpenPreferencesAPI("search", {leaveOpen: true});
   is(prefs.selectedPane, "paneSearch", "Search pane is selected by default");
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
 
   let tree = doc.querySelector("#engineList");
   ok(!tree.hidden, "The search engine list should be visible when Search is requested");
 
   // Check for default search engines to be displayed in the engineList
   let defaultEngines = Services.search.getDefaultEngines();
   for (let i = 0; i < defaultEngines.length; i++) {
@@ -18,9 +19,8 @@ add_task(async function() {
   // Avoid duplicated keywords
   tree.view.setCellText(0, tree.columns.getNamedColumn("engineKeyword"), "keyword");
   tree.view.setCellText(1, tree.columns.getNamedColumn("engineKeyword"), "keyword");
   let cellKeyword = tree.view.getCellText(1, tree.columns.getNamedColumn("engineKeyword"));
   isnot(cellKeyword, "keyword", "Do not allow duplicated keywords");
 
   await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
-
--- a/browser/components/preferences/in-content/tests/browser_extension_controlled.js
+++ b/browser/components/preferences/in-content/tests/browser_extension_controlled.js
@@ -43,30 +43,32 @@ function waitForMutation(target, opts, c
       }
     });
     observer.observe(target, opts);
   });
 }
 
 function waitForMessageChange(messageId, cb) {
   return waitForMutation(
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     gBrowser.contentDocument.getElementById(messageId),
     { attributes: true, attributeFilter: ["hidden"] }, cb);
 }
 
 function waitForMessageHidden(messageId) {
   return waitForMessageChange(messageId, target => target.hidden);
 }
 
 function waitForMessageShown(messageId) {
   return waitForMessageChange(messageId, target => !target.hidden);
 }
 
 add_task(async function testExtensionControlledHomepage() {
   await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
   is(gBrowser.currentURI.spec, "about:preferences#general",
      "#general should be in the URI for about:preferences");
   let homepagePref = () => Services.prefs.getCharPref("browser.startup.homepage");
   let originalHomepagePref = homepagePref();
   let extensionHomepage = "https://developer.mozilla.org/";
   let controlledContent = doc.getElementById("browserHomePageExtensionContent");
 
@@ -106,16 +108,17 @@ add_task(async function testExtensionCon
   // Do the uninstall now that the enable code has been run.
   addon.uninstall();
 
   await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
 
 add_task(async function testPrefLockedHomepage() {
   await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
   is(gBrowser.currentURI.spec, "about:preferences#general",
      "#general should be in the URI for about:preferences");
 
   let homePagePref = "browser.startup.homepage";
   let buttonPrefs = [
     "pref.browser.homepage.disable_button.current_page",
     "pref.browser.homepage.disable_button.bookmark_page",
@@ -237,16 +240,17 @@ add_task(async function testPrefLockedHo
   is(controlledContent.hidden, true,
      "The extension controlled message is hidden when unlocked with no extension");
 
   await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
 
 add_task(async function testExtensionControlledNewTab() {
   await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
   is(gBrowser.currentURI.spec, "about:preferences#general",
      "#general should be in the URI for about:preferences");
 
   let controlledContent = doc.getElementById("browserNewTabExtensionContent");
 
   // The new tab is set to the default and message is hidden.
   ok(!aboutNewTabService.newTabURL.startsWith("moz-extension:"), "new tab is not set");
@@ -276,16 +280,17 @@ add_task(async function testExtensionCon
   await BrowserTestUtils.removeTab(gBrowser.selectedTab);
   let addon = await AddonManager.getAddonByID("@set_newtab");
   addon.uninstall();
 });
 
 add_task(async function testExtensionControlledHomepageUninstalledAddon() {
   async function checkHomepageEnabled() {
     await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     let doc = gBrowser.contentDocument;
     is(gBrowser.currentURI.spec, "about:preferences#general",
       "#general should be in the URI for about:preferences");
     let controlledContent = doc.getElementById("browserHomePageExtensionContent");
 
     // The homepage is enabled.
     let homepageInut = doc.getElementById("browserHomePage");
     is(homepageInut.disabled, false, "The homepage input is enabled");
--- a/browser/components/preferences/in-content/tests/browser_homepages_filter_aboutpreferences.js
+++ b/browser/components/preferences/in-content/tests/browser_homepages_filter_aboutpreferences.js
@@ -1,12 +1,13 @@
 add_task(async function testSetHomepageUseCurrent() {
   is(gBrowser.currentURI.spec, "about:blank", "Test starts with about:blank open");
   await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:home");
   await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
   is(gBrowser.currentURI.spec, "about:preferences#general",
      "#general should be in the URI for about:preferences");
   let oldHomepagePref = Services.prefs.getCharPref("browser.startup.homepage");
 
   let useCurrent = doc.getElementById("useCurrent");
   useCurrent.click();
 
--- a/browser/components/preferences/in-content/tests/browser_layersacceleration.js
+++ b/browser/components/preferences/in-content/tests/browser_layersacceleration.js
@@ -2,16 +2,17 @@ add_task(async function() {
   SpecialPowers.pushPrefEnv({set: [
     ["gfx.direct2d.disabled", false],
     ["layers.acceleration.disabled", false]
   ]});
 
   let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
   is(prefs.selectedPane, "paneGeneral", "General pane was selected");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
   let checkbox = doc.querySelector("#allowHWAccel");
   is(!checkbox.checked,
      Services.prefs.getBoolPref("layers.acceleration.disabled"),
      "checkbox should represent inverted pref value before clicking on checkbox");
 
   checkbox.click();
 
--- a/browser/components/preferences/in-content/tests/browser_masterpassword.js
+++ b/browser/components/preferences/in-content/tests/browser_masterpassword.js
@@ -1,12 +1,13 @@
 add_task(async function() {
   let prefs = await openPreferencesViaOpenPreferencesAPI("panePrivacy", {leaveOpen: true});
   is(prefs.selectedPane, "panePrivacy", "Privacy pane was selected");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
   // Fake the subdialog and LoginHelper
   let win = doc.defaultView;
   let dialogURL = "";
   win.gSubDialog = {
     open(aDialogURL, unused, unused2, aCallback) {
       dialogURL = aDialogURL;
       masterPasswordSet = masterPasswordNextState;
--- a/browser/components/preferences/in-content/tests/browser_notifications_do_not_disturb.js
+++ b/browser/components/preferences/in-content/tests/browser_notifications_do_not_disturb.js
@@ -6,16 +6,17 @@ registerCleanupFunction(function() {
   while (gBrowser.tabs[1])
     gBrowser.removeTab(gBrowser.tabs[1]);
 });
 
 add_task(async function() {
   let prefs = await openPreferencesViaOpenPreferencesAPI("panePrivacy", {leaveOpen: true});
   is(prefs.selectedPane, "panePrivacy", "Privacy pane was selected");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
   let notificationsDoNotDisturbBox = doc.getElementById("notificationsDoNotDisturbBox");
   if (notificationsDoNotDisturbBox.hidden) {
     todo(false, "Do not disturb is not available on this platform");
     return;
   }
 
   let alertService;
--- a/browser/components/preferences/in-content/tests/browser_performance.js
+++ b/browser/components/preferences/in-content/tests/browser_performance.js
@@ -8,16 +8,17 @@ add_task(async function() {
     ["browser.preferences.defaultPerformanceSettings.enabled", true],
   ]});
 });
 
 add_task(async function() {
   let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
   is(prefs.selectedPane, "paneGeneral", "General pane was selected");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
   let useRecommendedPerformanceSettings = doc.querySelector("#useRecommendedPerformanceSettings");
 
   is(Services.prefs.getBoolPref("browser.preferences.defaultPerformanceSettings.enabled"), true,
     "pref value should be true before clicking on checkbox");
   ok(useRecommendedPerformanceSettings.checked, "checkbox should be checked before clicking on checkbox");
 
   useRecommendedPerformanceSettings.click();
@@ -73,16 +74,17 @@ add_task(async function() {
   Services.prefs.setBoolPref("browser.preferences.defaultPerformanceSettings.enabled", true);
   await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
 
 add_task(async function() {
   let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
   is(prefs.selectedPane, "paneGeneral", "General pane was selected");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
   let useRecommendedPerformanceSettings = doc.querySelector("#useRecommendedPerformanceSettings");
   let allowHWAccel = doc.querySelector("#allowHWAccel");
   let contentProcessCount = doc.querySelector("#contentProcessCount");
   let performanceSettings = doc.querySelector("#performanceSettings");
 
   useRecommendedPerformanceSettings.click();
   allowHWAccel.click();
@@ -98,16 +100,17 @@ add_task(async function() {
   Services.prefs.setBoolPref("browser.preferences.defaultPerformanceSettings.enabled", true);
   await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
 
 add_task(async function() {
   let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
   is(prefs.selectedPane, "paneGeneral", "General pane was selected");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
   let performanceSettings = doc.querySelector("#performanceSettings");
 
   is(performanceSettings.hidden, true, "performance settings section should not be shown");
 
   Services.prefs.setBoolPref("browser.preferences.defaultPerformanceSettings.enabled", false);
 
   is(performanceSettings.hidden, false, "performance settings section should be shown");
@@ -117,16 +120,17 @@ add_task(async function() {
 });
 
 add_task(async function() {
   Services.prefs.setIntPref("dom.ipc.processCount", 7);
 
   let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
   is(prefs.selectedPane, "paneGeneral", "General pane was selected");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
 
   let performanceSettings = doc.querySelector("#performanceSettings");
   is(performanceSettings.hidden, false, "performance settings section should be shown");
 
   let contentProcessCount = doc.querySelector("#contentProcessCount");
   is(Services.prefs.getIntPref("dom.ipc.processCount"), 7, "pref value should be 7");
   is(contentProcessCount.selectedItem.value, 7, "selected item should be 7");
@@ -136,16 +140,17 @@ add_task(async function() {
 });
 
 add_task(async function() {
   Services.prefs.setBoolPref("layers.acceleration.disabled", true);
 
   let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
   is(prefs.selectedPane, "paneGeneral", "General pane was selected");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
 
   let performanceSettings = doc.querySelector("#performanceSettings");
   is(performanceSettings.hidden, false, "performance settings section should be shown");
 
   let allowHWAccel = doc.querySelector("#allowHWAccel");
   is(Services.prefs.getBoolPref("layers.acceleration.disabled"), true,
     "pref value is false");
--- a/browser/components/preferences/in-content/tests/browser_performance_e10srollout.js
+++ b/browser/components/preferences/in-content/tests/browser_performance_e10srollout.js
@@ -11,16 +11,17 @@ add_task(async function() {
 
 add_task(async function testPrefsAreDefault() {
   Services.prefs.setIntPref("dom.ipc.processCount", DEFAULT_PROCESS_COUNT);
   Services.prefs.setBoolPref("browser.preferences.defaultPerformanceSettings.enabled", true);
 
   let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
   is(prefs.selectedPane, "paneGeneral", "General pane was selected");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
   let useRecommendedPerformanceSettings = doc.querySelector("#useRecommendedPerformanceSettings");
 
   is(Services.prefs.getBoolPref("browser.preferences.defaultPerformanceSettings.enabled"), true,
      "pref value should be true before clicking on checkbox");
   ok(useRecommendedPerformanceSettings.checked, "checkbox should be checked before clicking on checkbox");
 
   useRecommendedPerformanceSettings.click();
@@ -45,16 +46,17 @@ add_task(async function testPrefsAreDefa
 
 add_task(async function testPrefsSetByUser() {
   Services.prefs.setIntPref("dom.ipc.processCount", DEFAULT_PROCESS_COUNT + 2);
   Services.prefs.setBoolPref("browser.preferences.defaultPerformanceSettings.enabled", false);
 
   let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
   is(prefs.selectedPane, "paneGeneral", "General pane was selected");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
   let performanceSettings = doc.querySelector("#performanceSettings");
   is(performanceSettings.hidden, false, "performance settings section is shown");
 
   let contentProcessCount = doc.querySelector("#contentProcessCount");
   is(contentProcessCount.disabled, false, "process count control should be enabled");
   is(Services.prefs.getIntPref("dom.ipc.processCount"), DEFAULT_PROCESS_COUNT + 2, "process count should be the set value");
   is(contentProcessCount.selectedItem.value, DEFAULT_PROCESS_COUNT + 2, "selected item should be the set one");
--- a/browser/components/preferences/in-content/tests/browser_performance_non_e10s.js
+++ b/browser/components/preferences/in-content/tests/browser_performance_non_e10s.js
@@ -8,16 +8,17 @@ add_task(async function() {
     ["browser.preferences.defaultPerformanceSettings.enabled", true],
   ]});
 });
 
 add_task(async function() {
   let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
   is(prefs.selectedPane, "paneGeneral", "General pane was selected");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
   let useRecommendedPerformanceSettings = doc.querySelector("#useRecommendedPerformanceSettings");
 
   is(Services.prefs.getBoolPref("browser.preferences.defaultPerformanceSettings.enabled"), true,
     "pref value should be true before clicking on checkbox");
   ok(useRecommendedPerformanceSettings.checked, "checkbox should be checked before clicking on checkbox");
 
   useRecommendedPerformanceSettings.click();
@@ -61,16 +62,17 @@ add_task(async function() {
   Services.prefs.setBoolPref("browser.preferences.defaultPerformanceSettings.enabled", true);
   await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
 
 add_task(async function() {
   let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
   is(prefs.selectedPane, "paneGeneral", "General pane was selected");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
   let performanceSettings = doc.querySelector("#performanceSettings");
 
   is(performanceSettings.hidden, true, "performance settings section should not be shown");
 
   Services.prefs.setBoolPref("browser.preferences.defaultPerformanceSettings.enabled", false);
 
   is(performanceSettings.hidden, false, "performance settings section should be shown");
@@ -80,16 +82,17 @@ add_task(async function() {
 });
 
 add_task(async function() {
   Services.prefs.setBoolPref("layers.acceleration.disabled", true);
 
   let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
   is(prefs.selectedPane, "paneGeneral", "General pane was selected");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = gBrowser.contentDocument;
 
   let performanceSettings = doc.querySelector("#performanceSettings");
   is(performanceSettings.hidden, false, "performance settings section should be shown");
 
   let allowHWAccel = doc.querySelector("#allowHWAccel");
   is(Services.prefs.getBoolPref("layers.acceleration.disabled"), true,
     "pref value is false");
--- a/browser/components/preferences/in-content/tests/browser_permissions_urlFieldHidden.js
+++ b/browser/components/preferences/in-content/tests/browser_permissions_urlFieldHidden.js
@@ -1,14 +1,15 @@
 "use strict";
 
 const PERMISSIONS_URL = "chrome://browser/content/preferences/permissions.xul";
 
 add_task(async function urlFieldVisibleForPopupPermissions(finish) {
   await openPreferencesViaOpenPreferencesAPI("panePrivacy", {leaveOpen: true});
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let win = gBrowser.selectedBrowser.contentWindow;
   let doc = win.document;
   let popupPolicyCheckbox = doc.getElementById("popupPolicy");
   ok(!popupPolicyCheckbox.checked, "popupPolicyCheckbox should be unchecked by default");
   popupPolicyCheckbox.click();
   let popupPolicyButton = doc.getElementById("popupPolicyButton");
   ok(popupPolicyButton, "popupPolicyButton found");
   let dialogPromise = promiseLoadSubDialog(PERMISSIONS_URL);
--- a/browser/components/preferences/in-content/tests/browser_sanitizeOnShutdown_prefLocked.js
+++ b/browser/components/preferences/in-content/tests/browser_sanitizeOnShutdown_prefLocked.js
@@ -3,16 +3,17 @@
 function switchToCustomHistoryMode(doc) {
   // Select the last item in the menulist.
   let menulist = doc.getElementById("historyMode");
   menulist.focus();
   EventUtils.sendKey("UP");
 }
 
 function testPrefStateMatchesLockedState() {
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let win = gBrowser.contentWindow;
   let doc = win.document;
   switchToCustomHistoryMode(doc);
 
   let checkbox = doc.getElementById("alwaysClear");
   let preference = doc.getElementById("privacy.sanitize.sanitizeOnShutdown");
   is(checkbox.disabled, preference.locked, "Always Clear checkbox should be enabled when preference is not locked.");
 
--- a/browser/components/preferences/in-content/tests/browser_search_within_preferences_1.js
+++ b/browser/components/preferences/in-content/tests/browser_search_within_preferences_1.js
@@ -1,13 +1,15 @@
 "use strict";
 /**
  * This file contains tests for the Preferences search bar.
  */
 
+/* eslint-disable mozilla/no-cpows-in-tests */
+
 requestLongerTimeout(6);
 
 /**
  * Tests to see if search bar is being shown when pref is turned on
  */
 add_task(async function() {
   await openPreferencesViaOpenPreferencesAPI("paneGeneral", { leaveOpen: true });
   let searchInput = gBrowser.contentDocument.getElementById("searchInput");
--- a/browser/components/preferences/in-content/tests/browser_search_within_preferences_2.js
+++ b/browser/components/preferences/in-content/tests/browser_search_within_preferences_2.js
@@ -1,13 +1,15 @@
 "use strict";
 /**
  * This file contains tests for the Preferences search bar.
  */
 
+/* eslint-disable mozilla/no-cpows-in-tests */
+
 /**
  * Enabling searching functionality. Will display search bar from this testcase forward.
  */
 add_task(async function() {
   await SpecialPowers.pushPrefEnv({"set": [["browser.preferences.search", true]]});
 });
 
 /**
--- a/browser/components/preferences/in-content/tests/browser_search_within_preferences_command.js
+++ b/browser/components/preferences/in-content/tests/browser_search_within_preferences_command.js
@@ -1,10 +1,12 @@
 "use strict";
 
+/* eslint-disable mozilla/no-cpows-in-tests */
+
 /**
  * Test for "command" event on search input (when user clicks the x button)
  */
 add_task(async function() {
   await SpecialPowers.pushPrefEnv({"set": [["browser.storageManager.enabled", false]]});
   await openPreferencesViaOpenPreferencesAPI("privacy", {leaveOpen: true});
   let generalPane = gBrowser.contentDocument.getElementById("generalCategory");
 
--- a/browser/components/preferences/in-content/tests/browser_security-1.js
+++ b/browser/components/preferences/in-content/tests/browser_security-1.js
@@ -47,16 +47,17 @@ add_task(async function() {
     }
 
     is(checked, val1 && val2, "safebrowsing preference is initialized correctly");
     // should be disabled when checked is false (= pref is turned off)
     is(blockUncommon.hasAttribute("disabled"), !checked, "block uncommon checkbox is set correctly");
 
     // scroll the checkbox into the viewport and click checkbox
     checkbox.scrollIntoView();
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     EventUtils.synthesizeMouseAtCenter(checkbox, {}, gBrowser.selectedBrowser.contentWindow);
 
     // check that both settings are now turned on or off
     is(Services.prefs.getBoolPref("browser.safebrowsing.phishing.enabled"), !checked,
        "safebrowsing.enabled is set correctly");
     is(Services.prefs.getBoolPref("browser.safebrowsing.malware.enabled"), !checked,
        "safebrowsing.malware.enabled is set correctly");
 
--- a/browser/components/preferences/in-content/tests/browser_security-2.js
+++ b/browser/components/preferences/in-content/tests/browser_security-2.js
@@ -44,16 +44,17 @@ add_task(async function() {
     let blockUncommon = doc.getElementById("blockUncommonUnwanted");
     let checked = checkbox.checked;
     is(checked, val, "downloads preference is initialized correctly");
     // should be disabled when val is false (= pref is turned off)
     is(blockUncommon.hasAttribute("disabled"), !val, "block uncommon checkbox is set correctly");
 
     // scroll the checkbox into view, otherwise the synthesizeMouseAtCenter will be ignored, and click it
     checkbox.scrollIntoView();
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     EventUtils.synthesizeMouseAtCenter(checkbox, {}, gBrowser.selectedBrowser.contentWindow);
 
     // check that setting is now turned on or off
     is(Services.prefs.getBoolPref("browser.safebrowsing.downloads.enabled"), !checked,
        "safebrowsing.downloads preference is set correctly");
 
     // check if the uncommon warning checkbox has updated
     is(blockUncommon.hasAttribute("disabled"), val, "block uncommon checkbox is set correctly");
@@ -83,16 +84,17 @@ add_task(async function() {
 
     let doc = gBrowser.selectedBrowser.contentDocument;
     let checkbox = doc.getElementById("blockUncommonUnwanted");
     let checked = checkbox.checked;
     is(checked, val1 && val2, "unwanted/uncommon preference is initialized correctly");
 
     // scroll the checkbox into view, otherwise the synthesizeMouseAtCenter will be ignored, and click it
     checkbox.scrollIntoView();
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     EventUtils.synthesizeMouseAtCenter(checkbox, {}, gBrowser.selectedBrowser.contentWindow);
 
     // check that both settings are now turned on or off
     is(Services.prefs.getBoolPref("browser.safebrowsing.downloads.remote.block_potentially_unwanted"), !checked,
        "block_potentially_unwanted is set correctly");
     is(Services.prefs.getBoolPref("browser.safebrowsing.downloads.remote.block_uncommon"), !checked,
        "block_uncommon is set correctly");
 
--- a/browser/components/preferences/in-content/tests/browser_siteData.js
+++ b/browser/components/preferences/in-content/tests/browser_siteData.js
@@ -97,16 +97,17 @@ add_task(async function() {
   await SpecialPowers.pushPrefEnv({set: [["browser.storageManager.enabled", true]]});
 
   // Open a test site which would save into appcache
   await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_OFFLINE_URL);
   await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 
   // Open a test site which would save into quota manager
   await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_QUOTA_USAGE_URL);
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   await waitForEvent(gBrowser.selectedBrowser.contentWindow, "test-indexedDB-done");
   await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 
   let updatedPromise = promiseSiteDataManagerSitesUpdated();
   await openPreferencesViaOpenPreferencesAPI("privacy", { leaveOpen: true });
   await updatedPromise;
   await openSiteDataSettingsDialog();
   let dialog = content.gSubDialog._topDialog;
@@ -179,16 +180,17 @@ add_task(async function() {
 });
 
 // Test the function of the "Clear All Data" button
 add_task(async function() {
   await SpecialPowers.pushPrefEnv({set: [["browser.storageManager.enabled", true]]});
   addPersistentStoragePerm(TEST_QUOTA_USAGE_ORIGIN);
 
   await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_QUOTA_USAGE_URL);
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   await waitForEvent(gBrowser.selectedBrowser.contentWindow, "test-indexedDB-done");
   await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 
   await openPreferencesViaOpenPreferencesAPI("privacy", { leaveOpen: true });
 
   // Test the initial states
   let cacheUsage = await cacheUsageGetter.get();
   let quotaUsage = await getQuotaUsage(TEST_QUOTA_USAGE_ORIGIN);
--- a/browser/components/preferences/in-content/tests/browser_siteData2.js
+++ b/browser/components/preferences/in-content/tests/browser_siteData2.js
@@ -1,12 +1,14 @@
 "use strict";
 const { SiteDataManager } = Cu.import("resource:///modules/SiteDataManager.jsm", {});
 const REMOVE_DIALOG_URL = "chrome://browser/content/preferences/siteDataRemoveSelected.xul";
 
+/* eslint-disable mozilla/no-cpows-in-tests */
+
 function promiseSettingsDialogClose() {
   return new Promise(resolve => {
     let win = gBrowser.selectedBrowser.contentWindow;
     let dialogOverlay = win.gSubDialog._topDialog._overlay;
     let dialogWin = win.gSubDialog._topDialog._frame.contentWindow;
     dialogWin.addEventListener("unload", function unload() {
       if (dialogWin.document.documentURI === "chrome://browser/content/preferences/siteDataSettings.xul") {
         isnot(dialogOverlay.style.visibility, "visible", "The Settings dialog should be hidden");
--- a/browser/components/preferences/in-content/tests/browser_siteData3.js
+++ b/browser/components/preferences/in-content/tests/browser_siteData3.js
@@ -76,16 +76,17 @@ add_task(async function() {
       persisted: false
     },
   ];
 
   let updatedPromise = promiseSiteDataManagerSitesUpdated();
   await openPreferencesViaOpenPreferencesAPI("privacy", { leaveOpen: true });
   await updatedPromise;
   await openSiteDataSettingsDialog();
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let win = gBrowser.selectedBrowser.contentWindow;
   let dialogFrame = win.gSubDialog._topDialog._frame;
   let frameDoc = dialogFrame.contentDocument;
 
   let siteItems = frameDoc.getElementsByTagName("richlistitem");
   is(siteItems.length, 1, "Should group sites across scheme, port and origin attributes");
 
   let expected = "account.xyz.com";
--- a/browser/components/search/test/browser_aboutSearchReset.js
+++ b/browser/components/search/test/browser_aboutSearchReset.js
@@ -56,16 +56,17 @@ var gTests = [
                       getSubmission(kSearchStr, null, kSearchPurpose).
                       uri.spec;
 
     let rawEngine = engine.wrappedJSObject;
     let initialHash = rawEngine.getAttr("loadPathHash");
     rawEngine.setAttr("loadPathHash", "broken");
 
     let loadPromise = promiseStoppedLoad(expectedURL);
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     gBrowser.contentDocument.getElementById("searchResetKeepCurrent").click();
     await loadPromise;
 
     is(engine, Services.search.currentEngine,
        "the custom engine is still default");
     is(rawEngine.getAttr("loadPathHash"), initialHash,
        "the loadPathHash has been fixed");
 
@@ -73,16 +74,17 @@ var gTests = [
   }
 },
 
 {
   desc: "Test the 'Restore Search Defaults' button.",
   async run() {
     let currentEngine = Services.search.currentEngine;
     let originalEngine = Services.search.originalDefaultEngine;
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     let doc = gBrowser.contentDocument;
     let defaultEngineSpan = doc.getElementById("defaultEngine");
     is(defaultEngineSpan.textContent, originalEngine.name,
        "the name of the original default engine is displayed");
 
     let expectedURL = originalEngine.
                       getSubmission(kSearchStr, null, kSearchPurpose).
                       uri.spec;
@@ -102,16 +104,17 @@ var gTests = [
 },
 
 {
   desc: "Click the settings link.",
   async run() {
     let loadPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser,
                                                      false,
                                                      "about:preferences");
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     gBrowser.contentDocument.getElementById("linkSettingsPage").click();
     await loadPromise;
 
     checkTelemetryRecords(TELEMETRY_RESULT_ENUM.OPENED_SETTINGS);
   }
 },
 
 {
--- a/browser/components/sessionstore/test/browser_480893.js
+++ b/browser/components/sessionstore/test/browser_480893.js
@@ -11,16 +11,17 @@ add_task(async function() {
     ]
   });
 
   let tab = BrowserTestUtils.addTab(gBrowser, "about:sessionrestore");
   gBrowser.selectedTab = tab;
   let browser = tab.linkedBrowser;
   await BrowserTestUtils.browserLoaded(browser, false, "about:sessionrestore");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = browser.contentDocument;
 
   // Click on the "Close" button after about:sessionrestore is loaded.
   doc.getElementById("errorCancel").click();
 
   await BrowserTestUtils.browserLoaded(browser, false, "about:blank");
 
   // Test that starting a new session loads the homepage (set to http://mochi.test:8888)
@@ -30,16 +31,17 @@ add_task(async function() {
     "set": [
       ["browser.startup.homepage", homepage],
       ["browser.startup.page", 1],
     ]
   });
 
   browser.loadURI("about:sessionrestore");
   await BrowserTestUtils.browserLoaded(browser, false, "about:sessionrestore");
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   doc = browser.contentDocument;
 
   // Click on the "Close" button after about:sessionrestore is loaded.
   doc.getElementById("errorCancel").click();
   await BrowserTestUtils.browserLoaded(browser);
 
   is(browser.currentURI.spec, homepage, "loaded page is the homepage");
 
--- a/browser/components/sessionstore/test/browser_590563.js
+++ b/browser/components/sessionstore/test/browser_590563.js
@@ -27,23 +27,25 @@ function test() {
         middleClickTest(win);
       }, win);
     });
   });
 }
 
 async function middleClickTest(win) {
   let browser = win.gBrowser.selectedBrowser;
+  /* eslint-disable mozilla/no-cpows-in-tests */
   let tabsToggle = browser.contentDocument.getElementById("tabsToggle");
   EventUtils.synthesizeMouseAtCenter(tabsToggle, { button: 0 }, browser.contentWindow);
   let treeContainer = browser.contentDocument.querySelector(".tree-container");
   await BrowserTestUtils.waitForCondition(() => win.getComputedStyle(treeContainer).visibility == "visible");
 
   let tree = browser.contentDocument.getElementById("tabList");
   is(tree.view.rowCount, 3, "There should be three items");
+  /* eslint-enable mozilla/no-cpows-in-tests */
 
   // click on the first tab item
   var rect = tree.treeBoxObject.getCoordsForCellItem(1, tree.columns[1], "text");
   EventUtils.synthesizeMouse(tree.body, rect.x, rect.y, { button: 1 },
                              browser.contentWindow);
   // click on the second tab item
   rect = tree.treeBoxObject.getCoordsForCellItem(2, tree.columns[1], "text");
   EventUtils.synthesizeMouse(tree.body, rect.x, rect.y, { button: 1 },
--- a/browser/components/sessionstore/test/browser_705597.js
+++ b/browser/components/sessionstore/test/browser_705597.js
@@ -42,16 +42,17 @@ function test() {
           waitForBrowserState(blankState, finish);
         });
 
         // Force reload the browser to deprecate the subframes.
         browser.reloadWithFlags(Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE);
       });
 
       // Create a dynamic subframe.
+      // eslint-disable-next-line mozilla/no-cpows-in-tests
       let doc = browser.contentDocument;
       let iframe = doc.createElement("iframe");
       doc.body.appendChild(iframe);
       iframe.setAttribute("src", "about:mozilla");
     });
   });
 }
 
--- a/browser/components/sessionstore/test/browser_707862.js
+++ b/browser/components/sessionstore/test/browser_707862.js
@@ -41,16 +41,17 @@ function test() {
           });
         });
 
         // Force reload the browser to deprecate the subframes.
         browser.reloadWithFlags(Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE);
       });
 
       // Create a dynamic subframe.
+      // eslint-disable-next-line mozilla/no-cpows-in-tests
       let doc = browser.contentDocument;
       let iframe = doc.createElement("iframe");
       doc.body.appendChild(iframe);
       iframe.setAttribute("src", "about:mozilla");
     });
   });
 
   // This test relies on the test timing out in order to indicate failure so
--- a/browser/components/sessionstore/test/browser_aboutSessionRestore.js
+++ b/browser/components/sessionstore/test/browser_aboutSessionRestore.js
@@ -24,16 +24,17 @@ add_task(async function() {
   await promiseBrowserLoaded(browser);
 
   // Fake a post-crash tab.
   ss.setTabState(tab, JSON.stringify(TAB_STATE));
   await promiseTabRestored(tab);
 
   ok(gBrowser.tabs.length > 1, "we have more than one tab");
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let view = browser.contentDocument.getElementById("tabList").view;
   ok(view.isContainer(0), "first entry is the window");
   is(view.getCellProperties(1, { id: "title" }), "icon",
     "second entry is the tab and has a favicon");
 
   browser.messageManager.loadFrameScript(FRAME_SCRIPT, true);
 
   // Wait until the new window was restored.
--- a/browser/components/sessionstore/test/browser_crashedTabs.js
+++ b/browser/components/sessionstore/test/browser_crashedTabs.js
@@ -385,16 +385,17 @@ add_task(async function test_hide_restor
   browser.loadURI(PAGE_1);
   await promiseBrowserLoaded(browser);
 
   await TabStateFlusher.flush(browser);
 
   // Crash the tab
   await BrowserTestUtils.crashBrowser(browser);
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = browser.contentDocument;
   let restoreAllButton = doc.getElementById("restoreAll");
   let restoreOneButton = doc.getElementById("restoreTab");
 
   let restoreAllStyles = window.getComputedStyle(restoreAllButton);
   is(restoreAllStyles.display, "none", "Restore All button should be hidden");
   ok(restoreOneButton.classList.contains("primary"), "Restore Tab button should have the primary class");
 
@@ -415,16 +416,17 @@ add_task(async function test_hide_restor
   // sending its AboutTabCrashedReady event before we know for
   // sure whether or not we're showing the right Restore buttons.
   let otherBrowserReady = promiseTabCrashedReady(otherWinBrowser);
 
   // Crash the first tab.
   await BrowserTestUtils.crashBrowser(browser);
   await otherBrowserReady;
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   doc = browser.contentDocument;
   restoreAllButton = doc.getElementById("restoreAll");
   restoreOneButton = doc.getElementById("restoreTab");
 
   restoreAllStyles = window.getComputedStyle(restoreAllButton);
   isnot(restoreAllStyles.display, "none", "Restore All button should not be hidden");
   ok(!(restoreOneButton.classList.contains("primary")), "Restore Tab button should not have the primary class");
 
--- a/browser/components/sessionstore/test/browser_swapDocShells.js
+++ b/browser/components/sessionstore/test/browser_swapDocShells.js
@@ -21,15 +21,16 @@ function promiseDelayedStartupFinished(w
   return new Promise(resolve => {
     whenDelayedStartupFinished(win, resolve);
   });
 }
 
 function promiseBrowserHasURL(browser, url) {
   let promise = Promise.resolve();
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   if (browser.contentDocument.readyState === "complete" &&
       browser.currentURI.spec === url) {
     return promise;
   }
 
   return promise.then(() => promiseBrowserHasURL(browser, url));
 }
--- a/browser/extensions/formautofill/.eslintrc.js
+++ b/browser/extensions/formautofill/.eslintrc.js
@@ -1,16 +1,15 @@
 "use strict";
 
 module.exports = {
   "rules": {
     // Rules from the mozilla plugin
     "mozilla/balanced-listeners": "error",
     "mozilla/no-aArgs": "error",
-    "mozilla/no-cpows-in-tests": "error",
     "mozilla/var-only-at-top-level": "error",
 
     "valid-jsdoc": ["error", {
       "prefer": {
         "return": "returns",
       },
       "preferType": {
         "Boolean": "boolean",
--- a/browser/extensions/onboarding/test/browser/browser_onboarding_tourset.js
+++ b/browser/extensions/onboarding/test/browser/browser_onboarding_tourset.js
@@ -8,16 +8,17 @@ requestLongerTimeout(2);
 add_task(async function test_onboarding_default_new_tourset() {
   resetOnboardingDefaultState();
 
   let tab = await openTab(ABOUT_NEWTAB_URL);
   await promiseOnboardingOverlayLoaded(tab.linkedBrowser);
   await BrowserTestUtils.synthesizeMouseAtCenter("#onboarding-overlay-button", {}, tab.linkedBrowser);
   await promiseOnboardingOverlayOpened(tab.linkedBrowser);
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = content && content.document;
   let doms = doc.querySelectorAll(".onboarding-tour-item");
   is(doms.length, TOUR_IDs.length, "has exact tour numbers");
   doms.forEach((dom, idx) => {
     is(TOUR_IDs[idx], dom.id, "contain defined onboarding id");
   });
 
   await BrowserTestUtils.removeTab(tab);
@@ -38,16 +39,17 @@ add_task(async function test_onboarding_
     ["browser.onboarding.newtour", "private,addons,customize"],
   ]});
 
   let tab = await openTab(ABOUT_NEWTAB_URL);
   await promiseOnboardingOverlayLoaded(tab.linkedBrowser);
   await BrowserTestUtils.synthesizeMouseAtCenter("#onboarding-overlay-button", {}, tab.linkedBrowser);
   await promiseOnboardingOverlayOpened(tab.linkedBrowser);
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = content && content.document;
   let doms = doc.querySelectorAll(".onboarding-tour-item");
   is(doms.length, CUSTOM_NEW_TOURs.length, "has exact tour numbers");
   doms.forEach((dom, idx) => {
     is(CUSTOM_NEW_TOURs[idx], dom.id, "contain defined onboarding id");
   });
 
   await BrowserTestUtils.removeTab(tab);
@@ -67,16 +69,17 @@ add_task(async function test_onboarding_
     ["browser.onboarding.updatetour", "customize,private,addons"],
   ]});
 
   let tab = await openTab(ABOUT_NEWTAB_URL);
   await promiseOnboardingOverlayLoaded(tab.linkedBrowser);
   await BrowserTestUtils.synthesizeMouseAtCenter("#onboarding-overlay-button", {}, tab.linkedBrowser);
   await promiseOnboardingOverlayOpened(tab.linkedBrowser);
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   let doc = content && content.document;
   let doms = doc.querySelectorAll(".onboarding-tour-item");
   is(doms.length, CUSTOM_UPDATE_TOURs.length, "has exact tour numbers");
   doms.forEach((dom, idx) => {
     is(CUSTOM_UPDATE_TOURs[idx], dom.id, "contain defined onboarding id");
   });
 
   await BrowserTestUtils.removeTab(tab);
--- a/browser/extensions/shield-recipe-client/test/browser/browser_about_preferences.js
+++ b/browser/extensions/shield-recipe-client/test/browser/browser_about_preferences.js
@@ -1,10 +1,12 @@
 "use strict";
 
+/* eslint-disable mozilla/no-cpows-in-tests */
+
 Cu.import("resource://gre/modules/Services.jsm", this);
 
 const OPT_OUT_PREF = "app.shield.optoutstudies.enabled";
 const FHR_PREF = "datareporting.healthreport.uploadEnabled";
 
 function withPrivacyPrefs(testFunc) {
   return async (...args) => (
     BrowserTestUtils.withNewTab("about:preferences#privacy", async browser => (
--- a/browser/extensions/shield-recipe-client/test/browser/browser_about_studies.js
+++ b/browser/extensions/shield-recipe-client/test/browser/browser_about_studies.js
@@ -9,16 +9,17 @@ function withAboutStudies(testFunc) {
       testFunc(...args, browser)
     ))
   );
 }
 
 decorate_task(
   withAboutStudies,
   async function testAboutStudiesWorks(browser) {
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     ok(browser.contentDocument.getElementById("app"), "App element was found");
   }
 );
 
 decorate_task(
   withPrefEnv({
     set: [["extensions.shield-recipe-client.shieldLearnMoreUrl", "http://test/%OS%/"]],
   }),
@@ -45,21 +46,23 @@ decorate_task(
     // We have to use gBrowser instead of browser in most spots since we're
     // dealing with a new tab outside of the about:studies tab.
     const tab = await BrowserTestUtils.switchTab(gBrowser, () => {
       ContentTask.spawn(browser, null, () => {
         content.document.getElementById("shield-studies-update-preferences").click();
       });
     });
 
+    /* eslint-disable mozilla/no-cpows-in-tests */
     if (gBrowser.contentDocument.readyState !== "complete") {
       await BrowserTestUtils.waitForEvent(gBrowser.contentWindow, "load");
     }
 
     const location = gBrowser.contentWindow.location.href;
+    /* eslint-enable mozilla/no-cpows-in-tests */
     is(
       location,
       "about:preferences#privacy",
       "Clicking Update Preferences opens the privacy section of the new about:preferences.",
     );
 
     await BrowserTestUtils.removeTab(tab);
   }
--- a/toolkit/components/extensions/.eslintrc.js
+++ b/toolkit/components/extensions/.eslintrc.js
@@ -18,17 +18,16 @@ module.exports = {
     "Services": true,
     "XPCOMUtils": true,
   },
 
   "rules": {
     // Rules from the mozilla plugin
     "mozilla/balanced-listeners": "error",
     "mozilla/no-aArgs": "error",
-    "mozilla/no-cpows-in-tests": "error",
     "mozilla/var-only-at-top-level": "error",
 
     "valid-jsdoc": ["error", {
       "prefer": {
         "return": "returns",
       },
       "preferType": {
         "Boolean": "boolean",
--- a/toolkit/components/narrate/test/browser_narrate.js
+++ b/toolkit/components/narrate/test/browser_narrate.js
@@ -1,14 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+/* eslint-disable mozilla/no-cpows-in-tests */
+
 registerCleanupFunction(teardown);
 
 add_task(async function testNarrate() {
   setup();
 
   await spawnInNewReaderTab(TEST_ARTICLE, async function() {
     let TEST_VOICE = "urn:moz-tts:fake-indirect:teresa";
     let $ = content.document.querySelector.bind(content.document);
--- a/toolkit/components/narrate/test/browser_narrate_language.js
+++ b/toolkit/components/narrate/test/browser_narrate_language.js
@@ -1,14 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+/* eslint-disable mozilla/no-cpows-in-tests */
+
 registerCleanupFunction(teardown);
 
 add_task(async function testVoiceselectDropdownAutoclose() {
   setup("automatic", true);
 
   await spawnInNewReaderTab(TEST_ARTICLE, async function() {
     let $ = content.document.querySelector.bind(content.document);
 
--- a/toolkit/components/narrate/test/browser_voiceselect.js
+++ b/toolkit/components/narrate/test/browser_voiceselect.js
@@ -1,14 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+/* eslint-disable mozilla/no-cpows-in-tests */
+
 registerCleanupFunction(teardown);
 
 add_task(async function testVoiceselectDropdownAutoclose() {
   setup();
 
   await spawnInNewReaderTab(TEST_ARTICLE, async function() {
     let $ = content.document.querySelector.bind(content.document);
 
--- a/toolkit/components/narrate/test/browser_word_highlight.js
+++ b/toolkit/components/narrate/test/browser_word_highlight.js
@@ -1,14 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+/* eslint-disable mozilla/no-cpows-in-tests */
+
 registerCleanupFunction(teardown);
 
 add_task(async function testNarrate() {
   setup("urn:moz-tts:fake-indirect:teresa");
 
   await spawnInNewReaderTab(TEST_ARTICLE, async function() {
     let $ = content.document.querySelector.bind(content.document);
 
--- a/toolkit/components/payments/.eslintrc.js
+++ b/toolkit/components/payments/.eslintrc.js
@@ -1,14 +1,13 @@
 "use strict";
 
 module.exports = {
   rules: {
     "mozilla/balanced-listeners": "error",
-    "mozilla/no-cpows-in-tests": "error",
     "mozilla/var-only-at-top-level": "error",
 
     "array-bracket-spacing": ["error", "never"],
     "block-scoped-var": "error",
     "comma-dangle": ["error", "always-multiline"],
     complexity: ["error", {
       max: 20,
     }],
--- a/toolkit/components/satchel/.eslintrc.js
+++ b/toolkit/components/satchel/.eslintrc.js
@@ -1,14 +1,13 @@
 "use strict";
 
 module.exports = {
   rules: {
     "mozilla/balanced-listeners": "error",
-    "mozilla/no-cpows-in-tests": "error",
     "mozilla/var-only-at-top-level": "error",
 
     "array-bracket-spacing": ["error", "never"],
     "block-scoped-var": "error",
     "comma-dangle": ["error", "always-multiline"],
     complexity: ["error", {
       max: 20,
     }],
--- a/toolkit/components/viewsource/test/browser/browser_bug699356.js
+++ b/toolkit/components/viewsource/test/browser/browser_bug699356.js
@@ -5,15 +5,16 @@
 function test() {
   let source = "about:blank";
 
   waitForExplicitFinish();
   openViewSourceWindow(source, function(aWindow) {
     let gBrowser = aWindow.gBrowser;
     let docEl = aWindow.document.documentElement;
 
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     is(gBrowser.contentDocument.title, source, "Correct document title");
     is(docEl.getAttribute("title"),
       "Source of: " + source + ("nsILocalFileMac" in Components.interfaces ? "" : " - " + docEl.getAttribute("titlemodifier")),
       "Correct window title");
     closeViewSourceWindow(aWindow, finish);
   });
 }
--- a/toolkit/content/tests/browser/browser_save_resend_postdata.js
+++ b/toolkit/content/tests/browser/browser_save_resend_postdata.js
@@ -22,28 +22,30 @@ function test() {
   gBrowser.addEventListener("pageshow", function pageShown(event) {
     if (event.target.location == "about:blank")
       return;
     gBrowser.removeEventListener("pageshow", pageShown);
 
     // Submit the form in the outer page, then wait for both the outer
     // document and the inner frame to be loaded again.
     gBrowser.addEventListener("DOMContentLoaded", handleOuterSubmit);
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     gBrowser.contentDocument.getElementById("postForm").submit();
   });
 
   var framesLoaded = 0;
   var innerFrame;
 
   function handleOuterSubmit() {
     if (++framesLoaded < 2)
       return;
 
     gBrowser.removeEventListener("DOMContentLoaded", handleOuterSubmit);
 
+    // eslint-disable-next-line mozilla/no-cpows-in-tests
     innerFrame = gBrowser.contentDocument.getElementById("innerFrame");
 
     // Submit the form in the inner page.
     gBrowser.addEventListener("DOMContentLoaded", handleInnerSubmit);
     innerFrame.contentDocument.getElementById("postForm").submit();
   }
 
   function handleInnerSubmit() {
--- a/toolkit/mozapps/extensions/test/browser/browser_bug562797.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_bug562797.js
@@ -1,13 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 /* eslint max-nested-callbacks: ["warn", 12] */
+/* eslint-disable mozilla/no-cpows-in-tests */
 
 /**
  * Tests that history navigation works for the add-ons manager.
  */
 
 const MAIN_URL = "https://example.com/" + RELATIVE_DIR + "discovery.html";
 const SECOND_URL = "https://example.com/" + RELATIVE_DIR + "releaseNotes.xhtml";
 
--- a/toolkit/mozapps/extensions/test/browser/browser_discovery.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_discovery.js
@@ -169,16 +169,17 @@ function clickLink(aId, aCallback) {
   var browser = gManagerWindow.document.getElementById("discover-browser");
   browser.addProgressListener(gProgressListener);
 
   gLoadCompleteCallback = function() {
     browser.removeProgressListener(gProgressListener);
     aCallback();
   };
 
+  // eslint-disable-next-line mozilla/no-cpows-in-tests
   var link = browser.contentDocument.getElementById(aId);
   EventUtils.sendMouseEvent({type: "click"}, link);
 
   executeSoon(function() {
     ok(isLoading(), "Clicking a link should show the loading pane");
   });
 }
 
--- a/toolkit/mozapps/extensions/test/browser/browser_discovery_install.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_discovery_install.js
@@ -1,12 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
+/* eslint-disable mozilla/no-cpows-in-tests */
+
 // Tests that the discovery view can install add-ons correctly
 
 const MAIN_URL = "https://example.com/" + RELATIVE_DIR + "discovery_install.html";
 const GOOD_FRAMED_URL = "https://example.com/" + RELATIVE_DIR + "discovery_frame.html";
 const BAD_FRAMED_URL = "https://example.org/" + RELATIVE_DIR + "discovery_frame.html";
 
 const PREF_INSTALL_REQUIREBUILTINCERTS = "extensions.install.requireBuiltInCerts";
 
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/browser-test.js
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/browser-test.js
@@ -56,11 +56,12 @@ module.exports = {
   "plugins": [
     "mozilla"
   ],
 
   "rules": {
     "mozilla/import-content-task-globals": "error",
     "mozilla/import-headjs-globals": "error",
     "mozilla/mark-test-function-used": "error",
-    "mozilla/no-arbitrary-setTimeout": "error"
+    "mozilla/no-arbitrary-setTimeout": "error",
+    "mozilla/no-cpows-in-tests": "error"
   }
 };