Bug 1508985 - Enable ESLint for dom/tests/browser/ (automatic changes) r=Standard8,qdot
authorVincent W <VinceDaDev@hotmail.com>
Tue, 22 Jan 2019 21:26:30 +0000
changeset 514875 efd90c73657e20a9f80f9f2e7fbfa9f631a2c441
parent 514874 5a1e7626e70266f05cc65e9ae8be55f8b32c4321
child 514876 62947b5b105bb61f1875b98671ddfda082980356
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8, qdot
bugs1508985
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 1508985 - Enable ESLint for dom/tests/browser/ (automatic changes) r=Standard8,qdot Differential Revision: https://phabricator.services.mozilla.com/D14017
dom/tests/browser/beforeunload_test_page.html
dom/tests/browser/browser_ConsoleAPITests.js
dom/tests/browser/browser_ConsoleAPI_originAttributes.js
dom/tests/browser/browser_ConsoleStorageAPITests.js
dom/tests/browser/browser_ConsoleStoragePBTest_perwindowpb.js
dom/tests/browser/browser_allocateGigabyte.js
dom/tests/browser/browser_beforeunload_between_chrome_content.js
dom/tests/browser/browser_bug1004814.js
dom/tests/browser/browser_bug1238427.js
dom/tests/browser/browser_bug1316330.js
dom/tests/browser/browser_bug396843.js
dom/tests/browser/browser_focus_steal_from_chrome_during_mousedown.js
dom/tests/browser/browser_frame_elements.js
dom/tests/browser/browser_hasbeforeunload.js
dom/tests/browser/browser_largeAllocation_non_win32.js
dom/tests/browser/browser_largeAllocation_win32.js
dom/tests/browser/browser_localStorage_e10s.js
dom/tests/browser/browser_localStorage_privatestorageevent.js
dom/tests/browser/browser_noopener_null_uri.js
dom/tests/browser/browser_persist_cookies.js
dom/tests/browser/browser_persist_mixed_content_image.js
dom/tests/browser/browser_test_new_window_from_content.js
dom/tests/browser/browser_test_toolbars_visibility.js
dom/tests/browser/browser_xhr_sandbox.js
dom/tests/browser/helper_largeAllocation.js
dom/tests/browser/page_localstorage_e10s.html
dom/tests/browser/perfmetrics/browser_test_performance_metrics.js
dom/tests/browser/perfmetrics/ping_worker.html
dom/tests/browser/perfmetrics/ping_worker2.html
dom/tests/browser/shared_worker.js
dom/tests/browser/test-console-api.html
dom/tests/browser/test_bug1004814.html
dom/tests/browser/test_new_window_from_content_child.html
dom/tests/browser/worker_bug1004814.js
--- a/dom/tests/browser/beforeunload_test_page.html
+++ b/dom/tests/browser/beforeunload_test_page.html
@@ -79,14 +79,14 @@
       }
 
       this.$totalOuter.textContent = this._outerEventHandlers.length;
     },
 
     reset() {
       this.popInner(this._innerEventHandlers.length);
       this.popOuter(this._outerEventHandlers.length);
-    }
+    },
   };
 </script>
 
 </body>
 </html>
\ No newline at end of file
--- a/dom/tests/browser/browser_ConsoleAPITests.js
+++ b/dom/tests/browser/browser_ConsoleAPITests.js
@@ -60,17 +60,17 @@ function spawnWithObserver(browser, obse
     "        ok(false, 'Exception thrown in observe: ' + ex);",
     "      }",
     "    }",
     "  };",
     "  Services.obs.addObserver(ConsoleObserver, 'console-api-log-event', false);",
     // Call the initialization function (if present)
     func ? ("(" + func.toString() + ")();") : "",
     "});",
-  ].join('\n');
+  ].join("\n");
 
   return ContentTask.spawn(browser, null, new Function(source));
 }
 
 function waitForResolve(browser) {
   return ContentTask.spawn(browser, null, function() {
     return content._promise;
   });
@@ -117,17 +117,17 @@ function testConsoleData(aMessageObject)
   }
   case "count": {
     is(aMessageObject.counter.label, gArgs[0].label, "label matches");
     is(aMessageObject.counter.count, gArgs[0].count, "count matches");
     break;
   }
   default: {
     is(aMessageObject.arguments.length, gArgs.length, "arguments.length matches");
-    gArgs.forEach(function (a, i) {
+    gArgs.forEach(function(a, i) {
       // Waive Xray so that we don't get messed up by Xray ToString.
       //
       // It'd be nice to just use XPCNativeWrapper.unwrap here, but there are
       // a number of dumb reasons we can't. See bug 868675.
       var arg = aMessageObject.arguments[i];
       if (Cu.isXrayWrapper(arg))
         arg = arg.wrappedJSObject;
       is(arg, a, "correct arg " + i);
@@ -265,17 +265,17 @@ async function startTraceTest(browser) {
   dump("HERE\n");
   await spawnWithObserver(browser, testTraceConsoleData, function(opts) {
     dump("Observer attached\n");
     gLevel = "trace";
     gArgs = [
       {columnNumber: 9, filename: TEST_URI, functionName: "window.foobar585956c", lineNumber: 6},
       {columnNumber: 16, filename: TEST_URI, functionName: "foobar585956b", lineNumber: 11},
       {columnNumber: 16, filename: TEST_URI, functionName: "foobar585956a", lineNumber: 15},
-      {columnNumber: 1, filename: TEST_URI, functionName: "onclick", lineNumber: 1}
+      {columnNumber: 1, filename: TEST_URI, functionName: "onclick", lineNumber: 1},
     ];
 
   });
 
   BrowserTestUtils.synthesizeMouseAtCenter("#test-trace", {}, browser);
   await waitForResolve(browser);
 }
 
@@ -285,28 +285,28 @@ function testLocationData(aMessageObject
 
   is(aMessageObject.level, gLevel, "expected level received");
   ok(aMessageObject.arguments, "we have arguments");
 
   is(aMessageObject.filename, gArgs[0].filename, "filename matches");
   is(aMessageObject.lineNumber, gArgs[0].lineNumber, "lineNumber matches");
   is(aMessageObject.functionName, gArgs[0].functionName, "functionName matches");
   is(aMessageObject.arguments.length, gArgs[0].arguments.length, "arguments.length matches");
-  gArgs[0].arguments.forEach(function (a, i) {
+  gArgs[0].arguments.forEach(function(a, i) {
     is(aMessageObject.arguments[i], a, "correct arg " + i);
   });
 
   resolve();
 }
 
 async function startLocationTest(browser) {
   await spawnWithObserver(browser, testLocationData, function(opts) {
     gLevel = "log";
     gArgs = [
-      {filename: TEST_URI, functionName: "foobar646025", arguments: ["omg", "o", "d"], lineNumber: 19}
+      {filename: TEST_URI, functionName: "foobar646025", arguments: ["omg", "o", "d"], lineNumber: 19},
     ];
   });
 
   BrowserTestUtils.synthesizeMouseAtCenter("#test-location", {}, browser);
   await waitForResolve(browser);
 }
 
 function testNativeCallback(aMessageObject) {
@@ -336,23 +336,21 @@ function testConsoleGroup(aMessageObject
 
   is(aMessageObject.functionName, "testGroups", "functionName matches");
   ok(aMessageObject.lineNumber >= 46 && aMessageObject.lineNumber <= 50,
      "lineNumber matches");
   if (aMessageObject.level == "groupCollapsed") {
     is(aMessageObject.groupName, "a group", "groupCollapsed groupName matches");
     is(aMessageObject.arguments[0], "a", "groupCollapsed arguments[0] matches");
     is(aMessageObject.arguments[1], "group", "groupCollapsed arguments[0] matches");
-  }
-  else if (aMessageObject.level == "group") {
+  } else if (aMessageObject.level == "group") {
     is(aMessageObject.groupName, "b group", "group groupName matches");
     is(aMessageObject.arguments[0], "b", "group arguments[0] matches");
     is(aMessageObject.arguments[1], "group", "group arguments[1] matches");
-  }
-  else if (aMessageObject.level == "groupEnd") {
+  } else if (aMessageObject.level == "groupEnd") {
     is(aMessageObject.groupName, "b group", "groupEnd groupName matches");
   }
 
   if (aMessageObject.level == "groupEnd") {
     resolve();
   }
 }
 
@@ -369,31 +367,31 @@ function testConsoleTime(aMessageObject)
 
   is(aMessageObject.level, gLevel, "expected level received");
 
   is(aMessageObject.filename, gArgs[0].filename, "filename matches");
   is(aMessageObject.lineNumber, gArgs[0].lineNumber, "lineNumber matches");
   is(aMessageObject.functionName, gArgs[0].functionName, "functionName matches");
   is(aMessageObject.timer.name, gArgs[0].timer.name, "timer.name matches");
 
-  gArgs[0].arguments.forEach(function (a, i) {
+  gArgs[0].arguments.forEach(function(a, i) {
     is(aMessageObject.arguments[i], a, "correct arg " + i);
   });
 
   resolve();
 }
 
 async function startTimeTest(browser) {
   await spawnWithObserver(browser, testConsoleTime, function(opts) {
     gLevel = "time";
     gArgs = [
       {filename: TEST_URI, lineNumber: 23, functionName: "startTimer",
        arguments: ["foo"],
        timer: { name: "foo" },
-      }
+      },
     ];
   });
 
   BrowserTestUtils.synthesizeMouseAtCenter("#test-time", {}, browser);
   await waitForResolve(browser);
 }
 
 function testConsoleTimeEnd(aMessageObject) {
@@ -407,17 +405,17 @@ function testConsoleTimeEnd(aMessageObje
   is(aMessageObject.lineNumber, gArgs[0].lineNumber, "lineNumber matches");
   is(aMessageObject.functionName, gArgs[0].functionName, "functionName matches");
   is(aMessageObject.arguments.length, gArgs[0].arguments.length, "arguments.length matches");
   is(aMessageObject.timer.name, gArgs[0].timer.name, "timer name matches");
   is(typeof aMessageObject.timer.duration, "number", "timer duration is a number");
   info("timer duration: " + aMessageObject.timer.duration);
   ok(aMessageObject.timer.duration >= 0, "timer duration is positive");
 
-  gArgs[0].arguments.forEach(function (a, i) {
+  gArgs[0].arguments.forEach(function(a, i) {
     is(aMessageObject.arguments[i], a, "correct arg " + i);
   });
 
   resolve();
 }
 
 async function startTimeEndTest(browser) {
   await spawnWithObserver(browser, testConsoleTimeEnd, function(opts) {
@@ -440,30 +438,30 @@ function testConsoleTimeStamp(aMessageOb
 
   is(aMessageObject.level, gLevel, "expected level received");
 
   is(aMessageObject.filename, gArgs[0].filename, "filename matches");
   is(aMessageObject.lineNumber, gArgs[0].lineNumber, "lineNumber matches");
   is(aMessageObject.functionName, gArgs[0].functionName, "functionName matches");
   ok(aMessageObject.timeStamp > 0, "timeStamp is a positive value");
 
-  gArgs[0].arguments.forEach(function (a, i) {
+  gArgs[0].arguments.forEach(function(a, i) {
     is(aMessageObject.arguments[i], a, "correct arg " + i);
   });
 
   resolve();
 }
 
 async function startTimeStampTest(browser) {
   await spawnWithObserver(browser, testConsoleTimeStamp, function() {
     gLevel = "timeStamp";
     gArgs = [
       {filename: TEST_URI, lineNumber: 58, functionName: "timeStamp",
-       arguments: ["!!!"]
-      }
+       arguments: ["!!!"],
+      },
     ];
   });
 
   BrowserTestUtils.synthesizeMouseAtCenter("#test-timeStamp", {}, browser);
   await waitForResolve(browser);
 }
 
 function testEmptyConsoleTimeStamp(aMessageObject) {
@@ -481,18 +479,18 @@ function testEmptyConsoleTimeStamp(aMess
   resolve();
 }
 
 async function startEmptyTimeStampTest(browser) {
   await spawnWithObserver(browser, testEmptyConsoleTimeStamp, function() {
     gLevel = "timeStamp";
     gArgs = [
       {filename: TEST_URI, lineNumber: 58, functionName: "timeStamp",
-       arguments: []
-      }
+       arguments: [],
+      },
     ];
   });
 
   BrowserTestUtils.synthesizeMouseAtCenter("#test-emptyTimeStamp", {}, browser);
   await waitForResolve(browser);
 }
 
 function testEmptyTimer(aMessageObject) {
--- a/dom/tests/browser/browser_ConsoleAPI_originAttributes.js
+++ b/dom/tests/browser/browser_ConsoleAPI_originAttributes.js
@@ -35,21 +35,20 @@ const ConsoleObserver = {
       });
 
       is(cachedMessages.length, 1, "found the expected cached console messages from the addon");
       is(cachedMessages[0] && cachedMessages[0].addonId, FAKE_ADDON_ID,
          "the cached message originAttributes contains the expected addonId");
 
       finish();
     }
-  }
+  },
 };
 
-function test()
-{
+function test() {
   ConsoleObserver.init();
 
   waitForExplicitFinish();
 
   let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
   let uuid = uuidGenerator.generateUUID().number;
   uuid = uuid.slice(1, -1); // Strip { and } off the UUID.
 
--- a/dom/tests/browser/browser_ConsoleStorageAPITests.js
+++ b/dom/tests/browser/browser_ConsoleStorageAPITests.js
@@ -1,21 +1,19 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const TEST_URI_NAV = "http://example.com/browser/dom/tests/browser/";
 
-function tearDown()
-{
+function tearDown() {
   while (gBrowser.tabs.length > 1)
     gBrowser.removeCurrentTab();
 }
 
-add_task(async function()
-{
+add_task(async function() {
   // Don't cache removed tabs, so "clear console cache on tab close" triggers.
   await SpecialPowers.pushPrefEnv({ set: [[ "browser.tabs.max_tabs_undo", 0 ]] });
 
   registerCleanupFunction(tearDown);
 
   // Open a keepalive tab in the background to make sure we don't accidentally
   // kill the content process
   var keepaliveTab = BrowserTestUtils.addTab(gBrowser, "about:blank");
@@ -30,31 +28,31 @@ add_task(async function()
     let ConsoleAPIStorage = Cc["@mozilla.org/consoleAPI-storage;1"]
           .getService(Ci.nsIConsoleAPIStorage);
 
     let observerPromise = new Promise(resolve => {
       let apiCallCount = 0;
       let ConsoleObserver = {
         QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver]),
 
-        observe: function(aSubject, aTopic, aData) {
+        observe(aSubject, aTopic, aData) {
           if (aTopic == "console-storage-cache-event") {
             apiCallCount++;
             if (apiCallCount == 4) {
               let windowId = content.window.windowUtils.currentInnerWindowID;
 
               Services.obs.removeObserver(this, "console-storage-cache-event");
               ok(ConsoleAPIStorage.getEvents(windowId).length >= 4, "Some messages found in the storage service");
               ConsoleAPIStorage.clearEvents();
               is(ConsoleAPIStorage.getEvents(windowId).length, 0, "Cleared Storage");
 
               resolve(windowId);
             }
           }
-        }
+        },
       };
 
       Services.obs.addObserver(ConsoleObserver, "console-storage-cache-event");
 
       // Redirect the browser to the test URI
       content.window.location = TEST_URI;
     });
 
@@ -80,17 +78,17 @@ add_task(async function()
   // Ensure actual window destruction is not delayed (too long).
   SpecialPowers.DOMWindowUtils.garbageCollect();
 
   // Spawn the check in the keepaliveTab, so that we can read the ConsoleAPIStorage correctly
   gBrowser.selectedTab = keepaliveTab;
   browser = gBrowser.selectedBrowser;
 
   // Spin the event loop to make sure everything is cleared.
-  await ContentTask.spawn(browser, null, function () {
+  await ContentTask.spawn(browser, null, function() {
     return Promise.resolve();
   });
 
   await ContentTask.spawn(browser, windowId, function(windowId) {
     var ConsoleAPIStorage = Cc["@mozilla.org/consoleAPI-storage;1"]
           .getService(Ci.nsIConsoleAPIStorage);
     is(ConsoleAPIStorage.getEvents(windowId).length, 0, "tab close is clearing the cache");
   });
--- a/dom/tests/browser/browser_ConsoleStoragePBTest_perwindowpb.js
+++ b/dom/tests/browser/browser_ConsoleStoragePBTest_perwindowpb.js
@@ -24,28 +24,28 @@ function test() {
     win.addEventListener("load", function() {
       aCallback(win);
     }, {once: true});
   }
 
   function doTest(aIsPrivateMode, aWindow, aCallback) {
     BrowserTestUtils.browserLoaded(aWindow.gBrowser.selectedBrowser).then(() => {
       consoleObserver = {
-        observe: function(aSubject, aTopic, aData) {
+        observe(aSubject, aTopic, aData) {
           if (aTopic == "console-api-log-event") {
             afterEvents = ConsoleAPIStorage.getEvents(innerID);
             is(beforeEvents.length == afterEvents.length - 1, storageShouldOccur,
               "storage should" + (storageShouldOccur ? "" : " not") + " occur");
 
             executeSoon(function() {
               Services.obs.removeObserver(consoleObserver, "console-api-log-event");
               aCallback();
             });
           }
-        }
+        },
       };
 
       aWindow.Services.obs.addObserver(
         consoleObserver, "console-api-log-event");
       aWindow.nativeConsole.log("foo bar baz (private: " + aIsPrivateMode + ")");
     });
 
     // We expect that console API messages are always stored.
@@ -58,17 +58,17 @@ function test() {
   function testOnWindow(aOptions, aCallback) {
     whenNewWindowLoaded(aOptions, function(aWin) {
       windowsToClose.push(aWin);
       // execute should only be called when need, like when you are opening
       // web pages on the test. If calling executeSoon() is not necesary, then
       // call whenNewWindowLoaded() instead of testOnWindow() on your test.
       executeSoon(() => aCallback(aWin));
     });
-  };
+  }
 
    // this function is called after calling finish() on the test.
   registerCleanupFunction(function() {
     windowsToClose.forEach(function(aWin) {
       aWin.close();
     });
   });
 
--- a/dom/tests/browser/browser_allocateGigabyte.js
+++ b/dom/tests/browser/browser_allocateGigabyte.js
@@ -16,28 +16,28 @@ function expectProcessCreated() {
     os.addObserver(observer, topic);
   });
 }
 
 add_task(async function() {
   await SpecialPowers.pushPrefEnv({
     set: [
       ["dom.largeAllocationHeader.enabled", true],
-    ]
+    ],
   });
 
   // A toplevel tab should be able to navigate cross process!
   await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) {
     let epc = expectProcessCreated();
     await ContentTask.spawn(aBrowser, TEST_URI, TEST_URI => {
       content.document.location = TEST_URI;
     });
 
     // Wait for the new process to be created by the Large-Allocation header
     await epc;
 
     // Allocate a gigabyte of memory in the content process
     await ContentTask.spawn(aBrowser, null, () => {
-      let arrayBuffer = new ArrayBuffer(1024*1024*1024);
+      let arrayBuffer = new ArrayBuffer(1024 * 1024 * 1024);
       ok(arrayBuffer, "Successfully allocated a gigabyte of memory in content process");
     });
   });
 });
--- a/dom/tests/browser/browser_beforeunload_between_chrome_content.js
+++ b/dom/tests/browser/browser_beforeunload_between_chrome_content.js
@@ -1,21 +1,21 @@
 const TEST_URL = "http://www.example.com/browser/dom/tests/browser/dummy.html";
 
 function pageScript() {
-  window.addEventListener("beforeunload", function (event) {
+  window.addEventListener("beforeunload", function(event) {
     var str = "Leaving?";
     event.returnValue = str;
     return str;
   }, true);
 }
 
 function injectBeforeUnload(browser) {
   return ContentTask.spawn(browser, null, async function() {
-    content.window.addEventListener("beforeunload", function (event) {
+    content.window.addEventListener("beforeunload", function(event) {
       sendAsyncMessage("Test:OnBeforeUnloadReceived");
       var str = "Leaving?";
       event.returnValue = str;
       return str;
     }, true);
   });
 }
 
@@ -54,17 +54,17 @@ add_task(async function() {
   ok(browser.isRemoteBrowser, "Browser should be remote.");
 
   await injectBeforeUnload(browser);
   // Navigate to a chrome page.
   let dialogShown1 = awaitAndCloseBeforeUnloadDialog(false);
   await BrowserTestUtils.loadURI(browser, "about:support");
   await Promise.all([
     dialogShown1,
-    BrowserTestUtils.browserLoaded(browser)
+    BrowserTestUtils.browserLoaded(browser),
   ]);
 
   is(beforeUnloadCount, 1, "Should have received one beforeunload event.");
   ok(!browser.isRemoteBrowser, "Browser should not be remote.");
 
   // Go back to content page.
   ok(gBrowser.webNavigation.canGoBack, "Should be able to go back.");
   gBrowser.goBack();
@@ -72,17 +72,17 @@ add_task(async function() {
   await injectBeforeUnload(browser);
 
   // Test that going forward triggers beforeunload prompt as well.
   ok(gBrowser.webNavigation.canGoForward, "Should be able to go forward.");
   let dialogShown2 = awaitAndCloseBeforeUnloadDialog(false);
   gBrowser.goForward();
   await Promise.all([
     dialogShown2,
-    BrowserTestUtils.browserLoaded(browser)
+    BrowserTestUtils.browserLoaded(browser),
   ]);
   is(beforeUnloadCount, 2, "Should have received two beforeunload events.");
 
   BrowserTestUtils.removeTab(tab);
 });
 
 /**
  * Test navigation from a chrome page to a content page. Also check that only
@@ -96,51 +96,51 @@ add_task(async function() {
 
   // Open a chrome page.
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser,
                                                         "about:support");
   let browser = tab.linkedBrowser;
 
   ok(!browser.isRemoteBrowser, "Browser should not be remote.");
   await ContentTask.spawn(browser, null, async function() {
-    content.window.addEventListener("beforeunload", function (event) {
+    content.window.addEventListener("beforeunload", function(event) {
       sendAsyncMessage("Test:OnBeforeUnloadReceived");
       var str = "Leaving?";
       event.returnValue = str;
       return str;
     }, true);
   });
 
   // Navigate to a content page.
   let dialogShown1 = awaitAndCloseBeforeUnloadDialog(false);
   await BrowserTestUtils.loadURI(browser, TEST_URL);
   await Promise.all([
     dialogShown1,
-    BrowserTestUtils.browserLoaded(browser)
+    BrowserTestUtils.browserLoaded(browser),
   ]);
   is(beforeUnloadCount, 1, "Should have received one beforeunload event.");
   ok(browser.isRemoteBrowser, "Browser should be remote.");
 
   // Go back to chrome page.
   ok(gBrowser.webNavigation.canGoBack, "Should be able to go back.");
   gBrowser.goBack();
   await BrowserTestUtils.browserLoaded(browser);
   await ContentTask.spawn(browser, null, async function() {
-    content.window.addEventListener("beforeunload", function (event) {
+    content.window.addEventListener("beforeunload", function(event) {
       sendAsyncMessage("Test:OnBeforeUnloadReceived");
       var str = "Leaving?";
       event.returnValue = str;
       return str;
     }, true);
   });
 
   // Test that going forward triggers beforeunload prompt as well.
   ok(gBrowser.webNavigation.canGoForward, "Should be able to go forward.");
   let dialogShown2 = awaitAndCloseBeforeUnloadDialog(false);
   gBrowser.goForward();
   await Promise.all([
     dialogShown2,
-    BrowserTestUtils.browserLoaded(browser)
+    BrowserTestUtils.browserLoaded(browser),
   ]);
   is(beforeUnloadCount, 2, "Should have received two beforeunload events.");
 
   BrowserTestUtils.removeTab(tab);
 });
--- a/dom/tests/browser/browser_bug1004814.js
+++ b/dom/tests/browser/browser_bug1004814.js
@@ -1,32 +1,32 @@
 /* vim:set ts=2 sw=2 sts=2 et: */
 /* 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/. */
 
 add_task(async function() {
   await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) {
-    let duration = await ContentTask.spawn(aBrowser, null, function (opts) {
+    let duration = await ContentTask.spawn(aBrowser, null, function(opts) {
       const TEST_URI = "http://example.com/browser/dom/tests/browser/test_bug1004814.html";
 
       return new Promise(resolve => {
         let ConsoleObserver = {
           QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver]),
 
-          observe: function(aSubject, aTopic, aData) {
+          observe(aSubject, aTopic, aData) {
             var obj = aSubject.wrappedJSObject;
-            if (obj.arguments.length != 1 || obj.arguments[0] != 'bug1004814' ||
-                obj.level != 'timeEnd') {
+            if (obj.arguments.length != 1 || obj.arguments[0] != "bug1004814" ||
+                obj.level != "timeEnd") {
               return;
             }
 
             Services.obs.removeObserver(this, "console-api-log-event");
             resolve(obj.timer.duration);
-          }
+          },
         };
 
         Services.obs.addObserver(ConsoleObserver, "console-api-log-event");
 
         // Redirect the browser to the correct document to start the test
         content.document.location = TEST_URI;
       });
     });
--- a/dom/tests/browser/browser_bug1238427.js
+++ b/dom/tests/browser/browser_bug1238427.js
@@ -18,14 +18,14 @@ add_task(async function() {
   // it does not reply before we close the tab.
   Services.prefs.setCharPref("geo.wifi.uri", BASE_GEO_URL + "?delay=100000");
 
   // Open the test URI and close it. The test harness will make sure that the
   // page is cleaned up after some GCs. If geolocation is not shut down properly,
   // it will show up as a non-shutdown leak.
   await BrowserTestUtils.withNewTab({
     gBrowser,
-    url: TEST_URI
+    url: TEST_URI,
   }, function(browser) { /* ... */ });
 
   ok(true, "Need to do something in this test");
 });
 
--- a/dom/tests/browser/browser_bug1316330.js
+++ b/dom/tests/browser/browser_bug1316330.js
@@ -1,11 +1,11 @@
 const URL =
   "data:text/html,<script>" +
-  "window.focus();" + 
+  "window.focus();" +
   "var down = 0; var press = 0;" +
   "onkeydown = function(e) {" +
   "  var startTime = Date.now();" +
   "  document.body.setAttribute('data-down', ++down);" +
   "  if (e.keyCode == KeyboardEvent.DOM_VK_D) while (Date.now() - startTime < 500) {}" +
   "};" +
   "onkeypress = function(e) {" +
   "  var startTime = Date.now();" +
--- a/dom/tests/browser/browser_bug396843.js
+++ b/dom/tests/browser/browser_bug396843.js
@@ -6,185 +6,185 @@ function testInDocument(doc, documentID)
     var XMLNodes = [];
 
     // HTML
     function HTML_TAG(name) {
         allNodes.push(doc.createElement(name));
     }
 
     /* List copy/pasted from nsHTMLTagList.h */
-    HTML_TAG("a", "Anchor")
-    HTML_TAG("abbr", "Span")
-    HTML_TAG("acronym", "Span")
-    HTML_TAG("address", "Span")
-    HTML_TAG("applet", "Unknown")
-    HTML_TAG("area", "Area")
-    HTML_TAG("b", "Span")
-    HTML_TAG("base", "Shared")
-    HTML_TAG("basefont", "Span")
-    HTML_TAG("bdi", "")
-    HTML_TAG("bdo", "Span")
-    HTML_TAG("bgsound", "Span")
-    HTML_TAG("big", "Span")
-    HTML_TAG("blockquote", "Shared")
-    HTML_TAG("body", "Body")
-    HTML_TAG("br", "BR")
-    HTML_TAG("button", "Button")
-    HTML_TAG("canvas", "Canvas")
-    HTML_TAG("caption", "TableCaption")
-    HTML_TAG("center", "Span")
-    HTML_TAG("cite", "Span")
-    HTML_TAG("code", "Span")
-    HTML_TAG("col", "TableCol")
-    HTML_TAG("colgroup", "TableCol")
-    HTML_TAG("dd", "Span")
-    HTML_TAG("del", "Mod")
-    HTML_TAG("dfn", "Span")
-    HTML_TAG("dir", "Shared")
-    HTML_TAG("div", "Div")
-    HTML_TAG("dl", "SharedList")
-    HTML_TAG("dt", "Span")
-    HTML_TAG("em", "Span")
-    HTML_TAG("embed", "Embed")
-    HTML_TAG("fieldset", "FieldSet")
-    HTML_TAG("font", "Font")
-    HTML_TAG("form", "Form")
-    HTML_TAG("frame", "Frame")
-    HTML_TAG("frameset", "FrameSet")
-    HTML_TAG("h1", "Heading")
-    HTML_TAG("h2", "Heading")
-    HTML_TAG("h3", "Heading")
-    HTML_TAG("h4", "Heading")
-    HTML_TAG("h5", "Heading")
-    HTML_TAG("h6", "Heading")
-    HTML_TAG("head", "Head")
-    HTML_TAG("hr", "HR")
-    HTML_TAG("html", "Html")
-    HTML_TAG("i", "Span")
-    HTML_TAG("iframe", "IFrame")
-    HTML_TAG("image", "")
-    HTML_TAG("img", "Image")
-    HTML_TAG("input", "Input")
-    HTML_TAG("ins", "Mod")
-    HTML_TAG("isindex", "Unknown")
-    HTML_TAG("kbd", "Span")
-    HTML_TAG("keygen", "Span")
-    HTML_TAG("label", "Label")
-    HTML_TAG("legend", "Legend")
-    HTML_TAG("li", "LI")
-    HTML_TAG("link", "Link")
-    HTML_TAG("listing", "Span")
-    HTML_TAG("map", "Map")
-    HTML_TAG("marquee", "Div")
-    HTML_TAG("menu", "Shared")
-    HTML_TAG("meta", "Meta")
-    HTML_TAG("multicol", "Unknown")
-    HTML_TAG("nobr", "Span")
-    HTML_TAG("noembed", "Div")
-    HTML_TAG("noframes", "Div")
-    HTML_TAG("noscript", "Div")
-    HTML_TAG("object", "Object")
-    HTML_TAG("ol", "SharedList")
-    HTML_TAG("optgroup", "OptGroup")
-    HTML_TAG("option", "Option")
-    HTML_TAG("p", "Paragraph")
-    HTML_TAG("param", "Shared")
-    HTML_TAG("plaintext", "Span")
-    HTML_TAG("pre", "Pre")
-    HTML_TAG("q", "Shared")
-    HTML_TAG("s", "Span")
-    HTML_TAG("samp", "Span")
-    HTML_TAG("script", "Script")
-    HTML_TAG("select", "Select")
-    HTML_TAG("small", "Span")
-    HTML_TAG("spacer", "Unknown")
-    HTML_TAG("span", "Span")
-    HTML_TAG("strike", "Span")
-    HTML_TAG("strong", "Span")
-    HTML_TAG("style", "Style")
-    HTML_TAG("sub", "Span")
-    HTML_TAG("sup", "Span")
-    HTML_TAG("table", "Table")
-    HTML_TAG("tbody", "TableSection")
-    HTML_TAG("td", "TableCell")
-    HTML_TAG("textarea", "TextArea")
-    HTML_TAG("tfoot", "TableSection")
-    HTML_TAG("th", "TableCell")
-    HTML_TAG("thead", "TableSection")
-    HTML_TAG("template", "Template")
-    HTML_TAG("title", "Title")
-    HTML_TAG("tr", "TableRow")
-    HTML_TAG("tt", "Span")
-    HTML_TAG("u", "Span")
-    HTML_TAG("ul", "SharedList")
-    HTML_TAG("var", "Span")
-    HTML_TAG("wbr", "Shared")
-    HTML_TAG("xmp", "Span")
+    HTML_TAG("a", "Anchor");
+    HTML_TAG("abbr", "Span");
+    HTML_TAG("acronym", "Span");
+    HTML_TAG("address", "Span");
+    HTML_TAG("applet", "Unknown");
+    HTML_TAG("area", "Area");
+    HTML_TAG("b", "Span");
+    HTML_TAG("base", "Shared");
+    HTML_TAG("basefont", "Span");
+    HTML_TAG("bdi", "");
+    HTML_TAG("bdo", "Span");
+    HTML_TAG("bgsound", "Span");
+    HTML_TAG("big", "Span");
+    HTML_TAG("blockquote", "Shared");
+    HTML_TAG("body", "Body");
+    HTML_TAG("br", "BR");
+    HTML_TAG("button", "Button");
+    HTML_TAG("canvas", "Canvas");
+    HTML_TAG("caption", "TableCaption");
+    HTML_TAG("center", "Span");
+    HTML_TAG("cite", "Span");
+    HTML_TAG("code", "Span");
+    HTML_TAG("col", "TableCol");
+    HTML_TAG("colgroup", "TableCol");
+    HTML_TAG("dd", "Span");
+    HTML_TAG("del", "Mod");
+    HTML_TAG("dfn", "Span");
+    HTML_TAG("dir", "Shared");
+    HTML_TAG("div", "Div");
+    HTML_TAG("dl", "SharedList");
+    HTML_TAG("dt", "Span");
+    HTML_TAG("em", "Span");
+    HTML_TAG("embed", "Embed");
+    HTML_TAG("fieldset", "FieldSet");
+    HTML_TAG("font", "Font");
+    HTML_TAG("form", "Form");
+    HTML_TAG("frame", "Frame");
+    HTML_TAG("frameset", "FrameSet");
+    HTML_TAG("h1", "Heading");
+    HTML_TAG("h2", "Heading");
+    HTML_TAG("h3", "Heading");
+    HTML_TAG("h4", "Heading");
+    HTML_TAG("h5", "Heading");
+    HTML_TAG("h6", "Heading");
+    HTML_TAG("head", "Head");
+    HTML_TAG("hr", "HR");
+    HTML_TAG("html", "Html");
+    HTML_TAG("i", "Span");
+    HTML_TAG("iframe", "IFrame");
+    HTML_TAG("image", "");
+    HTML_TAG("img", "Image");
+    HTML_TAG("input", "Input");
+    HTML_TAG("ins", "Mod");
+    HTML_TAG("isindex", "Unknown");
+    HTML_TAG("kbd", "Span");
+    HTML_TAG("keygen", "Span");
+    HTML_TAG("label", "Label");
+    HTML_TAG("legend", "Legend");
+    HTML_TAG("li", "LI");
+    HTML_TAG("link", "Link");
+    HTML_TAG("listing", "Span");
+    HTML_TAG("map", "Map");
+    HTML_TAG("marquee", "Div");
+    HTML_TAG("menu", "Shared");
+    HTML_TAG("meta", "Meta");
+    HTML_TAG("multicol", "Unknown");
+    HTML_TAG("nobr", "Span");
+    HTML_TAG("noembed", "Div");
+    HTML_TAG("noframes", "Div");
+    HTML_TAG("noscript", "Div");
+    HTML_TAG("object", "Object");
+    HTML_TAG("ol", "SharedList");
+    HTML_TAG("optgroup", "OptGroup");
+    HTML_TAG("option", "Option");
+    HTML_TAG("p", "Paragraph");
+    HTML_TAG("param", "Shared");
+    HTML_TAG("plaintext", "Span");
+    HTML_TAG("pre", "Pre");
+    HTML_TAG("q", "Shared");
+    HTML_TAG("s", "Span");
+    HTML_TAG("samp", "Span");
+    HTML_TAG("script", "Script");
+    HTML_TAG("select", "Select");
+    HTML_TAG("small", "Span");
+    HTML_TAG("spacer", "Unknown");
+    HTML_TAG("span", "Span");
+    HTML_TAG("strike", "Span");
+    HTML_TAG("strong", "Span");
+    HTML_TAG("style", "Style");
+    HTML_TAG("sub", "Span");
+    HTML_TAG("sup", "Span");
+    HTML_TAG("table", "Table");
+    HTML_TAG("tbody", "TableSection");
+    HTML_TAG("td", "TableCell");
+    HTML_TAG("textarea", "TextArea");
+    HTML_TAG("tfoot", "TableSection");
+    HTML_TAG("th", "TableCell");
+    HTML_TAG("thead", "TableSection");
+    HTML_TAG("template", "Template");
+    HTML_TAG("title", "Title");
+    HTML_TAG("tr", "TableRow");
+    HTML_TAG("tt", "Span");
+    HTML_TAG("u", "Span");
+    HTML_TAG("ul", "SharedList");
+    HTML_TAG("var", "Span");
+    HTML_TAG("wbr", "Shared");
+    HTML_TAG("xmp", "Span");
 
     function SVG_TAG(name) {
         allNodes.push(doc.createElementNS("http://www.w3.org/2000/svg", name));
     }
 
     // List sorta stolen from SVG element factory.
-    SVG_TAG("a")
-    SVG_TAG("polyline")
-    SVG_TAG("polygon")
-    SVG_TAG("circle")
-    SVG_TAG("ellipse")
-    SVG_TAG("line")
-    SVG_TAG("rect")
-    SVG_TAG("svg")
-    SVG_TAG("g")
-    SVG_TAG("foreignObject")
-    SVG_TAG("path")
-    SVG_TAG("text")
-    SVG_TAG("tspan")
-    SVG_TAG("image")
-    SVG_TAG("style")
-    SVG_TAG("linearGradient")
-    SVG_TAG("metadata")
-    SVG_TAG("radialGradient")
-    SVG_TAG("stop")
-    SVG_TAG("defs")
-    SVG_TAG("desc")
-    SVG_TAG("script")
-    SVG_TAG("use")
-    SVG_TAG("symbol")
-    SVG_TAG("marker")
-    SVG_TAG("title")
-    SVG_TAG("clipPath")
-    SVG_TAG("textPath")
-    SVG_TAG("filter")
-    SVG_TAG("feBlend")
-    SVG_TAG("feColorMatrix")
-    SVG_TAG("feComponentTransfer")
-    SVG_TAG("feComposite")
-    SVG_TAG("feFuncR")
-    SVG_TAG("feFuncG")
-    SVG_TAG("feFuncB")
-    SVG_TAG("feFuncA")
-    SVG_TAG("feGaussianBlur")
-    SVG_TAG("feMerge")
-    SVG_TAG("feMergeNode")
-    SVG_TAG("feMorphology")
-    SVG_TAG("feOffset")
-    SVG_TAG("feFlood")
-    SVG_TAG("feTile")
-    SVG_TAG("feTurbulence")
-    SVG_TAG("feConvolveMatrix")
-    SVG_TAG("feDistantLight")
-    SVG_TAG("fePointLight")
-    SVG_TAG("feSpotLight")
-    SVG_TAG("feDiffuseLighting")
-    SVG_TAG("feSpecularLighting")
-    SVG_TAG("feDisplacementMap")
-    SVG_TAG("feImage")
-    SVG_TAG("pattern")
-    SVG_TAG("mask")
-    SVG_TAG("svgSwitch")
+    SVG_TAG("a");
+    SVG_TAG("polyline");
+    SVG_TAG("polygon");
+    SVG_TAG("circle");
+    SVG_TAG("ellipse");
+    SVG_TAG("line");
+    SVG_TAG("rect");
+    SVG_TAG("svg");
+    SVG_TAG("g");
+    SVG_TAG("foreignObject");
+    SVG_TAG("path");
+    SVG_TAG("text");
+    SVG_TAG("tspan");
+    SVG_TAG("image");
+    SVG_TAG("style");
+    SVG_TAG("linearGradient");
+    SVG_TAG("metadata");
+    SVG_TAG("radialGradient");
+    SVG_TAG("stop");
+    SVG_TAG("defs");
+    SVG_TAG("desc");
+    SVG_TAG("script");
+    SVG_TAG("use");
+    SVG_TAG("symbol");
+    SVG_TAG("marker");
+    SVG_TAG("title");
+    SVG_TAG("clipPath");
+    SVG_TAG("textPath");
+    SVG_TAG("filter");
+    SVG_TAG("feBlend");
+    SVG_TAG("feColorMatrix");
+    SVG_TAG("feComponentTransfer");
+    SVG_TAG("feComposite");
+    SVG_TAG("feFuncR");
+    SVG_TAG("feFuncG");
+    SVG_TAG("feFuncB");
+    SVG_TAG("feFuncA");
+    SVG_TAG("feGaussianBlur");
+    SVG_TAG("feMerge");
+    SVG_TAG("feMergeNode");
+    SVG_TAG("feMorphology");
+    SVG_TAG("feOffset");
+    SVG_TAG("feFlood");
+    SVG_TAG("feTile");
+    SVG_TAG("feTurbulence");
+    SVG_TAG("feConvolveMatrix");
+    SVG_TAG("feDistantLight");
+    SVG_TAG("fePointLight");
+    SVG_TAG("feSpotLight");
+    SVG_TAG("feDiffuseLighting");
+    SVG_TAG("feSpecularLighting");
+    SVG_TAG("feDisplacementMap");
+    SVG_TAG("feImage");
+    SVG_TAG("pattern");
+    SVG_TAG("mask");
+    SVG_TAG("svgSwitch");
 
     // Toss in some other namespaced stuff too, for good measure
     // XUL stuff might not be creatable in content documents
     try {
         allNodes.push(doc.createElementNS(
             "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
             "window"));
     } catch (e) {}
@@ -197,17 +197,17 @@ function testInDocument(doc, documentID)
     var XMLDoc = doc.implementation.createDocument("", "", null);
 
     // And non-elements
     allNodes.push(doc.createTextNode("some text"));
     allNodes.push(doc.createComment("some text"));
     allNodes.push(doc.createDocumentFragment());
     XMLNodes.push(XMLDoc.createCDATASection("some text"));
     XMLNodes.push(XMLDoc.createProcessingInstruction("PI", "data"));
-        
+
     function runTestUnwrapped() {
         if (!("wrappedJSObject" in doc)) {
             return;
         }
         ok(doc.wrappedJSObject.nodePrincipal === undefined,
             "Must not have document principal for " + documentID);
         ok(doc.wrappedJSObject.baseURIObject === undefined,
             "Must not have document base URI for " + documentID);
--- a/dom/tests/browser/browser_focus_steal_from_chrome_during_mousedown.js
+++ b/dom/tests/browser/browser_focus_steal_from_chrome_during_mousedown.js
@@ -25,17 +25,17 @@ add_task(async function test() {
 
     // Synthesize mouse down event on browser object over the button, such that
     // the event propagates through both processes.
     EventUtils.synthesizeMouse(tab.linkedBrowser, 20, 20, { "button": button });
 
     isnot(fm.focusedElement, document.getElementById("urlbar").inputField,
        "Failed to move focus away from search bar: button=" + button);
 
-    await ContentTask.spawn(tab.linkedBrowser, button, async function (button) {
+    await ContentTask.spawn(tab.linkedBrowser, button, async function(button) {
       let fm = Cc["@mozilla.org/focus-manager;1"].
           getService(Ci.nsIFocusManager);
 
       let attempts = 10;
       await new Promise(resolve => {
         function check() {
           if (attempts > 0 && content.document.activeElement.id != "willBeFocused") {
             attempts--;
--- a/dom/tests/browser/browser_frame_elements.js
+++ b/dom/tests/browser/browser_frame_elements.js
@@ -6,17 +6,17 @@
 
 const TEST_URI = "http://example.com/browser/dom/tests/browser/browser_frame_elements.html";
 
 add_task(async function test() {
   await BrowserTestUtils.withNewTab({ gBrowser, url: TEST_URI }, async function(browser) {
     if (!browser.isRemoteBrowser) {
       // Non-e10s, access contentWindow and confirm its container is the browser:
       let windowUtils = browser.contentWindow.windowUtils;
-      is (windowUtils.containerElement, browser,
+      is(windowUtils.containerElement, browser,
           "Container element for main window is xul:browser");
 
     }
 
     await ContentTask.spawn(browser, null, startTests);
     await mozBrowserTests(browser);
   });
 });
@@ -52,27 +52,27 @@ function startTests() {
   Assert.equal(objectDataUrlUtils.containerElement, objectDataUrl, "Container element for object window is the object");
   Assert.equal(objectDataUrl.contentWindow.top, gWindow, "gWindow is top");
   Assert.equal(objectDataUrl.contentWindow.parent, gWindow, "gWindow is parent");
 }
 
 async function mozBrowserTests(browser) {
   info("Granting special powers for mozbrowser");
   SpecialPowers.addPermission("browser", true, TEST_URI);
-  SpecialPowers.setBoolPref('dom.mozBrowserFramesEnabled', true);
-  SpecialPowers.setBoolPref('network.disable.ipc.security', true);
+  SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
+  SpecialPowers.setBoolPref("network.disable.ipc.security", true);
 
   await ContentTask.spawn(browser, null, function() {
     info("Checking mozbrowser iframe");
     let mozBrowserFrame = content.document.createElement("iframe");
     mozBrowserFrame.setAttribute("mozbrowser", "");
     content.document.body.appendChild(mozBrowserFrame);
     Assert.equal(mozBrowserFrame.contentWindow.top, mozBrowserFrame.contentWindow,
         "Mozbrowser top == iframe window");
     Assert.equal(mozBrowserFrame.contentWindow.parent, mozBrowserFrame.contentWindow,
         "Mozbrowser parent == iframe window");
   });
 
   info("Revoking special powers for mozbrowser");
-  SpecialPowers.clearUserPref('dom.mozBrowserFramesEnabled');
-  SpecialPowers.clearUserPref('network.disable.ipc.security');
+  SpecialPowers.clearUserPref("dom.mozBrowserFramesEnabled");
+  SpecialPowers.clearUserPref("network.disable.ipc.security");
   SpecialPowers.removePermission("browser", TEST_URI);
 }
--- a/dom/tests/browser/browser_hasbeforeunload.js
+++ b/dom/tests/browser/browser_hasbeforeunload.js
@@ -50,17 +50,17 @@ function addBeforeUnloadListeners(browse
  *        to 1, which is the first subframe inside the top-level content
  *        window. Setting this to 0 will throw.
  * @return {Promise}
  */
 function addOuterBeforeUnloadListeners(browser, howMany = 1, frameDepth = 1) {
   if (frameDepth == 0) {
     throw new Error("When adding a beforeunload listener on an outer " +
                     "window, the frame you're targeting needs to be at " +
-                    "depth > 0.")
+                    "depth > 0.");
   }
 
   return controlFrameAt(browser, frameDepth, {
     name: "AddOuterBeforeUnload",
     howMany,
   });
 }
 
@@ -110,17 +110,17 @@ function removeBeforeUnloadListeners(bro
  *        to 1, which is the first subframe inside the top-level content
  *        window. Setting this to 0 will throw.
  * @return {Promise}
  */
 function removeOuterBeforeUnloadListeners(browser, howMany = 1, frameDepth = 1) {
   if (frameDepth == 0) {
     throw new Error("When removing a beforeunload listener from an outer " +
                     "window, the frame you're targeting needs to be at " +
-                    "depth > 0.")
+                    "depth > 0.");
   }
 
   return controlFrameAt(browser, frameDepth, {
     name: "RemoveOuterBeforeUnload",
     howMany,
   });
 }
 
@@ -440,18 +440,18 @@ add_task(async function test_inner_windo
     //
     // <top-level content window at PAGE_URL> (TOP)
     // |
     // |--> <iframe at PAGE_URL> (MIDDLE)
     //      |
     //      |--> <iframe at PAGE_URL> (BOTTOM)
     //
     await prepareSubframes(browser, [
-      { sandboxAttributes: null, },
-      { sandboxAttributes: null, },
+      { sandboxAttributes: null },
+      { sandboxAttributes: null },
     ]);
     // These constants are just to make it easier to know which
     // frame we're referring to without having to remember the
     // exact indices.
     const TOP = 0;
     const MIDDLE = 1;
     const BOTTOM = 2;
 
@@ -483,79 +483,79 @@ add_task(async function test_inner_windo
     await addBeforeUnloadListeners(browser, 5, BOTTOM);
     assertHasBeforeUnload(browser, true);
 
     await navigateSubframe(browser, "http://example.com", BOTTOM);
     assertHasBeforeUnload(browser, false);
 
     // Reset our window structure now.
     await prepareSubframes(browser, [
-      { sandboxAttributes: null, },
-      { sandboxAttributes: null, },
+      { sandboxAttributes: null },
+      { sandboxAttributes: null },
     ]);
 
     // This time, add beforeunload event listeners to both the
     // MIDDLE and BOTTOM frame, and then navigate the MIDDLE
     // away. This should set hasBeforeUnload to false.
     await addBeforeUnloadListeners(browser, 3, MIDDLE);
     await addBeforeUnloadListeners(browser, 1, BOTTOM);
     assertHasBeforeUnload(browser, true);
     await navigateSubframe(browser, "http://example.com", MIDDLE);
     assertHasBeforeUnload(browser, false);
 
     // Tests that if the MIDDLE and BOTTOM frames have beforeunload
     // event listeners, and if we remove the BOTTOM <iframe> and the
     // MIDDLE <iframe>, that hasBeforeUnload is set to false.
     await prepareSubframes(browser, [
-      { sandboxAttributes: null, },
-      { sandboxAttributes: null, },
+      { sandboxAttributes: null },
+      { sandboxAttributes: null },
     ]);
     await addBeforeUnloadListeners(browser, 3, MIDDLE);
     await addBeforeUnloadListeners(browser, 1, BOTTOM);
     assertHasBeforeUnload(browser, true);
     await removeSubframeFrom(browser, MIDDLE);
     assertHasBeforeUnload(browser, true);
     await removeSubframeFrom(browser, TOP);
     assertHasBeforeUnload(browser, false);
 
     // Tests that if the MIDDLE and BOTTOM frames have beforeunload
     // event listeners, and if we remove just the MIDDLE <iframe>, that
     // hasBeforeUnload is set to false.
     await prepareSubframes(browser, [
-      { sandboxAttributes: null, },
-      { sandboxAttributes: null, },
+      { sandboxAttributes: null },
+      { sandboxAttributes: null },
     ]);
     await addBeforeUnloadListeners(browser, 3, MIDDLE);
     await addBeforeUnloadListeners(browser, 1, BOTTOM);
     assertHasBeforeUnload(browser, true);
     await removeSubframeFrom(browser, TOP);
     assertHasBeforeUnload(browser, false);
 
     // Test that two sandboxed iframes, _without_ the allow-modals
     // permission, do not result in the hasBeforeUnload attribute
     // being set to true when beforeunload event listeners are added.
     await prepareSubframes(browser, [
-      { sandboxAttributes: "allow-scripts", },
-      { sandboxAttributes: "allow-scripts", },
+      { sandboxAttributes: "allow-scripts" },
+      { sandboxAttributes: "allow-scripts" },
     ]);
 
     await addBeforeUnloadListeners(browser, 3, MIDDLE);
     await addBeforeUnloadListeners(browser, 1, BOTTOM);
     assertHasBeforeUnload(browser, false);
 
     await removeBeforeUnloadListeners(browser, 3, MIDDLE);
     await removeBeforeUnloadListeners(browser, 1, BOTTOM);
     assertHasBeforeUnload(browser, false);
 
     // Test that two sandboxed iframes, both with the allow-modals
     // permission, cause the hasBeforeUnload attribute to be set
     // to true when beforeunload event listeners are added.
     await prepareSubframes(browser, [
-      { sandboxAttributes: "allow-scripts allow-modals", },
-      { sandboxAttributes: "allow-scripts allow-modals", },
+      { sandboxAttributes: "allow-scripts allow-modals" },
+      { sandboxAttributes: "allow-scripts allow-modals" },
     ]);
 
     await addBeforeUnloadListeners(browser, 3, MIDDLE);
     await addBeforeUnloadListeners(browser, 1, BOTTOM);
     assertHasBeforeUnload(browser, true);
 
     await removeBeforeUnloadListeners(browser, 1, BOTTOM);
     assertHasBeforeUnload(browser, true);
@@ -586,18 +586,18 @@ add_task(async function test_outer_windo
     //
     // <top-level content window at PAGE_URL> (TOP)
     // |
     // |--> <iframe at PAGE_URL> (MIDDLE)
     //      |
     //      |--> <iframe at PAGE_URL> (BOTTOM)
     //
     await prepareSubframes(browser, [
-      { sandboxAttributes: null, },
-      { sandboxAttributes: null, },
+      { sandboxAttributes: null },
+      { sandboxAttributes: null },
     ]);
 
     // These constants are just to make it easier to know which
     // frame we're referring to without having to remember the
     // exact indices.
     const TOP = 0;
     const MIDDLE = 1;
     const BOTTOM = 2;
@@ -636,18 +636,18 @@ add_task(async function test_outer_windo
     // the next few tests.
     BrowserTestUtils.loadURI(browser, PAGE_URL);
     await BrowserTestUtils.browserLoaded(browser);
 
     // We should initially start with hasBeforeUnload set to false.
     assertHasBeforeUnload(browser, false);
 
     await prepareSubframes(browser, [
-      { sandboxAttributes: null, },
-      { sandboxAttributes: null, },
+      { sandboxAttributes: null },
+      { sandboxAttributes: null },
     ]);
 
     // Tests that if there are beforeunload event listeners on
     // all levels of our window structure, that we only set
     // hasBeforeUnload to false once the last beforeunload
     // listener has been unset.
     await addOuterBeforeUnloadListeners(browser, 3, MIDDLE);
     assertHasBeforeUnload(browser, true);
@@ -669,85 +669,85 @@ add_task(async function test_outer_windo
     assertHasBeforeUnload(browser, true);
 
     // Now navigate that BOTTOM frame.
     await navigateSubframe(browser, "http://example.com", BOTTOM);
     assertHasBeforeUnload(browser, false);
 
     // Reset our window structure now.
     await prepareSubframes(browser, [
-      { sandboxAttributes: null, },
-      { sandboxAttributes: null, },
+      { sandboxAttributes: null },
+      { sandboxAttributes: null },
     ]);
 
     // This time, add beforeunload event listeners to the outer
     // windows for MIDDLE and BOTTOM. Then navigate the MIDDLE
     // frame. This should set hasBeforeUnload to false.
     await addOuterBeforeUnloadListeners(browser, 3, MIDDLE);
     await addOuterBeforeUnloadListeners(browser, 1, BOTTOM);
     assertHasBeforeUnload(browser, true);
     await navigateSubframe(browser, "http://example.com", MIDDLE);
     assertHasBeforeUnload(browser, false);
 
     // Adds beforeunload event listeners to the outer windows of
     // MIDDLE and BOTOTM, and then removes those iframes. Removing
     // both iframes should set hasBeforeUnload to false.
     await prepareSubframes(browser, [
-      { sandboxAttributes: null, },
-      { sandboxAttributes: null, },
+      { sandboxAttributes: null },
+      { sandboxAttributes: null },
     ]);
     await addOuterBeforeUnloadListeners(browser, 3, MIDDLE);
     await addOuterBeforeUnloadListeners(browser, 1, BOTTOM);
     assertHasBeforeUnload(browser, true);
     await removeSubframeFrom(browser, BOTTOM);
     assertHasBeforeUnload(browser, true);
     await removeSubframeFrom(browser, MIDDLE);
     assertHasBeforeUnload(browser, false);
 
     // Adds beforeunload event listeners to the outer windows of MIDDLE
     // and BOTTOM, and then removes just the MIDDLE iframe (which will
     // take the bottom one with it). This should set hasBeforeUnload to
     // false.
     await prepareSubframes(browser, [
-      { sandboxAttributes: null, },
-      { sandboxAttributes: null, },
+      { sandboxAttributes: null },
+      { sandboxAttributes: null },
     ]);
     await addOuterBeforeUnloadListeners(browser, 3, MIDDLE);
     await addOuterBeforeUnloadListeners(browser, 1, BOTTOM);
     assertHasBeforeUnload(browser, true);
     await removeSubframeFrom(browser, TOP);
     assertHasBeforeUnload(browser, false);
 
     // Test that two sandboxed iframes, _without_ the allow-modals
     // permission, do not result in the hasBeforeUnload attribute
     // being set to true when beforeunload event listeners are added
     // to the outer windows. Note that this requires the
     // allow-same-origin permission, otherwise a cross-origin
     // security exception is thrown.
     await prepareSubframes(browser, [
-      { sandboxAttributes: "allow-same-origin allow-scripts", },
-      { sandboxAttributes: "allow-same-origin allow-scripts", },
+      { sandboxAttributes: "allow-same-origin allow-scripts" },
+      { sandboxAttributes: "allow-same-origin allow-scripts" },
     ]);
 
     await addOuterBeforeUnloadListeners(browser, 3, MIDDLE);
     await addOuterBeforeUnloadListeners(browser, 1, BOTTOM);
     assertHasBeforeUnload(browser, false);
 
     await removeOuterBeforeUnloadListeners(browser, 3, MIDDLE);
     await removeOuterBeforeUnloadListeners(browser, 1, BOTTOM);
     assertHasBeforeUnload(browser, false);
 
     // Test that two sandboxed iframes, both with the allow-modals
     // permission, cause the hasBeforeUnload attribute to be set
     // to true when beforeunload event listeners are added. Note
     // that this requires the allow-same-origin permission,
     // otherwise a cross-origin security exception is thrown.
     await prepareSubframes(browser, [
-      { sandboxAttributes: "allow-same-origin allow-scripts allow-modals", },
-      { sandboxAttributes: "allow-same-origin allow-scripts allow-modals", },
+      { sandboxAttributes: "allow-same-origin allow-scripts allow-modals" },
+      { sandboxAttributes: "allow-same-origin allow-scripts allow-modals" },
     ]);
 
     await addOuterBeforeUnloadListeners(browser, 3, MIDDLE);
     await addOuterBeforeUnloadListeners(browser, 1, BOTTOM);
     assertHasBeforeUnload(browser, true);
 
     await removeOuterBeforeUnloadListeners(browser, 1, BOTTOM);
     assertHasBeforeUnload(browser, true);
@@ -776,18 +776,18 @@ add_task(async function test_mixed_inner
     //
     // <top-level content window at PAGE_URL> (TOP)
     // |
     // |--> <iframe at PAGE_URL> (MIDDLE)
     //      |
     //      |--> <iframe at PAGE_URL> (BOTTOM)
     //
     await prepareSubframes(browser, [
-      { sandboxAttributes: null, },
-      { sandboxAttributes: null, },
+      { sandboxAttributes: null },
+      { sandboxAttributes: null },
     ]);
 
     // These constants are just to make it easier to know which
     // frame we're referring to without having to remember the
     // exact indices.
     const TOP = 0;
     const MIDDLE = 1;
     const BOTTOM = 2;
--- a/dom/tests/browser/browser_largeAllocation_non_win32.js
+++ b/dom/tests/browser/browser_largeAllocation_non_win32.js
@@ -8,32 +8,32 @@ add_task(async function() {
     set: [
       // Enable the header if it is disabled
       ["dom.largeAllocationHeader.enabled", true],
       // Force-enable process creation with large-allocation, such that non
       // win32 builds can test the behavior.
       ["dom.largeAllocation.forceEnable", true],
       // Increase processCount.webLargeAllocation to avoid any races where
       // processes aren't being cleaned up quickly enough.
-      ["dom.ipc.processCount.webLargeAllocation", 20]
-    ]
+      ["dom.ipc.processCount.webLargeAllocation", 20],
+    ],
   });
 
   await largeAllocSuccessTests();
 });
 
 add_task(async function() {
   info("Test 2 - not force enabling the Large-Allocation header");
   await SpecialPowers.pushPrefEnv({
     set: [
       // Enable the header if it is disabled
       ["dom.largeAllocationHeader.enabled", true],
       // Force-enable process creation with large-allocation, such that non
       // win32 builds can test the behavior.
       ["dom.largeAllocation.forceEnable", false],
       // Increase processCount.webLargeAllocation to avoid any races where
       // processes aren't being cleaned up quickly enough.
-      ["dom.ipc.processCount.webLargeAllocation", 20]
-    ]
+      ["dom.ipc.processCount.webLargeAllocation", 20],
+    ],
   });
 
   await largeAllocFailTests();
 });
--- a/dom/tests/browser/browser_largeAllocation_win32.js
+++ b/dom/tests/browser/browser_largeAllocation_win32.js
@@ -4,15 +4,15 @@ Services.scriptloader.loadSubScript(test
 add_task(async function() {
   info("Test 1 - On win32 - no forceEnable pref");
   await SpecialPowers.pushPrefEnv({
     set: [
       // Enable the header if it is disabled
       ["dom.largeAllocationHeader.enabled", true],
       // Increase processCount.webLargeAllocation to avoid any races where
       // processes aren't being cleaned up quickly enough.
-      ["dom.ipc.processCount.webLargeAllocation", 20]
-    ]
+      ["dom.ipc.processCount.webLargeAllocation", 20],
+    ],
   });
 
   await largeAllocSuccessTests();
 });
 
--- a/dom/tests/browser/browser_localStorage_e10s.js
+++ b/dom/tests/browser/browser_localStorage_e10s.js
@@ -1,34 +1,102 @@
 const HELPER_PAGE_URL =
   "http://example.com/browser/dom/tests/browser/page_localstorage_e10s.html";
 const HELPER_PAGE_ORIGIN = "http://example.com/";
 
 let testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
 Services.scriptloader.loadSubScript(testDir + "/helper_localStorage_e10s.js",
                                     this);
+// Simple tab wrapper abstracting our messaging mechanism;
+class KnownTab {
+  constructor(name, tab) {
+    this.name = name;
+    this.tab = tab;
+  }
+
+  cleanup() {
+    this.tab = null;
+  }
+}
+
+// Simple data structure class to help us track opened tabs and their pids.
+class KnownTabs {
+  constructor() {
+    this.byPid = new Map();
+    this.byName = new Map();
+  }
+
+  cleanup() {
+    this.byPid = null;
+    this.byName = null;
+  }
+}
+
+/**
+ * Open our helper page in a tab in its own content process, asserting that it
+ * really is in its own process.  We initially load and wait for about:blank to
+ * load, and only then loadURI to our actual page.  This is to ensure that
+ * LocalStorageManager has had an opportunity to be created and populate
+ * mOriginsHavingData.
+ *
+ * (nsGlobalWindow will reliably create LocalStorageManager as a side-effect of
+ * the unconditional call to nsGlobalWindow::PreloadLocalStorage.  This will
+ * reliably create the StorageDBChild instance, and its corresponding
+ * StorageDBParent will send the set of origins when it is constructed.)
+ */
+async function openTestTabInOwnProcess(name, knownTabs) {
+  let realUrl = HELPER_PAGE_URL + "?" + encodeURIComponent(name);
+  // Load and wait for about:blank.
+  let tab = await BrowserTestUtils.openNewForegroundTab({
+    gBrowser, opening: "about:blank", forceNewProcess: true,
+  });
+  let pid = tab.linkedBrowser.frameLoader.tabParent.osPid;
+  ok(!knownTabs.byName.has(name), "tab needs its own name: " + name);
+  ok(!knownTabs.byPid.has(pid), "tab needs to be in its own process: " + pid);
+
+  let knownTab = new KnownTab(name, tab);
+  knownTabs.byPid.set(pid, knownTab);
+  knownTabs.byName.set(name, knownTab);
+
+  // Now trigger the actual load of our page.
+  BrowserTestUtils.loadURI(tab.linkedBrowser, realUrl);
+  await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
+  is(tab.linkedBrowser.frameLoader.tabParent.osPid, pid, "still same pid");
+  return knownTab;
+}
+
+/**
+ * Close all the tabs we opened.
+ */
+async function cleanupTabs(knownTabs) {
+  for (let knownTab of knownTabs.byName.values()) {
+    BrowserTestUtils.removeTab(knownTab.tab);
+    knownTab.cleanup();
+  }
+  knownTabs.cleanup();
+}
 
 /**
  * Wait for a LocalStorage flush to occur.  This notification can occur as a
  * result of any of:
  * - The normal, hardcoded 5-second flush timer.
  * - InsertDBOp seeing a preload op for an origin with outstanding changes.
  * - Us generating a "domstorage-test-flush-force" observer notification.
  */
 function waitForLocalStorageFlush() {
   if (Services.lsm.nextGenLocalStorageEnabled) {
     return new Promise(resolve => executeSoon(resolve));
   }
 
   return new Promise(function(resolve) {
     let observer = {
-      observe: function() {
+      observe() {
         SpecialPowers.removeObserver(observer, "domstorage-test-flushed");
         resolve();
-      }
+      },
     };
     SpecialPowers.addObserver(observer, "domstorage-test-flushed");
   });
 }
 
 /**
  * Trigger and wait for a flush.  This is only necessary for forcing
  * mOriginsHavingData to be updated.  Normal operations exposed to content know
@@ -45,17 +113,17 @@ function triggerAndWaitForLocalStorageFl
   }
 
   SpecialPowers.notifyObservers(null, "domstorage-test-flush-force");
   // This first wait is ambiguous...
   return waitForLocalStorageFlush().then(function() {
     // So issue a second flush and wait for that.
     SpecialPowers.notifyObservers(null, "domstorage-test-flush-force");
     return waitForLocalStorageFlush();
-  })
+  });
 }
 
 /**
  * Clear the origin's storage so that "OriginsHavingData" will return false for
  * our origin.  Note that this is only the case for AsyncClear() which is
  * explicitly issued against a cache, or AsyncClearAll() which we can trigger
  * by wiping all storage.  However, the more targeted domain clearings that
  * we can trigger via observer, AsyncClearMatchingOrigin and
@@ -257,17 +325,17 @@ add_task(async function() {
       //
       // This is done in conjunction with our use of forceNewProcess when
       // opening tabs.  There would be no point if we weren't also requesting a
       // new process.
       ["dom.ipc.processPrelaunch.enabled", false],
       // Enable LocalStorage's testing API so we can explicitly trigger a flush
       // when needed.
       ["dom.storage.testing", true],
-    ]
+    ],
   });
 
   // Ensure that there is no localstorage data or potential false positives for
   // localstorage preloads by forcing the origin to be cleared prior to the
   // start of our test.
   await clearOriginStorageEnsuringNoPreload();
 
   // Make sure mOriginsHavingData gets updated.
@@ -285,40 +353,40 @@ add_task(async function() {
     "lateWriteThenListen", knownTabs);
 
   // Sanity check that preloading did not occur in the tabs.
   await verifyTabPreload(writerTab, false);
   await verifyTabPreload(listenerTab, false);
   await verifyTabPreload(readerTab, false);
 
   // - Configure the tabs.
-  const initialSentinel = 'initial';
+  const initialSentinel = "initial";
   const noSentinelCheck = null;
   await recordTabStorageEvents(listenerTab, initialSentinel);
 
   // - Issue the initial batch of writes and verify.
   info("initial writes");
   const initialWriteMutations = [
-    //[key (null=clear), newValue (null=delete), oldValue (verification)]
+    // [key (null=clear), newValue (null=delete), oldValue (verification)]
     ["getsCleared", "1", null],
     ["alsoGetsCleared", "2", null],
     [null, null, null],
     ["stays", "3", null],
     ["clobbered", "pre", null],
     ["getsDeletedLater", "4", null],
     ["getsDeletedImmediately", "5", null],
     ["getsDeletedImmediately", null, "5"],
     ["alsoStays", "6", null],
     ["getsDeletedLater", null, "4"],
-    ["clobbered", "post", "pre"]
+    ["clobbered", "post", "pre"],
   ];
   const initialWriteState = {
     stays: "3",
     clobbered: "post",
-    alsoStays: "6"
+    alsoStays: "6",
   };
 
   await mutateTabStorage(writerTab, initialWriteMutations, initialSentinel);
 
   // We expect the writer tab to have the correct state because it just did the
   // writes.  We do not perform a sentinel-check because the writes should be
   // locally available and consistent.
   await verifyTabStorageState(writerTab, initialWriteState, noSentinelCheck);
@@ -344,27 +412,27 @@ add_task(async function() {
   // - Issue second set of writes from lateWriteThenListen
   // This tests that our new tab that begins by issuing only writes is building
   // on top of the existing state (although we don't verify that until after the
   // next set of mutations).  We also verify that the initial "writerTab" that
   // was our first tab and started with only writes sees the writes, even though
   // it did not add an event listener.
 
   info("late writes");
-  const lateWriteSentinel = 'lateWrite';
+  const lateWriteSentinel = "lateWrite";
   const lateWriteMutations = [
     ["lateStays", "10", null],
     ["lateClobbered", "latePre", null],
     ["lateDeleted", "11", null],
     ["lateClobbered", "lastPost", "latePre"],
-    ["lateDeleted", null, "11"]
+    ["lateDeleted", null, "11"],
   ];
   const lateWriteState = Object.assign({}, initialWriteState, {
     lateStays: "10",
-    lateClobbered: "lastPost"
+    lateClobbered: "lastPost",
   });
 
   await recordTabStorageEvents(listenerTab, lateWriteSentinel);
 
   await mutateTabStorage(
     lateWriteThenListenTab, lateWriteMutations, lateWriteSentinel);
 
   // Verify the writer tab saw the writes.  It has to wait for the sentinel to
@@ -374,27 +442,27 @@ add_task(async function() {
   await verifyTabStorageEvents(
     listenerTab, lateWriteMutations, lateWriteSentinel);
   await verifyTabStorageState(listenerTab, lateWriteState, noSentinelCheck);
   // We need to wait for the sentinel to show up for the reader.
   await verifyTabStorageState(readerTab, lateWriteState, lateWriteSentinel);
 
   // - Issue last set of writes from writerTab.
   info("last set of writes");
-  const lastWriteSentinel = 'lastWrite';
+  const lastWriteSentinel = "lastWrite";
   const lastWriteMutations = [
     ["lastStays", "20", null],
     ["lastDeleted", "21", null],
     ["lastClobbered", "lastPre", null],
     ["lastClobbered", "lastPost", "lastPre"],
-    ["lastDeleted", null, "21"]
+    ["lastDeleted", null, "21"],
   ];
   const lastWriteState = Object.assign({}, lateWriteState, {
     lastStays: "20",
-    lastClobbered: "lastPost"
+    lastClobbered: "lastPost",
   });
 
   await recordTabStorageEvents(listenerTab, lastWriteSentinel);
   await recordTabStorageEvents(lateWriteThenListenTab, lastWriteSentinel);
 
   await mutateTabStorage(writerTab, lastWriteMutations, lastWriteSentinel);
 
   // The writer performed the writes, no need to wait for the sentinel.
--- a/dom/tests/browser/browser_localStorage_privatestorageevent.js
+++ b/dom/tests/browser/browser_localStorage_privatestorageevent.js
@@ -1,19 +1,19 @@
 add_task(async function() {
   var privWin = OpenBrowserWindow({private: true});
   await new privWin.Promise(resolve => {
-    privWin.addEventListener('load', function() {
+    privWin.addEventListener("load", function() {
       resolve();
     }, {once: true});
   });
 
   var pubWin = OpenBrowserWindow({private: false});
   await new pubWin.Promise(resolve => {
-    pubWin.addEventListener('load', function() {
+    pubWin.addEventListener("load", function() {
       resolve();
     }, {once: true});
   });
 
   var URL = "http://mochi.test:8888/browser/dom/tests/browser/page_privatestorageevent.html";
 
   var privTab = BrowserTestUtils.addTab(privWin.gBrowser, URL);
   await BrowserTestUtils.browserLoaded(privWin.gBrowser.getBrowserForTab(privTab));
@@ -21,48 +21,48 @@ add_task(async function() {
 
   var pubTab = BrowserTestUtils.addTab(pubWin.gBrowser, URL);
   await BrowserTestUtils.browserLoaded(pubWin.gBrowser.getBrowserForTab(pubTab));
   var pubBrowser = gBrowser.getBrowserForTab(pubTab);
 
   // Check if pubWin can see privWin's storage events
   await ContentTask.spawn(pubBrowser, null, function(opts) {
     content.window.gotStorageEvent = false;
-    content.window.addEventListener('storage', ev => {
+    content.window.addEventListener("storage", ev => {
       content.window.gotStorageEvent = true;
     });
   });
 
   await ContentTask.spawn(privBrowser, null, function(opts) {
-    content.window.localStorage['key'] = 'ablooabloo';
+    content.window.localStorage.key = "ablooabloo";
   });
 
   let pubSaw = await ContentTask.spawn(pubBrowser, null, function(opts) {
     return content.window.gotStorageEvent;
   });
 
   ok(!pubSaw, "pubWin shouldn't be able to see privWin's storage events");
 
   await ContentTask.spawn(privBrowser, null, function(opts) {
     content.window.gotStorageEvent = false;
-    content.window.addEventListener('storage', ev => {
+    content.window.addEventListener("storage", ev => {
       content.window.gotStorageEvent = true;
     });
   });
 
   // Check if privWin can see pubWin's storage events
   await ContentTask.spawn(privBrowser, null, function(opts) {
     content.window.gotStorageEvent = false;
-    content.window.addEventListener('storage', ev => {
+    content.window.addEventListener("storage", ev => {
       content.window.gotStorageEvent = true;
     });
   });
 
   await ContentTask.spawn(pubBrowser, null, function(opts) {
-    content.window.localStorage['key'] = 'ablooabloo';
+    content.window.localStorage.key = "ablooabloo";
   });
 
   let privSaw = await ContentTask.spawn(privBrowser, null, function(opts) {
     return content.window.gotStorageEvent;
   });
 
   ok(!privSaw, "privWin shouldn't be able to see pubWin's storage events");
 
--- a/dom/tests/browser/browser_noopener_null_uri.js
+++ b/dom/tests/browser/browser_noopener_null_uri.js
@@ -1,13 +1,13 @@
 add_task(async function browserNoopenerNullUri() {
   await BrowserTestUtils.withNewTab({gBrowser}, async function(aBrowser) {
     let numTabs = gBrowser.tabs.length;
     await ContentTask.spawn(aBrowser, null, async () => {
-      ok(!content.window.open(undefined, undefined, 'noopener'),
+      ok(!content.window.open(undefined, undefined, "noopener"),
          "window.open should return null");
     });
     await TestUtils.waitForCondition(() => gBrowser.tabs.length == numTabs + 1);
     // We successfully opened a tab in content process!
   });
   // We only have to close the tab we opened earlier
   await BrowserTestUtils.removeTab(gBrowser.tabs[1]);
 });
--- a/dom/tests/browser/browser_persist_cookies.js
+++ b/dom/tests/browser/browser_persist_cookies.js
@@ -82,13 +82,13 @@ add_task(async function() {
       let dls = await Downloads.getList(Downloads.PUBLIC);
       dls.addView({
         onDownloadChanged(download) {
           if (download.succeeded) {
             dls.removeView(this);
             dls.removeFinished();
             resolve();
           }
-        }
+        },
       });
     });
   });
 });
--- a/dom/tests/browser/browser_persist_mixed_content_image.js
+++ b/dom/tests/browser/browser_persist_mixed_content_image.js
@@ -77,17 +77,17 @@ add_task(async function test_image_downl
         onDownloadChanged(download) {
           info("Download changed!");
           if (download.succeeded || download.error) {
             info("Download succeeded or errored");
             dls.removeView(this);
             dls.removeFinished();
             resolve(download);
           }
-        }
+        },
       });
     });
     // open the context menu.
     let popup = document.getElementById("contentAreaContextMenu");
     let popupShown = BrowserTestUtils.waitForEvent(popup, "popupshown");
     BrowserTestUtils.synthesizeMouseAtCenter("img", {type: "contextmenu", button: 2}, browser);
     await popupShown;
     let popupHidden = BrowserTestUtils.waitForEvent(popup, "popuphidden");
--- a/dom/tests/browser/browser_test_new_window_from_content.js
+++ b/dom/tests/browser/browser_test_new_window_from_content.js
@@ -101,17 +101,17 @@ registerCleanupFunction(function() {
  *
  * @param aBrowser the <xul:browser> with the test document
  * @param aExpectation one of kSameTab, kNewWin, or kNewTab.
  * @return a Promise that resolves when the expectation is fulfilled,
  *         and cleaned up after.
  */
 function prepareForResult(aBrowser, aExpectation) {
   let expectedSpec = kContentDoc.replace(/[^\/]*$/, "dummy.html");
-  switch(aExpectation) {
+  switch (aExpectation) {
     case kSameTab:
       return (async function() {
         await BrowserTestUtils.browserLoaded(aBrowser);
         is(aBrowser.currentURI.spec, expectedSpec, "Should be at dummy.html");
         // Now put the browser back where it came from
         await BrowserTestUtils.loadURI(aBrowser, kContentDoc);
         await BrowserTestUtils.browserLoaded(aBrowser);
       })();
@@ -128,17 +128,17 @@ function prepareForResult(aBrowser, aExp
       return (async function() {
         let newTab = await BrowserTestUtils.waitForNewTab(gBrowser);
         is(newTab.linkedBrowser.currentURI.spec, expectedSpec,
            "Should be at dummy.html");
         BrowserTestUtils.removeTab(newTab);
       })();
       break;
     default:
-      ok(false, "prepareForResult can't handle an expectation of " + aExpectation)
+      ok(false, "prepareForResult can't handle an expectation of " + aExpectation);
       return;
   }
 
   return deferred.promise;
 }
 
 /**
  * Ensure that clicks on a link with ID aLinkID cause us to
--- a/dom/tests/browser/browser_test_toolbars_visibility.js
+++ b/dom/tests/browser/browser_test_toolbars_visibility.js
@@ -39,17 +39,17 @@ function getToolbarsFromBrowserContent(a
  */
 function getToolbarsFromWindowChrome(win) {
   return {
     toolbar: win.toolbar.visible,
     menubar: win.menubar.visible,
     personalbar: win.personalbar.visible,
     statusbar: win.statusbar.visible,
     locationbar: win.locationbar.visible,
-  }
+  };
 }
 
 /**
  * Tests toolbar visibility when opening a window with default parameters.
  *
  * @param toolbars
  *        the visibility state of the toolbar elements
  */
--- a/dom/tests/browser/browser_xhr_sandbox.js
+++ b/dom/tests/browser/browser_xhr_sandbox.js
@@ -10,32 +10,32 @@ var sandboxCode = (function() {
       let result;
       if (req.status != 200) {
         result = "ERROR: got request status of " + req.status;
       } else if (req.responseText.length == 0) {
         result = "ERROR: got zero byte response text";
       } else {
         result = "ok";
       }
-      postMessage({result: result}, "*");
+      postMessage({result}, "*");
     }
   };
   req.send(null);
 }).toSource() + "();";
 
 function test() {
   waitForExplicitFinish();
   let appShell = Cc["@mozilla.org/appshell/appShellService;1"]
                   .getService(Ci.nsIAppShellService);
   let doc = appShell.hiddenDOMWindow.document;
   let frame = doc.createElement("iframe");
   frame.setAttribute("type", "content");
   frame.setAttribute("src", "http://mochi.test:8888/browser/dom/tests/browser/browser_xhr_sandbox.js");
 
-  frame.addEventListener("load", function () {
+  frame.addEventListener("load", function() {
     let workerWindow = frame.contentWindow;
     workerWindow.addEventListener("message", function(evt) {
       is(evt.data.result, "ok", "check the sandbox code was happy");
       frame.remove();
       finish();
     }, true);
     let sandbox = new Cu.Sandbox(workerWindow);
     // inject some functions from the window into the sandbox.
--- a/dom/tests/browser/helper_largeAllocation.js
+++ b/dom/tests/browser/helper_largeAllocation.js
@@ -63,18 +63,18 @@ async function largeAllocSuccessTests() 
     set: [
       // Enable the header if it is disabled
       ["dom.largeAllocationHeader.enabled", true],
       // Force-enable process creation with large-allocation, such that non
       // win32 builds can test the behavior.
       ["dom.largeAllocation.forceEnable", !isWin32],
       // Increase processCount.webLargeAllocation to avoid any races where
       // processes aren't being cleaned up quickly enough.
-      ["dom.ipc.processCount.webLargeAllocation", 20]
-    ]
+      ["dom.ipc.processCount.webLargeAllocation", 20],
+    ],
   });
 
   // A toplevel tab should be able to navigate cross process!
   await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) {
     info("Starting test 0");
     let pid1 = await getPID(aBrowser);
     is(false, await getInLAProc(aBrowser));
 
@@ -101,17 +101,17 @@ async function largeAllocSuccessTests() 
 
     // Fail the test if we create a process
     let stopExpectNoProcess = expectNoProcess();
 
     await ContentTask.spawn(aBrowser, TEST_URI, TEST_URI => {
       content.document.body.innerHTML = `<iframe src='${TEST_URI}'></iframe>`;
 
       return new Promise(resolve => {
-        content.document.body.querySelector('iframe').onload = () => {
+        content.document.body.querySelector("iframe").onload = () => {
           ok(true, "Iframe finished loading");
           resolve();
         };
       });
     });
 
     let pid2 = await getPID(aBrowser);
 
@@ -126,21 +126,21 @@ async function largeAllocSuccessTests() 
     info("Starting test 2");
     let pid1 = await getPID(aBrowser);
     is(false, await getInLAProc(aBrowser));
 
     // Fail the test if we create a process
     let stopExpectNoProcess = expectNoProcess();
 
     let loaded = ContentTask.spawn(aBrowser, TEST_URI, TEST_URI => {
-      content.document.body.innerHTML = '<button>CLICK ME</button>';
+      content.document.body.innerHTML = "<button>CLICK ME</button>";
 
       return new Promise(resolve => {
-        content.document.querySelector('button').onclick = e => {
-          let w = content.window.open(TEST_URI, '_blank');
+        content.document.querySelector("button").onclick = e => {
+          let w = content.window.open(TEST_URI, "_blank");
           w.onload = () => {
             ok(true, "Window finished loading");
             w.close();
             resolve();
           };
         };
       });
     });
@@ -435,17 +435,17 @@ async function largeAllocSuccessTests() 
   });
 
   // Try opening a new Large-Allocation document when at the max number of large
   // allocation processes.
   await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) {
     info("Starting test 8");
     await SpecialPowers.pushPrefEnv({
       set: [
-        ["dom.ipc.processCount.webLargeAllocation", 1]
+        ["dom.ipc.processCount.webLargeAllocation", 1],
       ],
     });
 
     // Loading the first Large-Allocation tab should succeed as normal
     let pid1 = await getPID(aBrowser);
     is(false, await getInLAProc(aBrowser));
 
     let ready = Promise.all([expectProcessCreated(),
@@ -507,17 +507,17 @@ async function largeAllocSuccessTests() 
   });
 
   // Try dragging tab into new window when at the max number of large allocation
   // processes.
   await BrowserTestUtils.withNewTab("about:blank", async function(aBrowser) {
     info("Starting test 10");
     await SpecialPowers.pushPrefEnv({
       set: [
-        ["dom.ipc.processCount.webLargeAllocation", 1]
+        ["dom.ipc.processCount.webLargeAllocation", 1],
       ],
     });
 
     let pid1 = await getPID(aBrowser);
     is(false, await getInLAProc(aBrowser));
 
     let ready = Promise.all([expectProcessCreated(),
                              BrowserTestUtils.browserLoaded(aBrowser)]);
@@ -571,17 +571,17 @@ async function largeAllocSuccessTests() 
 
     isnot(pid1, pid2, "PIDs 1 and 2 should not match");
     is(true, await getInLAProc(aBrowser));
 
     await Promise.all([
       ContentTask.spawn(aBrowser, null, () => {
         content.document.querySelector("#submit").click();
       }),
-      BrowserTestUtils.browserLoaded(aBrowser)
+      BrowserTestUtils.browserLoaded(aBrowser),
     ]);
 
     let innerText = await ContentTask.spawn(aBrowser, null, () => {
       return content.document.body.innerText;
     });
     isnot(innerText, "FAIL", "We should not have sent a get request!");
     is(innerText, "textarea=default+value&button=submit",
        "The post data should be received by the callee");
--- a/dom/tests/browser/page_localstorage_e10s.html
+++ b/dom/tests/browser/page_localstorage_e10s.html
@@ -46,17 +46,17 @@
  **/
 var pageName = document.location.search.substring(1);
 window.addEventListener(
   "load",
   () => { document.getElementById("pageNameH").textContent = pageName; });
 
 // Key that conveys the end of a write batch.  Filtered out from state and
 // events.
-const SENTINEL_KEY = 'WRITE_BATCH_SENTINEL';
+const SENTINEL_KEY = "WRITE_BATCH_SENTINEL";
 
 var storageEventsPromise = null;
 function listenForStorageEvents(sentinelValue) {
   const recordedEvents = [];
   storageEventsPromise = new Promise(function(resolve, reject) {
     window.addEventListener(
       "storage",
       function thisHandler(event) {
--- a/dom/tests/browser/perfmetrics/browser_test_performance_metrics.js
+++ b/dom/tests/browser/perfmetrics/browser_test_performance_metrics.js
@@ -15,20 +15,20 @@ const CATEGORY_TIMER = 2;
 
 let nextId = 0;
 
 function jsonrpc(tab, method, params) {
   let currentId = nextId++;
   let messageManager = tab.linkedBrowser.messageManager;
   messageManager.sendAsyncMessage("jsonrpc", {
     id: currentId,
-    method: method,
-    params: params
+    method,
+    params,
   });
-  return new Promise(function (resolve, reject) {
+  return new Promise(function(resolve, reject) {
     messageManager.addMessageListener("jsonrpc", function listener(event) {
       let { id, result, error } = event.data;
       if (id !== currentId) {
         return;
       }
       messageManager.removeMessageListener("jsonrpc", listener);
       if (error) {
         reject(error);
@@ -44,25 +44,25 @@ function postMessageToWorker(tab, messag
 }
 
 add_task(async function test() {
   // dom.performance.enable_scheduler_timing is set to true in browser.ini
   waitForExplicitFinish();
 
   // Load 3 pages and wait. The 3rd one has a worker
   let page1 = await BrowserTestUtils.openNewForegroundTab({
-    gBrowser, opening: "about:about", forceNewProcess: false
+    gBrowser, opening: "about:about", forceNewProcess: false,
   });
 
   let page2 = await BrowserTestUtils.openNewForegroundTab({
-    gBrowser, opening: "about:memory", forceNewProcess: false
+    gBrowser, opening: "about:memory", forceNewProcess: false,
   });
 
   let page3 = await BrowserTestUtils.openNewForegroundTab({
-    gBrowser, opening: WORKER_URL
+    gBrowser, opening: WORKER_URL,
   });
   // load a 4th tab with a worker
   await BrowserTestUtils.withNewTab({ gBrowser, url: WORKER_URL2 },
     async function(browser) {
     // grab events..
     let workerDuration = 0;
     let workerTotal = 0;
     let duration = 0;
@@ -85,17 +85,17 @@ add_task(async function test() {
           continue;
         }
         if (!counterIds.includes(entry.pid + ":" + entry.counterId)) {
           counterIds.push(entry.pid + ":" + entry.counterId);
         }
         sharedWorker = entry.host.endsWith("shared_worker.js") || sharedWorker;
         heapUsage += entry.memoryInfo.GCHeapUsage;
         mediaMemory += entry.memoryInfo.media.audioSize + entry.memoryInfo.media.resourcesSize;
-        Assert.ok(entry.host != "" || entry.windowId !=0,
+        Assert.ok(entry.host != "" || entry.windowId != 0,
                   "An entry should have a host or a windowId");
         if (entry.windowId != 0 && !entry.isToplevel && !entry.isWorker && !subFrameIds.includes(entry.windowId)) {
           subFrameIds.push(entry.windowId);
         }
         if (entry.isTopLevel && !topLevelIds.includes(entry.windowId)) {
           topLevelIds.push(entry.windowId);
         }
         if (entry.host == "example.com" && entry.isTopLevel) {
--- a/dom/tests/browser/perfmetrics/ping_worker.html
+++ b/dom/tests/browser/perfmetrics/ping_worker.html
@@ -3,24 +3,24 @@
 <head>
   <meta charset="utf-8">
   <script type="text/javascript">
 
   var myWorker;
   var shared;
 
   function init() {
-   myWorker = new Worker('ping_worker.js');
+   myWorker = new Worker("ping_worker.js");
    for (let i = 0; i++; i < 10) myWorker.postMessage("ping");
 
-   shared = new SharedWorker('shared_worker.js');
+   shared = new SharedWorker("shared_worker.js");
    shared.port.start();
    shared.port.onmessage = function(e) {
      console.log(e);
-   }
+   };
   }
 
   </script>
 </head>
 <body onload="init()">
   <h1>A page with a worker and a shared worker</h1>
 </body>
 </html>
--- a/dom/tests/browser/perfmetrics/ping_worker2.html
+++ b/dom/tests/browser/perfmetrics/ping_worker2.html
@@ -2,17 +2,17 @@
 <html lang="en" dir="ltr">
 <head>
   <meta charset="utf-8">
   <script type="text/javascript">
 
   var shared;
 
   function init() {
-   shared = new SharedWorker('shared_worker.js');
+   shared = new SharedWorker("shared_worker.js");
    shared.port.start();
    for (let i = 0; i++; i < 10) shared.port.postMessage(["ok"]);
   }
 
   </script>
 </head>
 <body onload="init()">
   <h1>A page with a shared worker</h1>
--- a/dom/tests/browser/shared_worker.js
+++ b/dom/tests/browser/shared_worker.js
@@ -1,9 +1,9 @@
 
 onconnect = function(e) {
   var port = e.ports[0];
 
   port.onmessage = function(e) {
-    var workerResult = 'Result: ' + (e.data[0] * e.data[1]);
+    var workerResult = "Result: " + (e.data[0] * e.data[1]);
     port.postMessage(e.data[0]);
-  }
-}
+  };
+};
--- a/dom/tests/browser/test-console-api.html
+++ b/dom/tests/browser/test-console-api.html
@@ -1,19 +1,19 @@
 <!DOCTYPE HTML>
 <html dir="ltr" xml:lang="en-US" lang="en-US"><head>
     <title>Console API test page</title>
     <script type="text/javascript">
       window.foobar585956c = function(a) {
         console.trace();
-        return a+"c";
+        return a + "c";
       };
 
       function foobar585956b(a) {
-        return foobar585956c(a+"b");
+        return foobar585956c(a + "b");
       }
 
       function foobar585956a(omg) {
         return foobar585956b(omg + "a");
       }
 
       function foobar646025(omg) {
         console.log(omg, "o", "d");
@@ -28,17 +28,17 @@
       }
 
       function namelessTimer() {
         console.time();
         console.timeEnd();
       }
 
       function test() {
-        var str = "Test Message."
+        var str = "Test Message.";
         console.foobar(str); // if this throws, we don't execute following funcs
         console.log(str);
         console.info(str);
         console.warn(str);
         console.error(str);
         console.exception(str);
         console.assert(false, str);
         console.count(str);
--- a/dom/tests/browser/test_bug1004814.html
+++ b/dom/tests/browser/test_bug1004814.html
@@ -1,14 +1,14 @@
 <!DOCTYPE HTML>
 <html>
   <head>
     <title>Console API test bug 1004814</title>
   </head>
   <body>
     <script>
 
-var w = new Worker('worker_bug1004814.js');
+var w = new Worker("worker_bug1004814.js");
 w.postMessage(true);
 
     </script>
   </body>
 </html>
--- a/dom/tests/browser/test_new_window_from_content_child.html
+++ b/dom/tests/browser/test_new_window_from_content_child.html
@@ -8,18 +8,18 @@
   <p><a id="winOpenNonDefault" href="#" onclick="return openWindow('resizable=no, location=no, personalbar=no, toolbar=no, scrollbars=no, menubar=no, status=no, directories=no, height=100, width=500');">Open a new window via window.open with non-default features.</a></p>
   <p><a id="winOpenDialog" href="#" onclick="return openWindow('dialog=yes');">Open a new window via window.open with dialog=1.</a></p>
   <p><a id="winOpenNoURLNonDefault" href="#" onclick="return openBlankWindow('location=no, toolbar=no, height=100, width=100');">Open a blank new window via window.open with non-default features.</a></p>
   <p><a id="targetBlank" href="dummy.html" target="_blank" rel="opener">Open a new window via target="_blank".</a></p>
 </body>
 </html>
 
 <script>
-function openWindow(aFeatures="") {
+function openWindow(aFeatures = "") {
   window.open("dummy.html", "_blank", aFeatures);
   return false;
 }
 
-function openBlankWindow(aFeatures="") {
+function openBlankWindow(aFeatures = "") {
   window.open("", "_blank", aFeatures);
   return false;
 }
 </script>
--- a/dom/tests/browser/worker_bug1004814.js
+++ b/dom/tests/browser/worker_bug1004814.js
@@ -1,6 +1,6 @@
 onmessage = function(evt) {
-  console.time('bug1004814');
+  console.time("bug1004814");
   setTimeout(function() {
-    console.timeEnd('bug1004814');
+    console.timeEnd("bug1004814");
   }, 200);
-}
+};