Bug 1457835 - Enable ESLint for testing/mochitest (automatic changes). r=jmaher
authorMark Banner <standard8@mozilla.com>
Fri, 26 Jan 2018 21:32:30 +0000
changeset 472795 53867132bf195f6be61840f0bda1147c73030089
parent 472794 9f6c1ddff4996ea26b2fcda3bd1f3d0925c6f338
child 472796 7da7e1e5be4976cd32b3ea79631858e9d8dbd749
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1457835
milestone61.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 1457835 - Enable ESLint for testing/mochitest (automatic changes). r=jmaher MozReview-Commit-ID: 4Et3MAxcEQl
testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
testing/mochitest/BrowserTestUtils/ContentTask.jsm
testing/mochitest/BrowserTestUtils/ContentTaskUtils.jsm
testing/mochitest/BrowserTestUtils/content/content-task.js
testing/mochitest/BrowserTestUtils/content/content-utils.js
testing/mochitest/ShutdownLeaksCollector.jsm
testing/mochitest/bootstrap.js
testing/mochitest/browser-test.js
testing/mochitest/chrome-harness.js
testing/mochitest/chrome/test_sanityPluginUtils.html
testing/mochitest/chunkifyTests.js
testing/mochitest/manifestLibrary.js
testing/mochitest/nested_setup.js
testing/mochitest/redirect.html
testing/mochitest/server.js
testing/mochitest/start_desktop.js
testing/mochitest/tests/browser/.eslintrc.js
testing/mochitest/tests/browser/browser_BrowserTestUtils.js
testing/mochitest/tests/browser/browser_browserLoaded_content_loaded.js
testing/mochitest/tests/browser/browser_getTestFile.js
testing/mochitest/tests/browser/browser_privileges.js
testing/mochitest/tests/browser/browser_waitForFocus.js
testing/mochitest/tests/browser/head.js
testing/mochitest/tests/python/files/.eslintrc.js
testing/mochitest/tests/python/files/test_assertion.html
testing/mochitest/tests/python/files/test_crash.html
--- a/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
+++ b/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
@@ -92,17 +92,17 @@ var BrowserTestUtils = {
    * @resolves When the tab has been closed.
    * @rejects Any exception from taskFn is propagated.
    */
   async withNewTab(options, taskFn) {
     if (typeof(options) == "string") {
       options = {
         gBrowser: Services.wm.getMostRecentWindow("navigator:browser").gBrowser,
         url: options
-      }
+      };
     }
     let tab = await BrowserTestUtils.openNewForegroundTab(options);
     let originalWindow = tab.ownerGlobal;
     let result = await taskFn(tab.linkedBrowser);
     let finalWindow = tab.ownerGlobal;
     if (originalWindow == finalWindow && !tab.closing && tab.linkedBrowser) {
       // taskFn may resolve within a tick after opening a new tab.
       // We shouldn't remove the newly opened tab in the same tick.
@@ -182,22 +182,21 @@ var BrowserTestUtils = {
       // If DEFAULT_PROCESSSELECTOR_CID is null, we're in non-e10s mode and we
       // should skip this.
       if (options.forceNewProcess && DEFAULT_PROCESSSELECTOR_CID) {
         registrar.registerFactory(OUR_PROCESSSELECTOR_CID, "",
                                   PROCESSSELECTOR_CONTRACTID, null);
       }
 
       promises = [
-        BrowserTestUtils.switchTab(tabbrowser, function () {
+        BrowserTestUtils.switchTab(tabbrowser, function() {
           if (typeof opening == "function") {
             opening();
             tab = tabbrowser.selectedTab;
-          }
-          else {
+          } else {
             tabbrowser.selectedTab = tab = tabbrowser.addTab(opening);
           }
         })
       ];
 
       if (aWaitForLoad) {
         promises.push(BrowserTestUtils.browserLoaded(tab.linkedBrowser));
       }
@@ -230,18 +229,17 @@ var BrowserTestUtils = {
     let promise = new Promise(resolve => {
       tabbrowser.addEventListener("TabSwitchDone", function() {
         TestUtils.executeSoon(() => resolve(tabbrowser.selectedTab));
       }, {once: true});
     });
 
     if (typeof tab == "function") {
       tab();
-    }
-    else {
+    } else {
       tabbrowser.selectedTab = tab;
     }
     return promise;
   },
 
   /**
    * Waits for an ongoing page load in a browser window to complete.
    *
@@ -262,39 +260,39 @@ var BrowserTestUtils = {
    * @param {optional boolean} maybeErrorPage
    *        If true, this uses DOMContentLoaded event instead of load event.
    *        Also wantLoad will be called with visible URL, instead of
    *        'about:neterror?...' for error page.
    *
    * @return {Promise}
    * @resolves When a load event is triggered for the browser.
    */
-  browserLoaded(browser, includeSubFrames=false, wantLoad=null,
-                maybeErrorPage=false) {
+  browserLoaded(browser, includeSubFrames = false, wantLoad = null,
+                maybeErrorPage = false) {
     // Passing a url as second argument is a common mistake we should prevent.
     if (includeSubFrames && typeof includeSubFrames != "boolean") {
-      throw("The second argument to browserLoaded should be a boolean.");
+      throw ("The second argument to browserLoaded should be a boolean.");
     }
 
     // If browser belongs to tabbrowser-tab, ensure it has been
     // inserted into the document.
     let tabbrowser = browser.ownerGlobal.gBrowser;
     if (tabbrowser && tabbrowser.getTabForBrowser) {
       tabbrowser._insertBrowser(tabbrowser.getTabForBrowser(browser));
     }
 
     function isWanted(url) {
       if (!wantLoad) {
         return true;
       } else if (typeof(wantLoad) == "function") {
         return wantLoad(url);
-      } else {
+      }
         // It's a string.
         return wantLoad == url;
-      }
+
     }
 
     return new Promise(resolve => {
       let mm = browser.ownerGlobal.messageManager;
       let eventName = maybeErrorPage
           ? "browser-test-utils:DOMContentLoadedEvent"
           : "browser-test-utils:loadEvent";
       mm.addMessageListener(eventName, function onLoad(msg) {
@@ -333,17 +331,17 @@ var BrowserTestUtils = {
     let mm = win.messageManager;
     return this.waitForMessage(mm, "browser-test-utils:loadEvent", (msg) => {
       if (checkFn) {
         return checkFn(msg.target);
       }
 
       let selectedBrowser = win.gBrowser.selectedBrowser;
       return msg.target == selectedBrowser &&
-             (aboutBlank || selectedBrowser.currentURI.spec != "about:blank")
+             (aboutBlank || selectedBrowser.currentURI.spec != "about:blank");
     });
   },
 
   _webProgressListeners: new Set(),
 
   /**
    * Waits for the web progress listener associated with this tab to fire a
    * STATE_STOP for the toplevel document.
@@ -354,17 +352,17 @@ var BrowserTestUtils = {
    *        A specific URL to check the channel load against
    * @param {Boolean} checkAborts (optional, defaults to false)
    *        Whether NS_BINDING_ABORTED stops 'count' as 'real' stops
    *        (e.g. caused by the stop button or equivalent APIs)
    *
    * @return {Promise}
    * @resolves When STATE_STOP reaches the tab's progress listener
    */
-  browserStopped(browser, expectedURI, checkAborts=false) {
+  browserStopped(browser, expectedURI, checkAborts = false) {
     return new Promise(resolve => {
       const kDocStopFlags = Ci.nsIWebProgressListener.STATE_IS_NETWORK |
                             Ci.nsIWebProgressListener.STATE_STOP;
       let wpl = {
         onStateChange(aWebProgress, aRequest, aStateFlags, aStatus) {
           dump("Saw state " + aStateFlags.toString(16) + " and status " + aStatus.toString(16) + "\n");
           if (aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK &&
               aStateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
@@ -372,17 +370,17 @@ var BrowserTestUtils = {
               aWebProgress.isTopLevel) {
             let chan = aRequest.QueryInterface(Ci.nsIChannel);
             dump("Browser loaded " + chan.originalURI.spec + "\n");
             if (!expectedURI || chan.originalURI.spec == expectedURI) {
               browser.removeProgressListener(wpl);
               BrowserTestUtils._webProgressListeners.delete(wpl);
               resolve();
             }
-          };
+          }
         },
         onSecurityChange() {},
         onStatusChange() {},
         onLocationChange() {},
         QueryInterface: ChromeUtils.generateQI([
           Ci.nsIWebProgressListener,
           Ci.nsIWebProgressListener2,
           Ci.nsISupportsWeakReference,
@@ -660,17 +658,17 @@ var BrowserTestUtils = {
    *                   remote browser tabs or not. If omitted, the window
    *                   will choose the profile default state.
    *          width: Desired width of window
    *          height: Desired height of window
    *        }
    * @return {Promise}
    *         Resolves with the new window once it is loaded.
    */
-  async openNewBrowserWindow(options={}) {
+  async openNewBrowserWindow(options = {}) {
     let argString = Cc["@mozilla.org/supports-string;1"].
                     createInstance(Ci.nsISupportsString);
     argString.data = "";
     let features = "chrome,dialog=no,all";
     let opener = null;
 
     if (options.opener) {
       opener = options.opener;
@@ -746,29 +744,29 @@ var BrowserTestUtils = {
    * @param {Window}
    *        The closing window.
    *
    * @return {Promise}
    *        Resolves when the provided window has been fully closed. For
    *        browser windows, the Promise will also wait until all final
    *        SessionStore messages have been sent up from all browser tabs.
    */
-  windowClosed(win)  {
+  windowClosed(win) {
     let domWinClosedPromise = BrowserTestUtils.domWindowClosed(win);
     let promises = [domWinClosedPromise];
     let winType = win.document.documentElement.getAttribute("windowtype");
 
     if (winType == "navigator:browser") {
       let finalMsgsPromise = new Promise((resolve) => {
         let browserSet = new Set(win.gBrowser.browsers);
         // Ensure all browsers have been inserted or we won't get
         // messages back from them.
         browserSet.forEach((browser) => {
           win.gBrowser._insertBrowser(win.gBrowser.getTabForBrowser(browser));
-        })
+        });
         let mm = win.getGroupMessageManager("browsers");
 
         mm.addMessageListener("SessionStore:update", function onMessage(msg) {
           if (browserSet.has(msg.target) && msg.data.isFinal) {
             browserSet.delete(msg.target);
             if (!browserSet.size) {
               mm.removeMessageListener("SessionStore:update", onMessage);
               // Give the TabStateFlusher a chance to react to this final
@@ -1098,18 +1096,17 @@ var BrowserTestUtils = {
    * @param {Object} event object
    *        Additional arguments, similar to the EventUtils.jsm version
    * @param {Browser} browser
    *        Browser element, must not be null
    *
    * @returns {Promise}
    * @resolves True if the mouse event was cancelled.
    */
-  synthesizeMouse(target, offsetX, offsetY, event, browser)
-  {
+  synthesizeMouse(target, offsetX, offsetY, event, browser) {
     return new Promise((resolve, reject) => {
       let mm = browser.messageManager;
       mm.addMessageListener("Test:SynthesizeMouseDone", function mouseMsg(message) {
         mm.removeMessageListener("Test:SynthesizeMouseDone", mouseMsg);
         if (message.data.hasOwnProperty("defaultPrevented")) {
           resolve(message.data.defaultPrevented);
         } else {
           reject(new Error(message.data.error));
@@ -1122,17 +1119,17 @@ var BrowserTestUtils = {
         targetFn = target.toString();
         target = null;
       } else if (typeof target != "string" && !Array.isArray(target)) {
         cpowObject = target;
         target = null;
       }
 
       mm.sendAsyncMessage("Test:SynthesizeMouse",
-                          {target, targetFn, x: offsetX, y: offsetY, event: event},
+                          {target, targetFn, x: offsetX, y: offsetY, event},
                           {object: cpowObject});
     });
   },
 
   /**
    * Wait for a message to be fired from a particular message manager
    *
    * @param {nsIMessageManager} messageManager
@@ -1152,30 +1149,28 @@ var BrowserTestUtils = {
       });
     });
   },
 
   /**
    *  Version of synthesizeMouse that uses the center of the target as the mouse
    *  location. Arguments and the return value are the same.
    */
-  synthesizeMouseAtCenter(target, event, browser)
-  {
+  synthesizeMouseAtCenter(target, event, browser) {
     // Use a flag to indicate to center rather than having a separate message.
     event.centered = true;
     return BrowserTestUtils.synthesizeMouse(target, 0, 0, event, browser);
   },
 
   /**
    *  Version of synthesizeMouse that uses a client point within the child
    *  window instead of a target as the offset. Otherwise, the arguments and
    *  return value are the same as synthesizeMouse.
    */
-  synthesizeMouseAtPoint(offsetX, offsetY, event, browser)
-  {
+  synthesizeMouseAtPoint(offsetX, offsetY, event, browser) {
     return BrowserTestUtils.synthesizeMouse(null, offsetX, offsetY, event, browser);
   },
 
   /**
    * Removes the given tab from its parent tabbrowser.
    * This method doesn't SessionStore etc.
    *
    * @param (tab) tab
@@ -1211,35 +1206,35 @@ var BrowserTestUtils = {
    *        tab crash page has loaded.
    * @param (bool) shouldClearMinidumps
    *        True if the minidumps left behind by the crash should be removed.
    *
    * @returns (Promise)
    * @resolves An Object with key-value pairs representing the data from the
    *           crash report's extra file (if applicable).
    */
-  async crashBrowser(browser, shouldShowTabCrashPage=true,
-                     shouldClearMinidumps=true) {
+  async crashBrowser(browser, shouldShowTabCrashPage = true,
+                     shouldClearMinidumps = true) {
     let extra = {};
     let KeyValueParser = {};
     if (AppConstants.MOZ_CRASHREPORTER) {
       ChromeUtils.import("resource://gre/modules/KeyValueParser.jsm", KeyValueParser);
     }
 
     if (!browser.isRemoteBrowser) {
       throw new Error("<xul:browser> needs to be remote in order to crash");
     }
 
     /**
      * Returns the directory where crash dumps are stored.
      *
      * @return nsIFile
      */
     function getMinidumpDirectory() {
-      let dir = Services.dirsvc.get('ProfD', Ci.nsIFile);
+      let dir = Services.dirsvc.get("ProfD", Ci.nsIFile);
       dir.append("minidumps");
       return dir;
     }
 
     /**
      * Removes a file from a directory. This is a no-op if the file does not
      * exist.
      *
@@ -1262,22 +1257,22 @@ var BrowserTestUtils = {
     // frame script.
     let frame_script = () => {
       ChromeUtils.import("resource://gre/modules/ctypes.jsm");
 
       let dies = function() {
         privateNoteIntentionalCrash();
         let zero = new ctypes.intptr_t(8);
         let badptr = ctypes.cast(zero, ctypes.PointerType(ctypes.int32_t));
-        badptr.contents
+        badptr.contents;
       };
 
       dump("\nEt tu, Brute?\n");
       dies();
-    }
+    };
 
     let expectedPromises = [];
 
     let crashCleanupPromise = new Promise((resolve, reject) => {
       let observer = (subject, topic, data) => {
         if (topic != "ipc:content-shutdown") {
           return reject("Received incorrect observer topic: " + topic);
         }
@@ -1288,58 +1283,58 @@ var BrowserTestUtils = {
         // We are only looking for "abnormal" exits...
         if (!subject.hasKey("abnormal")) {
           dump("\nThis is a normal termination and isn't the one we are looking for...\n");
           return;
         }
 
         let dumpID;
         if (AppConstants.MOZ_CRASHREPORTER) {
-          dumpID = subject.getPropertyAsAString('dumpID');
+          dumpID = subject.getPropertyAsAString("dumpID");
           if (!dumpID) {
             return reject("dumpID was not present despite crash reporting " +
                           "being enabled");
           }
         }
 
         let removalPromise = Promise.resolve();
 
         if (dumpID) {
           removalPromise = Services.crashmanager.ensureCrashIsPresent(dumpID)
                                                 .then(() => {
             let minidumpDirectory = getMinidumpDirectory();
             let extrafile = minidumpDirectory.clone();
-            extrafile.append(dumpID + '.extra');
+            extrafile.append(dumpID + ".extra");
             if (extrafile.exists()) {
               dump(`\nNo .extra file for dumpID: ${dumpID}\n`);
               if (AppConstants.MOZ_CRASHREPORTER) {
                 extra = KeyValueParser.parseKeyValuePairsFromFile(extrafile);
               } else {
-                dump('\nCrashReporter not enabled - will not return any extra data\n');
+                dump("\nCrashReporter not enabled - will not return any extra data\n");
               }
             }
 
             if (shouldClearMinidumps) {
-              removeFile(minidumpDirectory, dumpID + '.dmp');
-              removeFile(minidumpDirectory, dumpID + '.extra');
+              removeFile(minidumpDirectory, dumpID + ".dmp");
+              removeFile(minidumpDirectory, dumpID + ".extra");
             }
           });
         }
 
         removalPromise.then(() => {
-          Services.obs.removeObserver(observer, 'ipc:content-shutdown');
+          Services.obs.removeObserver(observer, "ipc:content-shutdown");
           dump("\nCrash cleaned up\n");
           // There might be other ipc:content-shutdown handlers that need to
           // run before we want to continue, so we'll resolve on the next tick
           // of the event loop.
           TestUtils.executeSoon(() => resolve());
         });
       };
 
-      Services.obs.addObserver(observer, 'ipc:content-shutdown');
+      Services.obs.addObserver(observer, "ipc:content-shutdown");
     });
 
     expectedPromises.push(crashCleanupPromise);
 
     if (shouldShowTabCrashPage) {
       expectedPromises.push(new Promise((resolve, reject) => {
         browser.addEventListener("AboutTabCrashedReady", function onCrash() {
           browser.removeEventListener("AboutTabCrashedReady", onCrash);
@@ -1382,17 +1377,17 @@ var BrowserTestUtils = {
   waitForAttribute(attr, element, value) {
     let MutationObserver = element.ownerGlobal.MutationObserver;
     return new Promise(resolve => {
       let mut = new MutationObserver(mutations => {
         if ((!value && element.getAttribute(attr)) ||
             (value && element.getAttribute(attr) === value)) {
           resolve();
           mut.disconnect();
-          return;
+
         }
       });
 
       mut.observe(element, {attributeFilter: [attr]});
     });
   },
 
   /**
@@ -1418,18 +1413,18 @@ var BrowserTestUtils = {
         if (message.data.seq != seq)
           return;
 
         mm.removeMessageListener("Test:SendCharDone", charMsg);
         resolve(message.data.result);
       });
 
       mm.sendAsyncMessage("Test:SendChar", {
-        char: char,
-        seq: seq
+        char,
+        seq
       });
     });
   },
 
   /**
    * Version of EventUtils' `synthesizeKey` function; it will synthesize a key
    * event in a child process and returns a Promise that will resolve when the
    * event was fired. Instead of a Window, a Browser object is required to be
@@ -1592,17 +1587,17 @@ var BrowserTestUtils = {
    * @returns Promise
    */
   contentPainted(browser) {
     return ContentTask.spawn(browser, null, async function() {
       return new Promise((resolve) => {
         addEventListener("MozAfterPaint", function onPaint() {
           removeEventListener("MozAfterPaint", onPaint);
           resolve();
-        })
+        });
       });
     });
   },
 
   _knownAboutPages: new Set(),
   _loadedAboutContentScript: false,
   /**
    * Registers an about: page with particular flags in both the parent
@@ -1668,17 +1663,17 @@ var BrowserTestUtils = {
    * @param {string} uri
    *        The URI of the dialog to wait for.  Defaults to the common dialog.
    * @return {Promise}
    *         A Promise which resolves when a "domwindowopened" notification
    *         for a dialog has been fired by the window watcher and the
    *         specified button is clicked.
    */
   async promiseAlertDialogOpen(buttonAction,
-                               uri="chrome://global/content/commonDialog.xul",
+                               uri = "chrome://global/content/commonDialog.xul",
                                func) {
     let win = await this.domWindowOpened(null, async win => {
       // The test listens for the "load" event which guarantees that the alert
       // class has already been added (it is added when "DOMContentLoaded" is
       // fired).
       await this.waitForEvent(win, "load");
 
       return win.document.documentURI === uri;
@@ -1704,17 +1699,17 @@ var BrowserTestUtils = {
    * @param {string} uri
    *        The URI of the dialog to wait for.  Defaults to the common dialog.
    * @return {Promise}
    *         A Promise which resolves when a "domwindowopened" notification
    *         for a dialog has been fired by the window watcher and the
    *         specified button is clicked, and the dialog has been fully closed.
    */
   async promiseAlertDialog(buttonAction,
-                           uri="chrome://global/content/commonDialog.xul",
+                           uri = "chrome://global/content/commonDialog.xul",
                            func) {
     let win = await this.promiseAlertDialogOpen(buttonAction, uri, func);
     return this.windowClosed(win);
   },
 
   /**
    * Opens a tab with a given uri and params object. If the params object is not set
    * or the params parameter does not include a triggeringPricnipal then this function
--- a/testing/mochitest/BrowserTestUtils/ContentTask.jsm
+++ b/testing/mochitest/BrowserTestUtils/ContentTask.jsm
@@ -75,19 +75,19 @@ var ContentTask = {
     });
 
     let id = gMessageID++;
     gPromises.set(id, deferred);
 
     browser.messageManager.sendAsyncMessage(
       "content-task:spawn",
       {
-        id: id,
+        id,
         runnable: task.toString(),
-        arg: arg,
+        arg,
       });
 
     return deferred.promise;
   },
 
   setTestScope(scope) {
     this._testScope = scope;
     this._scopeValidId = gMessageID;
--- a/testing/mochitest/BrowserTestUtils/ContentTaskUtils.jsm
+++ b/testing/mochitest/BrowserTestUtils/ContentTaskUtils.jsm
@@ -31,31 +31,31 @@ var ContentTaskUtils = {
    * @param attempts
    *        The number of times to poll before giving up and rejecting
    *        if the condition has not yet returned true. Defaults to 50
    *        (~5 seconds for 100ms intervals)
    * @return Promise
    *        Resolves when condition is true.
    *        Rejects if timeout is exceeded or condition ever throws.
    */
-  waitForCondition(condition, msg, interval=100, maxTries=50) {
+  waitForCondition(condition, msg, interval = 100, maxTries = 50) {
     return new Promise((resolve, reject) => {
       let tries = 0;
       let intervalID = setInterval(() => {
         if (tries >= maxTries) {
           clearInterval(intervalID);
           msg += ` - timed out after ${maxTries} tries.`;
           reject(msg);
           return;
         }
 
         let conditionPassed = false;
         try {
           conditionPassed = condition();
-        } catch(e) {
+        } catch (e) {
           msg += ` - threw exception: ${e}`;
           clearInterval(intervalID);
           reject(msg);
           return;
         }
 
         if (conditionPassed) {
           clearInterval(intervalID);
--- a/testing/mochitest/BrowserTestUtils/content/content-task.js
+++ b/testing/mochitest/BrowserTestUtils/content/content-task.js
@@ -3,31 +3,31 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 ChromeUtils.import("resource://gre/modules/Task.jsm", this);
 ChromeUtils.import("resource://testing-common/ContentTaskUtils.jsm", this);
 const AssertCls = ChromeUtils.import("resource://testing-common/Assert.jsm", null).Assert;
 
-addMessageListener("content-task:spawn", function (msg) {
+addMessageListener("content-task:spawn", function(msg) {
   let id = msg.data.id;
   let source = msg.data.runnable || "()=>{}";
 
   function getStack(aStack) {
     let frames = [];
     for (let frame = aStack; frame; frame = frame.caller) {
       frames.push(frame.filename + ":" + frame.name + ":" + frame.lineNumber);
     }
     return frames.join("\n");
   }
 
   var Assert = new AssertCls((err, message, stack) => {
     sendAsyncMessage("content-task:test-result", {
-      id: id,
+      id,
       condition: !err,
       name: err ? err.message : message,
       stack: getStack(err ? err.stack : stack)
     });
   });
 
   var ok = Assert.ok.bind(Assert);
   var is = Assert.equal.bind(Assert);
@@ -40,30 +40,30 @@ addMessageListener("content-task:spawn",
   function info(name) {
     sendAsyncMessage("content-task:test-info", {id, name});
   }
 
   try {
     let runnablestr = `
       (() => {
         return (${source});
-      })();`
+      })();`;
 
     let runnable = eval(runnablestr);
     let iterator = runnable.call(this, msg.data.arg);
     Task.spawn(iterator).then((val) => {
       sendAsyncMessage("content-task:complete", {
-        id: id,
+        id,
         result: val,
       });
     }, (e) => {
       sendAsyncMessage("content-task:complete", {
-        id: id,
+        id,
         error: e.toString(),
       });
     });
   } catch (e) {
     sendAsyncMessage("content-task:complete", {
-      id: id,
+      id,
       error: e.toString(),
     });
   }
 });
--- a/testing/mochitest/BrowserTestUtils/content/content-utils.js
+++ b/testing/mochitest/BrowserTestUtils/content/content-utils.js
@@ -6,19 +6,19 @@
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 addEventListener("DOMContentLoaded", function(event) {
   let subframe = event.target != content.document;
   // For error page, internalURL is 'about:neterror?...', and visibleURL
   // is the original URL.
   sendAsyncMessage("browser-test-utils:DOMContentLoadedEvent",
-    {subframe: subframe, internalURL: event.target.documentURI,
+    {subframe, internalURL: event.target.documentURI,
      visibleURL: content.document.location.href});
 }, true);
 
 addEventListener("load", function(event) {
   let subframe = event.target != content.document;
   sendAsyncMessage("browser-test-utils:loadEvent",
-    {subframe: subframe, internalURL: event.target.documentURI,
+    {subframe, internalURL: event.target.documentURI,
      visibleURL: content.document.location.href});
 }, true);
 
--- a/testing/mochitest/ShutdownLeaksCollector.jsm
+++ b/testing/mochitest/ShutdownLeaksCollector.jsm
@@ -8,27 +8,27 @@ ChromeUtils.import("resource://gre/modul
 var EXPORTED_SYMBOLS = ["ContentCollector"];
 
 // This listens for the message "browser-test:collect-request". When it gets it,
 // it runs some GCs and CCs, then prints out a message indicating the collections
 // are complete. Mochitest uses this information to determine when windows and
 // docshells should be destroyed.
 
 var ContentCollector = {
-  init: function() {
+  init() {
       let processType = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).processType;
       if (processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
         // In the main process, we handle triggering collections in browser-test.js
         return;
       }
 
     Services.cpmm.addMessageListener("browser-test:collect-request", this);
   },
 
-  receiveMessage: function(aMessage) {
+  receiveMessage(aMessage) {
     switch (aMessage.name) {
       case "browser-test:collect-request":
         Services.obs.notifyObservers(null, "memory-pressure", "heap-minimize");
 
         Cu.forceGC();
         Cu.forceCC();
 
         let shutdownCleanup = aCallback => {
@@ -40,17 +40,17 @@ var ContentCollector = {
             aCallback();
           });
         };
 
         shutdownCleanup(() => {
           setTimeout(() => {
             shutdownCleanup(() => {
               this.finish();
-            })
+            });
           }, 1000);
         });
 
         break;
     }
   },
 
   finish() {
--- a/testing/mochitest/bootstrap.js
+++ b/testing/mochitest/bootstrap.js
@@ -8,17 +8,17 @@ ChromeUtils.import("resource://gre/modul
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 function loadChromeScripts(win) {
   Services.scriptloader.loadSubScript("chrome://mochikit/content/chrome-harness.js", win);
   Services.scriptloader.loadSubScript("chrome://mochikit/content/mochitest-e10s-utils.js", win);
   Services.scriptloader.loadSubScript("chrome://mochikit/content/browser-test.js", win);
 }
 
-/////// Android ///////
+// ///// Android ///////
 
 Cu.importGlobalProperties(["TextDecoder"]);
 
 const windowTracker = {
   init() {
     Services.obs.addObserver(this, "chrome-document-global-created");
   },
 
@@ -41,51 +41,51 @@ const windowTracker = {
 function androidStartup(data, reason) {
   // Only browser chrome tests need help starting.
   let testRoot = Services.prefs.getStringPref("mochitest.testRoot", "");
   if (testRoot.endsWith("/chrome")) {
     windowTracker.init();
   }
 }
 
-/////// Desktop ///////
+// ///// Desktop ///////
 
 var WindowListener = {
   // browser-test.js is only loaded into the first window. Setup that
   // needs to happen in all navigator:browser windows should go here.
-  setupWindow: function(win) {
+  setupWindow(win) {
     win.nativeConsole = win.console;
     ChromeUtils.defineModuleGetter(win, "console",
       "resource://gre/modules/Console.jsm");
   },
 
-  tearDownWindow: function(win) {
+  tearDownWindow(win) {
     if (win.nativeConsole) {
       win.console = win.nativeConsole;
       win.nativeConsole = undefined;
     }
   },
 
-  onOpenWindow: function (win) {
+  onOpenWindow(win) {
     win = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
 
     win.addEventListener("load", function() {
       if (win.document.documentElement.getAttribute("windowtype") == "navigator:browser") {
         WindowListener.setupWindow(win);
       }
     }, {once: true});
   }
-}
+};
 
 function loadMochitest(e) {
   let flavor = e.detail[0];
   let url = e.detail[1];
 
   let win = Services.wm.getMostRecentWindow("navigator:browser");
-  win.removeEventListener('mochitest-load', loadMochitest);
+  win.removeEventListener("mochitest-load", loadMochitest);
 
   // for mochitest-plain, navigating to the url is all we need
   win.loadURI(url);
   if (flavor == "mochitest") {
     return;
   }
 
   WindowListener.setupWindow(win);
@@ -96,17 +96,17 @@ function loadMochitest(e) {
 
 function startup(data, reason) {
   if (AppConstants.platform == "android") {
     androidStartup(data, reason);
   } else {
     let win = Services.wm.getMostRecentWindow("navigator:browser");
     // wait for event fired from start_desktop.js containing the
     // suite and url to load
-    win.addEventListener('mochitest-load', loadMochitest);
+    win.addEventListener("mochitest-load", loadMochitest);
   }
 }
 
 function shutdown(data, reason) {
   if (AppConstants.platform != "android") {
     let windows = Services.wm.getEnumerator("navigator:browser");
     while (windows.hasMoreElements()) {
       let win = windows.getNext().QueryInterface(Ci.nsIDOMWindow);
--- a/testing/mochitest/browser-test.js
+++ b/testing/mochitest/browser-test.js
@@ -10,52 +10,52 @@ ChromeUtils.import("resource://gre/modul
 
 ChromeUtils.defineModuleGetter(this, "ContentSearch",
   "resource:///modules/ContentSearch.jsm");
 
 const SIMPLETEST_OVERRIDES =
   ["ok", "is", "isnot", "todo", "todo_is", "todo_isnot", "info", "expectAssertions", "requestCompleteLog"];
 
 // non-android is bootstrapped by marionette
-if (Services.appinfo.OS == 'Android') {
+if (Services.appinfo.OS == "Android") {
   window.addEventListener("load", function() {
     window.addEventListener("MozAfterPaint", function() {
       setTimeout(testInit, 0);
     }, {once: true});
   }, {once: true});
 } else {
   setTimeout(testInit, 0);
 }
 
 var TabDestroyObserver = {
   outstanding: new Set(),
   promiseResolver: null,
 
-  init: function() {
+  init() {
     Services.obs.addObserver(this, "message-manager-close");
     Services.obs.addObserver(this, "message-manager-disconnect");
   },
 
-  destroy: function() {
+  destroy() {
     Services.obs.removeObserver(this, "message-manager-close");
     Services.obs.removeObserver(this, "message-manager-disconnect");
   },
 
-  observe: function(subject, topic, data) {
+  observe(subject, topic, data) {
     if (topic == "message-manager-close") {
       this.outstanding.add(subject);
     } else if (topic == "message-manager-disconnect") {
       this.outstanding.delete(subject);
       if (!this.outstanding.size && this.promiseResolver) {
         this.promiseResolver();
       }
     }
   },
 
-  wait: function() {
+  wait() {
     if (!this.outstanding.size) {
       return Promise.resolve();
     }
 
     return new Promise((resolve) => {
       this.promiseResolver = resolve;
     });
   },
@@ -225,17 +225,17 @@ function takeInstrumentation() {
   function getElementInfo(element) {
     let style = element.ownerGlobal.getComputedStyle(element);
     let binding = style && style.getPropertyValue("-moz-binding");
 
     return {
       namespaceURI: element.namespaceURI,
       localName: element.localName,
       binding: (binding && binding != "none") ? binding : null,
-    }
+    };
   }
 
   // The selector for just this element
   function immediateSelector(element) {
     if (element.localName == "notificationbox" && element.parentNode &&
         element.parentNode.classList.contains("tabbrowser-tabpanels")) {
       // Don't do a full selector for a tabpanel's notificationbox
       return element.localName;
@@ -470,17 +470,17 @@ Tester.prototype = {
   },
   get done() {
     return (this.currentTestIndex == this.tests.length - 1) && (this.repeat <= 0);
   },
 
   start: function Tester_start() {
     TabDestroyObserver.init();
 
-    //if testOnLoad was not called, then gConfig is not defined
+    // if testOnLoad was not called, then gConfig is not defined
     if (!gConfig)
       gConfig = readConfig();
 
     if (gConfig.runUntilFailure)
       this.runUntilFailure = true;
 
     if (gConfig.repeat)
       this.repeat = gConfig.repeat;
@@ -671,18 +671,17 @@ Tester.prototype = {
       let testScope = this.currentTest.scope;
       while (testScope.__cleanupFunctions.length > 0) {
         let func = testScope.__cleanupFunctions.shift();
         try {
           let result = await func.apply(testScope);
           if (isGenerator(result)) {
             this.SimpleTest.ok(false, "Cleanup function returned a generator");
           }
-        }
-        catch (ex) {
+        } catch (ex) {
           this.currentTest.addResult(new testResult({
             name: "Cleanup function threw an exception",
             ex,
             allowFailure: this.currentTest.allowFailure,
           }));
         }
       }
 
@@ -712,17 +711,17 @@ Tester.prototype = {
           allowFailure: this.currentTest.allowFailure,
         }));
       }
 
       this.PromiseTestUtils.ensureDOMPromiseRejectionsProcessed();
       this.PromiseTestUtils.assertNoUncaughtRejections();
       this.PromiseTestUtils.assertNoMoreExpectedRejections();
 
-      Object.keys(window).forEach(function (prop) {
+      Object.keys(window).forEach(function(prop) {
         if (parseInt(prop) == prop) {
           // This is a string which when parsed as an integer and then
           // stringified gives the original string.  As in, this is in fact a
           // string representation of an integer, so an index into
           // window.frames.  Skip those.
           return;
         }
         if (!this._globalProperties.includes(prop)) {
@@ -834,18 +833,17 @@ Tester.prototype = {
             todo: true,
           }));
         }
       }
 
       // Dump memory stats for main thread.
       if (Cc["@mozilla.org/xre/runtime;1"]
           .getService(Ci.nsIXULRuntime)
-          .processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT)
-      {
+          .processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
         this.MemoryStats.dump(this.currentTestIndex,
                               this.currentTest.path,
                               gConfig.dumpOutputDirectory,
                               gConfig.dumpAboutMemoryAfterTest,
                               gConfig.dumpDMDAfterTest);
       }
 
       // Note the test run time
@@ -878,17 +876,17 @@ Tester.prototype = {
         if (this._coverageCollector) {
           this._coverageCollector.finalize();
         }
 
         // Uninitialize a few things explicitly so that they can clean up
         // frames and browser intentionally kept alive until shutdown to
         // eliminate false positives.
         if (gConfig.testRoot == "browser") {
-          //Skip if SeaMonkey
+          // Skip if SeaMonkey
           if (AppConstants.MOZ_APP_NAME != "seamonkey") {
             // Replace the document currently loaded in the browser's sidebar.
             // This will prevent false positives for tests that were the last
             // to touch the sidebar. They will thus not be blamed for leaking
             // a document.
             let sidebar = document.getElementById("sidebar");
             sidebar.setAttribute("src", "data:text/html;charset=utf-8,");
             sidebar.docShell.createAboutBlankContentViewer(null);
@@ -1014,17 +1012,17 @@ Tester.prototype = {
       }
     };
 
     // Override SimpleTest methods with ours.
     SIMPLETEST_OVERRIDES.forEach(function(m) {
       this.SimpleTest[m] = this[m];
     }, scope);
 
-    //load the tools to work with chrome .jar and remote
+    // load the tools to work with chrome .jar and remote
     try {
       this._scriptLoader.loadSubScript("chrome://mochikit/content/chrome-harness.js", scope);
     } catch (ex) { /* no chrome-harness tools */ }
 
     // Import head.js script if it exists.
     var currentTestDirPath =
       this.currentTest.path.substr(0, this.currentTest.path.lastIndexOf("/"));
     var headPath = currentTestDirPath + "/head.js";
@@ -1085,25 +1083,25 @@ Tester.prototype = {
                   name: "Uncaught exception received from previously timed out test",
                   pass: false,
                   ex,
                   stack: (typeof ex == "object" && "stack" in ex) ? ex.stack : null,
                   allowFailure: currentTest.allowFailure,
                 }));
                 // We timed out, so we've already cleaned up for this test, just get outta here.
                 return;
-              } else {
+              }
                 currentTest.addResult(new testResult({
                   name: "Uncaught exception",
                   pass: this.SimpleTest.isExpectingUncaughtException(),
                   ex,
                   stack: (typeof ex == "object" && "stack" in ex) ? ex.stack : null,
                   allowFailure: currentTest.allowFailure,
                 }));
-              }
+
             }
             PromiseTestUtils.assertNoUncaughtRejections();
             this.SimpleTest.info("Leaving test " + task.name);
           }
           this.finish();
         }).call(currentScope);
       } else if (typeof scope.test == "function") {
         scope.test();
@@ -1124,18 +1122,17 @@ Tester.prototype = {
       }
       this.currentTest.scope.finish();
     }
 
     // If the test ran synchronously, move to the next test, otherwise the test
     // will trigger the next test when it is done.
     if (this.currentTest.scope.__done) {
       this.nextTest();
-    }
-    else {
+    } else {
       var self = this;
       var timeoutExpires = Date.now() + gTimeoutSeconds * 1000;
       var waitUntilAtLeast = timeoutExpires - 1000;
       this.currentTest.scope.__waitTimer =
         this.SimpleTest._originalSetTimeout.apply(window, [function timeoutFn() {
         // We sometimes get woken up long before the gTimeoutSeconds
         // have elapsed (when running in chaos mode for example). This
         // code ensures that we don't wrongly time out in that case.
@@ -1173,17 +1170,17 @@ Tester.prototype = {
         self.currentTest.addResult(new testResult({ name: "Test timed out" }));
         self.currentTest.timedOut = true;
         self.currentTest.scope.__waitTimer = null;
         self.nextTest();
       }, gTimeoutSeconds * 1000]);
     }
   },
 
-  QueryInterface: function(aIID) {
+  QueryInterface(aIID) {
     if (aIID.equals(Ci.nsIConsoleListener) ||
         aIID.equals(Ci.nsISupports))
       return this;
 
     throw Cr.NS_ERROR_NO_INTERFACE;
   }
 };
 
@@ -1252,16 +1249,17 @@ function testResult({ name, pass, todo, 
       normalized = "" + stack;
     }
     this.msg += normalized;
   }
 
   if (gConfig.debugOnFailure) {
     // You've hit this line because you requested to break into the
     // debugger upon a testcase failure on your test run.
+    // eslint-disable-next-line no-debugger
     debugger;
   }
 }
 
 function testMessage(msg) {
   this.msg = msg || "";
   this.info = true;
 }
@@ -1305,17 +1303,17 @@ function testScope(aTester, aTest, expec
               Components.stack.caller);
   };
   this.info = function test_info(name) {
     aTest.addResult(new testMessage(name));
   };
 
   this.executeSoon = function test_executeSoon(func) {
     Services.tm.dispatchToMainThread({
-      run: function() {
+      run() {
         func();
       }
     });
   };
 
   this.waitForExplicitFinish = function test_waitForExplicitFinish() {
     self.__done = false;
   };
@@ -1379,17 +1377,17 @@ function testScope(aTester, aTest, expec
       });
     }
   };
 
   this.requestCompleteLog = function test_requestCompleteLog() {
     self.__tester.structuredLogger.deactivateBuffering();
     self.registerCleanupFunction(function() {
       self.__tester.structuredLogger.activateBuffering();
-    })
+    });
   };
 
   // If we're running a test that requires unsafe CPOWs, create a
   // separate sandbox scope, with CPOWS whitelisted, for that test, and
   // mirror all of our properties onto it. Test files will be loaded
   // into this sandbox.
   //
   // Otherwise, load test files directly into the testScope instance.
@@ -1474,17 +1472,17 @@ testScope.prototype = {
    *   if (!result) {
    *     // Test is ended immediately, with success.
    *     return;
    *   }
    *
    *   is(result, "foo");
    * });
    */
-  add_task: function(aFunction) {
+  add_task(aFunction) {
     if (!this.__tasks) {
       this.waitForExplicitFinish();
       this.__tasks = [];
     }
     let bound = decorateTaskFn.call(this, aFunction);
     this.__tasks.push(bound);
     return bound;
   },
--- a/testing/mochitest/chrome-harness.js
+++ b/testing/mochitest/chrome-harness.js
@@ -30,17 +30,17 @@ function getChromeURI(url) {
 function getResolvedURI(url) {
   var chromeURI = getChromeURI(url);
   var resolvedURI = Cc["@mozilla.org/chrome/chrome-registry;1"].
                     getService(Ci.nsIChromeRegistry).
                     convertChromeURL(chromeURI);
 
   try {
     resolvedURI = resolvedURI.QueryInterface(Ci.nsIJARURI);
-  } catch (ex) {} //not a jar file
+  } catch (ex) {} // not a jar file
 
   return resolvedURI;
 }
 
 /**
  *  getChromeDir is intended to be called after getResolvedURI and convert
  *  the input URI into a nsIFile (actually the directory containing the
  *  file).  This can be used for copying or referencing the file or extra files
@@ -52,34 +52,32 @@ function getResolvedURI(url) {
 function getChromeDir(resolvedURI) {
 
   var fileHandler = Cc["@mozilla.org/network/protocol;1?name=file"].
                     getService(Ci.nsIFileProtocolHandler);
   var chromeDir = fileHandler.getFileFromURLSpec(resolvedURI.spec);
   return chromeDir.parent.QueryInterface(Ci.nsIFile);
 }
 
-//used by tests to determine their directory based off window.location.path
+// used by tests to determine their directory based off window.location.path
 function getRootDirectory(path, chromeURI) {
-  if (chromeURI === undefined)
-  {
+  if (chromeURI === undefined) {
     chromeURI = getChromeURI(path);
   }
   var myURL = chromeURI.QueryInterface(Ci.nsIURL);
   var mydir = myURL.directory;
 
-  if (mydir.match('/$') != '/')
-  {
-    mydir += '/';
+  if (mydir.match("/$") != "/") {
+    mydir += "/";
   }
 
   return chromeURI.prePath + mydir;
 }
 
-//used by tests to determine their directory based off window.location.path
+// used by tests to determine their directory based off window.location.path
 function getChromePrePath(path, chromeURI) {
 
   if (chromeURI === undefined) {
     chromeURI = getChromeURI(path);
   }
 
   return chromeURI.prePath;
 }
@@ -119,43 +117,43 @@ function extractJarToTmp(jar) {
                   createInstance(Ci.nsIZipReader);
 
   var fileHandler = Cc["@mozilla.org/network/protocol;1?name=file"].
                     getService(Ci.nsIFileProtocolHandler);
 
   var fileName = fileHandler.getFileFromURLSpec(jar.JARFile.spec);
   zReader.open(fileName);
 
-  //filepath represents the path in the jar file without the filename
+  // filepath represents the path in the jar file without the filename
   var filepath = "";
-  var parts = jar.JAREntry.split('/');
-  for (var i =0; i < parts.length - 1; i++) {
-    if (parts[i] != '') {
-      filepath += parts[i] + '/';
+  var parts = jar.JAREntry.split("/");
+  for (var i = 0; i < parts.length - 1; i++) {
+    if (parts[i] != "") {
+      filepath += parts[i] + "/";
     }
   }
 
   /* Create dir structure first, no guarantee about ordering of directories and
    * files returned from findEntries.
    */
-  var dirs = zReader.findEntries(filepath + '*/');
+  var dirs = zReader.findEntries(filepath + "*/");
   while (dirs.hasMore()) {
     var targetDir = buildRelativePath(dirs.getNext(), tmpdir, filepath);
     // parseInt is used because octal escape sequences cause deprecation warnings
     // in strict mode (which is turned on in debug builds)
     if (!targetDir.exists()) {
       targetDir.create(Ci.nsIFile.DIRECTORY_TYPE, parseInt("0777", 8));
     }
   }
 
-  //now do the files
+  // now do the files
   var files = zReader.findEntries(filepath + "*");
   while (files.hasMore()) {
     var fname = files.getNext();
-    if (fname.substr(-1) != '/') {
+    if (fname.substr(-1) != "/") {
       var targetFile = buildRelativePath(fname, tmpdir, filepath);
       zReader.extract(fname, targetFile);
     }
   }
   return tmpdir;
 }
 
 /*
@@ -178,38 +176,37 @@ function getTestFilePath(path) {
   } else {
     // Otherwise, we can directly cast it to a file URI
     var fileHandler = Cc["@mozilla.org/network/protocol;1?name=file"].
                       getService(Ci.nsIFileProtocolHandler);
     file = fileHandler.getFileFromURLSpec(parentURI.spec);
   }
   // Then walk by the given relative path
   path.split("/")
-      .forEach(function (p) {
+      .forEach(function(p) {
         if (p == "..") {
           file = file.parent;
         } else if (p != ".") {
           file.append(p);
         }
       });
   return file.path;
 }
 
 /*
  * Simple utility function to take the directory structure in jarentryname and
  * translate that to a path of a nsIFile.
  */
-function buildRelativePath(jarentryname, destdir, basepath)
-{
-  var baseParts = basepath.split('/');
-  if (baseParts[baseParts.length-1] == '') {
+function buildRelativePath(jarentryname, destdir, basepath) {
+  var baseParts = basepath.split("/");
+  if (baseParts[baseParts.length - 1] == "") {
     baseParts.pop();
   }
 
-  var parts = jarentryname.split('/');
+  var parts = jarentryname.split("/");
 
   var targetFile = Cc["@mozilla.org/file/local;1"]
                    .createInstance(Ci.nsIFile);
   targetFile.initWithFile(destdir);
 
   for (var i = baseParts.length; i < parts.length; i++) {
     targetFile.append(parts[i]);
   }
@@ -233,17 +230,17 @@ function readConfig(filename) {
   fileInStream.init(configFile, -1, 0, 0);
 
   var str = NetUtil.readInputStreamToString(fileInStream, fileInStream.available());
   fileInStream.close();
   return JSON.parse(str);
 }
 
 function getTestList(params, callback) {
-  var baseurl = 'chrome://mochitests/content';
+  var baseurl = "chrome://mochitests/content";
   if (window.parseQueryString) {
     params = parseQueryString(location.search.substring(1), true);
   }
   if (!params.baseurl) {
     params.baseurl = baseurl;
   }
 
   var config = readConfig();
@@ -253,10 +250,10 @@ function getTestList(params, callback) {
     } else if (params[p] == 0) {
       config[p] = false;
     } else {
       config[p] = params[p];
     }
   }
   params = config;
   getTestManifest("http://mochi.test:8888/" + params.manifestFile, params, callback);
-  return;
+
 }
--- a/testing/mochitest/chrome/test_sanityPluginUtils.html
+++ b/testing/mochitest/chrome/test_sanityPluginUtils.html
@@ -14,25 +14,25 @@
 <body onload="starttest()">
 <!-- load the test plugin defined at $(DIST)/bin/plugins/Test.plugin/ -->
 <embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
 <script class="testbody" type="text/javascript">
 info("\nProfile::PluginUtilsLoadTime: " + (loadTime - start) + "\n");
 function starttest() {
   SimpleTest.waitForExplicitFinish();
   var startTime = new Date();
-  //increase the runtime of the test so it is detectible, otherwise we get 0-1ms
+  // increase the runtime of the test so it is detectible, otherwise we get 0-1ms
   runtimes = 100;
   function runTest(plugin) {
     is(plugin.version, "1.0.0.0", "Make sure version is correct");
     is(plugin.name, "Test Plug-in");
-  };
+  }
   while (runtimes > 0) {
     ok(PluginUtils.withTestPlugin(runTest), "Test plugin should be found");
     --runtimes;
   }
   var endTime = new Date();
-  info("\nProfile::PluginUtilsRunTime: " + (endTime-startTime) + "\n");
+  info("\nProfile::PluginUtilsRunTime: " + (endTime - startTime) + "\n");
   SimpleTest.finish();
-};
+}
 </script>
 </body>
 </html>
--- a/testing/mochitest/chunkifyTests.js
+++ b/testing/mochitest/chunkifyTests.js
@@ -1,20 +1,20 @@
 /* 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/. */
 
 function skipTests(tests, startTestPattern, endTestPattern) {
   var startIndex = 0, endIndex = tests.length - 1;
   for (var i = 0; i < tests.length; ++i) {
     var test_path;
-    if ((tests[i] instanceof Object) && ('test' in tests[i])) {
-      test_path = tests[i]['test']['url'];
-    } else if ((tests[i] instanceof Object) && ('url' in tests[i])) {
-      test_path = tests[i]['url'];
+    if ((tests[i] instanceof Object) && ("test" in tests[i])) {
+      test_path = tests[i].test.url;
+    } else if ((tests[i] instanceof Object) && ("url" in tests[i])) {
+      test_path = tests[i].url;
     } else {
       test_path = tests[i];
     }
     if (startTestPattern && test_path.endsWith(startTestPattern)) {
       startIndex = i;
     }
 
     if (endTestPattern && test_path.endsWith(endTestPattern)) {
--- a/testing/mochitest/manifestLibrary.js
+++ b/testing/mochitest/manifestLibrary.js
@@ -9,32 +9,32 @@ function parseTestManifest(testManifest,
   var paths = [];
 
   // Support --test-manifest format for mobile
   if ("runtests" in testManifest || "excludetests" in testManifest) {
     callback(testManifest);
     return;
   }
 
-  // For mochitest-chrome and mochitest-browser-chrome harnesses, we 
+  // For mochitest-chrome and mochitest-browser-chrome harnesses, we
   // define tests as links[testname] = true.
   // For mochitest-plain, we define lists as an array of testnames.
-  for (var obj of testManifest['tests']) {
-    var path = obj['path'];
+  for (var obj of testManifest.tests) {
+    var path = obj.path;
     // Note that obj.disabled may be "". We still want to skip in that case.
     if ("disabled" in obj) {
       dump("TEST-SKIPPED | " + path + " | " + obj.disabled + "\n");
       continue;
     }
-    if (params.testRoot != 'tests' && params.testRoot !== undefined) {
-      name = params.baseurl + '/' + params.testRoot + '/' + path;
-      links[name] = {'test': {'url': name, 'expected': obj['expected'], 'uses-unsafe-cpows': obj['uses-unsafe-cpows']}};
+    if (params.testRoot != "tests" && params.testRoot !== undefined) {
+      name = params.baseurl + "/" + params.testRoot + "/" + path;
+      links[name] = {"test": {"url": name, "expected": obj.expected, "uses-unsafe-cpows": obj["uses-unsafe-cpows"]}};
     } else {
       name = params.testPrefix + path;
-      paths.push({'test': {'url': name, 'expected': obj['expected'], 'uses-unsafe-cpows': obj['uses-unsafe-cpows']}});
+      paths.push({"test": {"url": name, "expected": obj.expected, "uses-unsafe-cpows": obj["uses-unsafe-cpows"]}});
     }
   }
   if (paths.length > 0) {
     callback(paths);
   } else {
     callback(links);
   }
 }
@@ -51,17 +51,17 @@ function getTestManifest(url, params, ca
           dump("TEST-UNEXPECTED-FAIL: manifestLibrary.js | error parsing " + url + " (" + e + ")\n");
           throw e;
         }
       } else {
         dump("TEST-UNEXPECTED-FAIL: manifestLibrary.js | error loading " + url + " (HTTP " + req.status + ")\n");
         callback({});
       }
     }
-  }
+  };
   req.send();
 }
 
 // Test Filtering Code
 // TODO Only used by ipc tests, remove once those are implemented sanely
 
 /*
  Open the file referenced by runOnly|exclude and use that to compare against
@@ -79,45 +79,45 @@ function filterTests(filter, testList, r
   var removedTests = [];
   var runtests = {};
   var excludetests = {};
 
   if (filter == null) {
     return testList;
   }
 
-  if ('runtests' in filter) {
+  if ("runtests" in filter) {
     runtests = filter.runtests;
   }
-  if ('excludetests' in filter) {
+  if ("excludetests" in filter) {
     excludetests = filter.excludetests;
   }
-  if (!('runtests' in filter) && !('excludetests' in filter)) {
-    if (runOnly == 'true') {
+  if (!("runtests" in filter) && !("excludetests" in filter)) {
+    if (runOnly == "true") {
       runtests = filter;
     } else {
       excludetests = filter;
     }
   }
 
   var testRoot = config.testRoot || "tests";
   // Start with testList, and put everything that's in 'runtests' in
   // filteredTests.
   if (Object.keys(runtests).length) {
     for (var i = 0; i < testList.length; i++) {
-      if ((testList[i] instanceof Object) && ('test' in testList[i])) {
-        var testpath = testList[i]['test']['url'];
+      if ((testList[i] instanceof Object) && ("test" in testList[i])) {
+        var testpath = testList[i].test.url;
       } else {
         var testpath = testList[i];
       }
-      var tmppath = testpath.replace(/^\//, '');
+      var tmppath = testpath.replace(/^\//, "");
       for (var f in runtests) {
         // Remove leading /tests/ if exists
-        file = f.replace(/^\//, '')
-        file = file.replace(/^tests\//, '')
+        file = f.replace(/^\//, "");
+        file = file.replace(/^tests\//, "");
 
         // Match directory or filename, testList has <testroot>/<path>
         if (tmppath.match(testRoot + "/" + file) != null) {
           filteredTests.push(testpath);
           break;
         }
       }
     }
@@ -129,26 +129,26 @@ function filterTests(filter, testList, r
   // excludedtests.
   if (!Object.keys(excludetests).length) {
     return filteredTests;
   }
 
   var refilteredTests = [];
   for (var i = 0; i < filteredTests.length; i++) {
     var found = false;
-    if ((filteredTests[i] instanceof Object) && ('test' in filteredTests[i])) {
-      var testpath = filteredTests[i]['test']['url'];
+    if ((filteredTests[i] instanceof Object) && ("test" in filteredTests[i])) {
+      var testpath = filteredTests[i].test.url;
     } else {
       var testpath = filteredTests[i];
     }
-    var tmppath = testpath.replace(/^\//, '');
+    var tmppath = testpath.replace(/^\//, "");
     for (var f in excludetests) {
       // Remove leading /tests/ if exists
-      file = f.replace(/^\//, '')
-      file = file.replace(/^tests\//, '')
+      file = f.replace(/^\//, "");
+      file = file.replace(/^tests\//, "");
 
       // Match directory or filename, testList has <testroot>/<path>
       if (tmppath.match(testRoot + "/" + file) != null) {
         found = true;
         break;
       }
     }
     if (!found) {
--- a/testing/mochitest/nested_setup.js
+++ b/testing/mochitest/nested_setup.js
@@ -1,31 +1,28 @@
-
-var gTestURL = '';
 
-function addPermissions()
-{
+var gTestURL = "";
+
+function addPermissions() {
   SpecialPowers.pushPermissions(
     [{ type: "browser", allow: true, context: document }],
     addPreferences);
 }
 
-function addPreferences()
-{
+function addPreferences() {
   SpecialPowers.pushPrefEnv(
     {"set": [["dom.mozBrowserFramesEnabled", true]]},
     insertFrame);
 }
 
-function insertFrame()
-{
+function insertFrame() {
   SpecialPowers.nestedFrameSetup();
 
-  var iframe = document.createElement('iframe');
-  iframe.id = 'nested-parent-frame';
+  var iframe = document.createElement("iframe");
+  iframe.id = "nested-parent-frame";
   iframe.width = "100%";
   iframe.height = "100%";
   iframe.scoring = "no";
   iframe.setAttribute("remote", "true");
   iframe.setAttribute("mozbrowser", "true");
   iframe.src = gTestURL;
   document.getElementById("holder-div").appendChild(iframe);
-}
\ No newline at end of file
+}
--- a/testing/mochitest/redirect.html
+++ b/testing/mochitest/redirect.html
@@ -1,29 +1,27 @@
 <html>
 <head>
   <title>redirecting...</title>
 
   <script type="text/javascript">
-    function redirect(aURL)
-    {
+    function redirect(aURL) {
       // We create a listener for this event in browser-test.js which will
       // get picked up when specifying --flavor=chrome or --flavor=a11y
       var event = new CustomEvent("contentEvent", {
         bubbles: true,
         detail: {
           "data": aURL + location.search,
           "type": "loadURI"
         }
       });
       document.dispatchEvent(event);
     }
 
-    function redirectToHarness()
-    {
+    function redirectToHarness() {
       redirect("chrome://mochikit/content/harness.xul");
     }
 
     function onLoad() {
       // Wait for MozAfterPaint, since the listener in browser-test.js is not
       // added until then.
       window.addEventListener("MozAfterPaint", function() {
         setTimeout(redirectToHarness, 0);
--- a/testing/mochitest/server.js
+++ b/testing/mochitest/server.js
@@ -15,95 +15,91 @@ var ios = Cc["@mozilla.org/network/io-se
 ios.manageOfflineStatus = false;
 ios.offline = false;
 
 var server; // for use in the shutdown handler, if necessary
 
 //
 // HTML GENERATION
 //
-var tags = ['A', 'ABBR', 'ACRONYM', 'ADDRESS', 'APPLET', 'AREA', 'B', 'BASE',
-            'BASEFONT', 'BDO', 'BIG', 'BLOCKQUOTE', 'BODY', 'BR', 'BUTTON',
-            'CAPTION', 'CENTER', 'CITE', 'CODE', 'COL', 'COLGROUP', 'DD',
-            'DEL', 'DFN', 'DIR', 'DIV', 'DL', 'DT', 'EM', 'FIELDSET', 'FONT',
-            'FORM', 'FRAME', 'FRAMESET', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6',
-            'HEAD', 'HR', 'HTML', 'I', 'IFRAME', 'IMG', 'INPUT', 'INS',
-            'ISINDEX', 'KBD', 'LABEL', 'LEGEND', 'LI', 'LINK', 'MAP', 'MENU',
-            'META', 'NOFRAMES', 'NOSCRIPT', 'OBJECT', 'OL', 'OPTGROUP',
-            'OPTION', 'P', 'PARAM', 'PRE', 'Q', 'S', 'SAMP', 'SCRIPT',
-            'SELECT', 'SMALL', 'SPAN', 'STRIKE', 'STRONG', 'STYLE', 'SUB',
-            'SUP', 'TABLE', 'TBODY', 'TD', 'TEXTAREA', 'TFOOT', 'TH', 'THEAD',
-            'TITLE', 'TR', 'TT', 'U', 'UL', 'VAR'];
+var tags = ["A", "ABBR", "ACRONYM", "ADDRESS", "APPLET", "AREA", "B", "BASE",
+            "BASEFONT", "BDO", "BIG", "BLOCKQUOTE", "BODY", "BR", "BUTTON",
+            "CAPTION", "CENTER", "CITE", "CODE", "COL", "COLGROUP", "DD",
+            "DEL", "DFN", "DIR", "DIV", "DL", "DT", "EM", "FIELDSET", "FONT",
+            "FORM", "FRAME", "FRAMESET", "H1", "H2", "H3", "H4", "H5", "H6",
+            "HEAD", "HR", "HTML", "I", "IFRAME", "IMG", "INPUT", "INS",
+            "ISINDEX", "KBD", "LABEL", "LEGEND", "LI", "LINK", "MAP", "MENU",
+            "META", "NOFRAMES", "NOSCRIPT", "OBJECT", "OL", "OPTGROUP",
+            "OPTION", "P", "PARAM", "PRE", "Q", "S", "SAMP", "SCRIPT",
+            "SELECT", "SMALL", "SPAN", "STRIKE", "STRONG", "STYLE", "SUB",
+            "SUP", "TABLE", "TBODY", "TD", "TEXTAREA", "TFOOT", "TH", "THEAD",
+            "TITLE", "TR", "TT", "U", "UL", "VAR"];
 
 /**
  * Below, we'll use makeTagFunc to create a function for each of the
  * strings in 'tags'. This will allow us to use s-expression like syntax
  * to create HTML.
  */
-function makeTagFunc(tagName)
-{
-  return function (attrs /* rest... */)
-  {
+function makeTagFunc(tagName) {
+  return function(attrs /* rest... */) {
     var startChildren = 0;
     var response = "";
 
     // write the start tag and attributes
     response += "<" + tagName;
     // if attr is an object, write attributes
-    if (attrs && typeof attrs == 'object') {
+    if (attrs && typeof attrs == "object") {
       startChildren = 1;
 
       for (let key in attrs) {
         const value = attrs[key];
         var val = "" + value;
-        response += " " + key + '="' + val.replace('"','&quot;') + '"';
+        response += " " + key + '="' + val.replace('"', "&quot;") + '"';
       }
     }
     response += ">";
 
     // iterate through the rest of the args
     for (var i = startChildren; i < arguments.length; i++) {
-      if (typeof arguments[i] == 'function') {
+      if (typeof arguments[i] == "function") {
         response += arguments[i]();
       } else {
         response += arguments[i];
       }
     }
 
     // write the close tag
     response += "</" + tagName + ">\n";
     return response;
-  }
+  };
 }
 
 function makeTags() {
   // map our global HTML generation functions
   for (let tag of tags) {
       this[tag] = makeTagFunc(tag.toLowerCase());
   }
 }
 
 var _quitting = false;
 
 /** Quit when all activity has completed. */
-function serverStopped()
-{
+function serverStopped() {
   _quitting = true;
 }
 
 // only run the "main" section if httpd.js was loaded ahead of us
-if (this["nsHttpServer"]) {
+if (this.nsHttpServer) {
   //
   // SCRIPT CODE
   //
   runServer();
 
   // We can only have gotten here if the /server/shutdown path was requested.
-  if (_quitting)
-  {
+  if (_quitting) {
     dumpn("HTTP server stopped, all pending requests complete");
     quit(0);
   }
 
   // Impossible as the stop callback should have been called, but to be safe...
   dumpn("TEST-UNEXPECTED-FAIL | failure to correctly shut down HTTP server");
   quit(1);
 }
@@ -112,31 +108,30 @@ var serverBasePath;
 var displayResults = true;
 
 var gServerAddress;
 var SERVER_PORT;
 
 //
 // SERVER SETUP
 //
-function runServer()
-{
+function runServer() {
   serverBasePath = __LOCATION__.parent;
   server = createMochitestServer(serverBasePath);
 
-  //verify server address
-  //if a.b.c.d or 'localhost'
+  // verify server address
+  // if a.b.c.d or 'localhost'
   if (typeof(_SERVER_ADDR) != "undefined") {
     if (_SERVER_ADDR == "localhost") {
       gServerAddress = _SERVER_ADDR;
     } else {
-      var quads = _SERVER_ADDR.split('.');
+      var quads = _SERVER_ADDR.split(".");
       if (quads.length == 4) {
         var invalid = false;
-        for (var i=0; i < 4; i++) {
+        for (var i = 0; i < 4; i++) {
           if (quads[i] < 0 || quads[i] > 255)
             invalid = true;
         }
         if (!invalid)
           gServerAddress = _SERVER_ADDR;
         else
           throw new Error("invalid _SERVER_ADDR, please specify a valid IP Address");
       }
@@ -201,18 +196,17 @@ function runServer()
   // and return.
 
   // get rid of any pending requests
   while (thread.hasPendingEvents())
     thread.processNextEvent(true);
 }
 
 /** Creates and returns an HTTP server configured to serve Mochitests. */
-function createMochitestServer(serverBasePath)
-{
+function createMochitestServer(serverBasePath) {
   var server = new nsHttpServer();
 
   server.registerDirectory("/", serverBasePath);
   server.registerPathHandler("/server/shutdown", serverShutdown);
   server.registerPathHandler("/server/debug", serverDebug);
   server.registerPathHandler("/nested_oop", nestedTest);
   server.registerContentType("sjs", "sjs"); // .sjs == CGI-like functionality
   server.registerContentType("jar", "application/x-jar");
@@ -224,41 +218,39 @@ function createMochitestServer(serverBas
   server.registerContentType("dat", "text/plain; charset=utf-8");
   server.registerContentType("frag", "text/plain"); // .frag == WebGL fragment shader
   server.registerContentType("vert", "text/plain"); // .vert == WebGL vertex shader
   server.registerContentType("wasm", "application/wasm");
   server.setIndexHandler(defaultDirHandler);
 
   var serverRoot =
     {
-      getFile: function getFile(path)
-      {
+      getFile: function getFile(path) {
         var file = serverBasePath.clone().QueryInterface(Ci.nsIFile);
         path.split("/").forEach(function(p) {
           file.appendRelativePath(p);
         });
         return file;
       },
-      QueryInterface: function(aIID) { return this; }
+      QueryInterface(aIID) { return this; }
     };
 
   server.setObjectState("SERVER_ROOT", serverRoot);
 
   processLocations(server);
 
   return server;
 }
 
 /**
  * Notifies the HTTP server about all the locations at which it might receive
  * requests, so that it can properly respond to requests on any of the hosts it
  * serves.
  */
-function processLocations(server)
-{
+function processLocations(server) {
   var serverLocations = serverBasePath.clone();
   serverLocations.append("server-locations.txt");
 
   const PR_RDONLY = 0x01;
   var fis = new FileInputStream(serverLocations, PR_RDONLY, 292 /* 0444 */,
                                 Ci.nsIFileInputStream.CLOSE_ON_EOF);
 
   var lis = new ConverterInputStream(fis, "UTF-8", 1024, 0x0);
@@ -278,36 +270,32 @@ function processLocations(server)
                "(?:" +
                "\\s+" +
                "(\\S+(?:,\\S+)*)" +
                ")?$");
 
   var line = {};
   var lineno = 0;
   var seenPrimary = false;
-  do
-  {
+  do {
     var more = lis.readLine(line);
     lineno++;
 
     var lineValue = line.value;
     if (lineValue.charAt(0) == "#" || lineValue == "")
       continue;
 
     var match = LINE_REGEXP.exec(lineValue);
     if (!match)
       throw new Error("Syntax error in server-locations.txt, line " + lineno);
 
     var [, scheme, host, port, options] = match;
-    if (options)
-    {
-      if (options.split(",").includes("primary"))
-      {
-        if (seenPrimary)
-        {
+    if (options) {
+      if (options.split(",").includes("primary")) {
+        if (seenPrimary) {
           throw new Error("Multiple primary locations in server-locations.txt, " +
                           "line " + lineno);
         }
 
         server.identity.setPrimary(scheme, host, port);
         seenPrimary = true;
         continue;
       }
@@ -316,31 +304,29 @@ function processLocations(server)
     server.identity.add(scheme, host, port);
   }
   while (more);
 }
 
 // PATH HANDLERS
 
 // /server/shutdown
-function serverShutdown(metadata, response)
-{
+function serverShutdown(metadata, response) {
   response.setStatusLine("1.1", 200, "OK");
   response.setHeader("Content-type", "text/plain", false);
 
   var body = "Server shut down.";
   response.bodyOutputStream.write(body, body.length);
 
   dumpn("Server shutting down now...");
   server.stop(serverStopped);
 }
 
 // /server/debug?[012]
-function serverDebug(metadata, response)
-{
+function serverDebug(metadata, response) {
   response.setStatusLine(metadata.httpVersion, 400, "Bad debugging level");
   if (metadata.queryString.length !== 1)
     return;
 
   var mode;
   if (metadata.queryString === "0") {
     // do this now so it gets logged with the old mode
     dumpn("Server debug logs disabled.");
@@ -369,31 +355,29 @@ function serverDebug(metadata, response)
 //
 // DIRECTORY LISTINGS
 //
 
 /**
  * Creates a generator that iterates over the contents of
  * an nsIFile directory.
  */
-function* dirIter(dir)
-{
+function* dirIter(dir) {
   var en = dir.directoryEntries;
   while (en.hasMoreElements()) {
     var file = en.getNext();
     yield file.QueryInterface(Ci.nsIFile);
   }
 }
 
 /**
  * Builds an optionally nested object containing links to the
  * files and directories within dir.
  */
-function list(requestPath, directory, recurse)
-{
+function list(requestPath, directory, recurse) {
   var count = 0;
   var path = requestPath;
   if (path.charAt(path.length - 1) != "/") {
     path += "/";
   }
 
   var dir = directory.QueryInterface(Ci.nsIFile);
   var links = {};
@@ -422,54 +406,50 @@ function list(requestPath, directory, re
     var key = path + file.leafName;
     var childCount = 0;
     if (file.isDirectory()) {
       key += "/";
     }
     if (recurse && file.isDirectory()) {
       [links[key], childCount] = list(key, file, recurse);
       count += childCount;
-    } else {
-      if (file.leafName.charAt(0) != '.') {
-        links[key] = {'test': {'url': key, 'expected': 'pass'}};
+    } else if (file.leafName.charAt(0) != ".") {
+        links[key] = {"test": {"url": key, "expected": "pass"}};
       }
-    }
   }
 
   return [links, count];
 }
 
 /**
  * Heuristic function that determines whether a given path
  * is a test case to be executed in the harness, or just
  * a supporting file.
  */
-function isTest(filename, pattern)
-{
+function isTest(filename, pattern) {
   if (pattern)
     return pattern.test(filename);
 
   // File name is a URL style path to a test file, make sure that we check for
   // tests that start with the appropriate prefix.
   var testPrefix = typeof(_TEST_PREFIX) == "string" ? _TEST_PREFIX : "test_";
   var testPattern = new RegExp("^" + testPrefix);
 
-  var pathPieces = filename.split('/');
+  var pathPieces = filename.split("/");
 
   return testPattern.test(pathPieces[pathPieces.length - 1]) &&
          !filename.includes(".js") &&
          !filename.includes(".css") &&
          !/\^headers\^$/.test(filename);
 }
 
 /**
  * Transform nested hashtables of paths to nested HTML lists.
  */
-function linksToListItems(links)
-{
+function linksToListItems(links) {
   var response = "";
   var children = "";
   for (let link in links) {
     const value = links[link];
     var classVal = (!isTest(link) && !(value instanceof Object))
       ? "non-test invisible"
       : "test";
     if (value instanceof Object) {
@@ -482,39 +462,38 @@ function linksToListItems(links)
     var bug_num = null;
     if (bug_title != null) {
         bug_num = bug_title[0].match(/\d+/);
     }
 
     if ((bug_title == null) || (bug_num == null)) {
       response += LI({class: classVal}, A({href: link}, link), children);
     } else {
-      var bug_url = "https://bugzilla.mozilla.org/show_bug.cgi?id="+bug_num;
-      response += LI({class: classVal}, A({href: link}, link), " - ", A({href: bug_url}, "Bug "+bug_num), children);
+      var bug_url = "https://bugzilla.mozilla.org/show_bug.cgi?id=" + bug_num;
+      response += LI({class: classVal}, A({href: link}, link), " - ", A({href: bug_url}, "Bug " + bug_num), children);
     }
 
   }
   return response;
 }
 
 /**
  * Transform nested hashtables of paths to a flat table rows.
  */
-function linksToTableRows(links, recursionLevel)
-{
+function linksToTableRows(links, recursionLevel) {
   var response = "";
   for (let link in links) {
     const value = links[link];
-    var classVal = (!isTest(link) && ((value instanceof Object) && ('test' in value)))
+    var classVal = (!isTest(link) && ((value instanceof Object) && ("test" in value)))
       ? "non-test invisible"
       : "";
 
     var spacer = "padding-left: " + (10 * recursionLevel) + "px";
 
-    if ((value instanceof Object) && !('test' in value)) {
+    if ((value instanceof Object) && !("test" in value)) {
       response += TR({class: "dir", id: "tr-" + link },
                      TD({colspan: "3"}, "&#160;"),
                      TD({style: spacer},
                         A({href: link}, link)));
       response += linksToTableRows(value, recursionLevel + 1);
     } else {
       var bug_title = link.match(/test_bug\S+/);
       var bug_num = null;
@@ -541,40 +520,38 @@ function linksToTableRows(links, recursi
     }
   }
   return response;
 }
 
 function arrayOfTestFiles(linkArray, fileArray, testPattern) {
   for (let link in linkArray) {
     const value = linkArray[link];
-    if ((value instanceof Object) && !('test' in value)) {
+    if ((value instanceof Object) && !("test" in value)) {
       arrayOfTestFiles(value, fileArray, testPattern);
     } else if (isTest(link, testPattern) && (value instanceof Object)) {
-      fileArray.push(value['test'])
+      fileArray.push(value.test);
     }
   }
 }
 /**
  * Produce a flat array of test file paths to be executed in the harness.
  */
-function jsonArrayOfTestFiles(links)
-{
+function jsonArrayOfTestFiles(links) {
   var testFiles = [];
   arrayOfTestFiles(links, testFiles);
-  testFiles = testFiles.map(function(file) { return '"' + file['url'] + '"'; });
+  testFiles = testFiles.map(function(file) { return '"' + file.url + '"'; });
 
   return "[" + testFiles.join(",\n") + "]";
 }
 
 /**
  * Produce a normal directory listing.
  */
-function regularListing(metadata, response)
-{
+function regularListing(metadata, response) {
   var [links, count] = list(metadata.path,
                             metadata.getProperty("directory"),
                             false);
   response.write(
     HTML(
       HEAD(
         TITLE("mochitest index ", metadata.path)
       ),
@@ -586,40 +563,38 @@ function regularListing(metadata, respon
     )
   );
 }
 
 /**
  * Read a manifestFile located at the root of the server's directory and turn
  * it into an object for creating a table of clickable links for each test.
  */
-function convertManifestToTestLinks(root, manifest)
-{
+function convertManifestToTestLinks(root, manifest) {
   ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 
   var manifestFile = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
   manifestFile.initWithFile(serverBasePath);
   manifestFile.append(manifest);
 
   var manifestStream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(Ci.nsIFileInputStream);
   manifestStream.init(manifestFile, -1, 0, 0);
 
   var manifestObj = JSON.parse(NetUtil.readInputStreamToString(manifestStream,
                                                                manifestStream.available()));
   var paths = manifestObj.tests;
-  var pathPrefix = '/' + root + '/'
+  var pathPrefix = "/" + root + "/";
   return [paths.reduce(function(t, p) { t[pathPrefix + p.path] = true; return t; }, {}),
           paths.length];
 }
 
 /**
  * Produce a test harness page that has one remote iframe
  */
-function nestedTest(metadata, response)
-{
+function nestedTest(metadata, response) {
   response.setStatusLine("1.1", 200, "OK");
   response.setHeader("Content-type", "text/html;charset=utf-8", false);
   response.write(
     HTML(
       HEAD(
         TITLE("Mochitest | ", metadata.path),
         LINK({rel: "stylesheet",
               type: "text/css", href: "/static/harness.css"}),
@@ -634,32 +609,31 @@ function nestedTest(metadata, response)
         )
         )));
 }
 
 /**
  * Produce a test harness page containing all the test cases
  * below it, recursively.
  */
-function testListing(metadata, response)
-{
+function testListing(metadata, response) {
   var links = {};
   var count = 0;
-  if (!metadata.queryString.includes('manifestFile')) {
+  if (!metadata.queryString.includes("manifestFile")) {
     [links, count] = list(metadata.path,
                           metadata.getProperty("directory"),
                           true);
   } else if (typeof(Components) != undefined) {
     var manifest = metadata.queryString.match(/manifestFile=([^&]+)/)[1];
 
-    [links, count] = convertManifestToTestLinks(metadata.path.split('/')[1],
+    [links, count] = convertManifestToTestLinks(metadata.path.split("/")[1],
                                                 manifest);
   }
 
-  var table_class = metadata.queryString.indexOf("hideResultsTable=1") > -1 ? "invisible": "";
+  var table_class = metadata.queryString.indexOf("hideResultsTable=1") > -1 ? "invisible" : "";
 
   let testname = (metadata.queryString.indexOf("testname=") > -1)
                  ? metadata.queryString.match(/testname=([^&]+)/)[1]
                  : "";
 
   dumpn("count: " + count);
   var tests = testname
               ? "['/" + testname + "']"
@@ -692,25 +666,25 @@ function testListing(metadata, response)
         )
       ),
       BODY(
         DIV({class: "container"},
           H2("--> ", A({href: "#", id: "runtests"}, "Run Tests"), " <--"),
             P({style: "float: right;"},
             SMALL(
               "Based on the ",
-              A({href:"http://www.mochikit.com/"}, "MochiKit"),
+              A({href: "http://www.mochikit.com/"}, "MochiKit"),
               " unit tests."
             )
           ),
           DIV({class: "status"},
             H1({id: "indicator"}, "Status"),
-            H2({id: "pass"}, "Passed: ", SPAN({id: "pass-count"},"0")),
-            H2({id: "fail"}, "Failed: ", SPAN({id: "fail-count"},"0")),
-            H2({id: "fail"}, "Todo: ", SPAN({id: "todo-count"},"0"))
+            H2({id: "pass"}, "Passed: ", SPAN({id: "pass-count"}, "0")),
+            H2({id: "fail"}, "Failed: ", SPAN({id: "fail-count"}, "0")),
+            H2({id: "fail"}, "Todo: ", SPAN({id: "todo-count"}, "0"))
           ),
           DIV({class: "clear"}),
           DIV({id: "current-test"},
             B("Currently Executing: ",
               SPAN({id: "current-test-path"}, "_")
             )
           ),
           DIV({class: "clear"}),
@@ -741,18 +715,17 @@ function testListing(metadata, response)
     )
   );
 }
 
 /**
  * Respond to requests that match a file system directory.
  * Under the tests/ directory, return a test harness page.
  */
-function defaultDirHandler(metadata, response)
-{
+function defaultDirHandler(metadata, response) {
   response.setStatusLine("1.1", 200, "OK");
   response.setHeader("Content-type", "text/html;charset=utf-8", false);
   try {
     if (metadata.path.indexOf("/tests") != 0) {
       regularListing(metadata, response);
     } else {
       testListing(metadata, response);
     }
--- a/testing/mochitest/start_desktop.js
+++ b/testing/mochitest/start_desktop.js
@@ -1,15 +1,15 @@
 /* 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/. */
 
-const flavor  = __webDriverArguments[0]["flavor"];
-const url = __webDriverArguments[0]["testUrl"];
+const flavor  = __webDriverArguments[0].flavor;
+const url = __webDriverArguments[0].testUrl;
 
 let wm = Cc["@mozilla.org/appshell/window-mediator;1"]
           .getService(Ci.nsIWindowMediator);
 let win = wm.getMostRecentWindow("navigator:browser");
 
 // mochikit's bootstrap.js has set up a listener for this event. It's
 // used so bootstrap.js knows which flavor and url to load.
-let ev = new CustomEvent('mochitest-load', {'detail': [flavor, url]});
+let ev = new CustomEvent("mochitest-load", {"detail": [flavor, url]});
 win.dispatchEvent(ev);
new file mode 100644
--- /dev/null
+++ b/testing/mochitest/tests/browser/.eslintrc.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = {
+  "extends": [
+    "plugin:mozilla/browser-test"
+  ]
+};
--- a/testing/mochitest/tests/browser/browser_BrowserTestUtils.js
+++ b/testing/mochitest/tests/browser/browser_BrowserTestUtils.js
@@ -1,17 +1,16 @@
-function getLastEventDetails(browser)
-{
+function getLastEventDetails(browser) {
   return ContentTask.spawn(browser, {}, async function() {
-    return content.document.getElementById('out').textContent;
+    return content.document.getElementById("out").textContent;
   });
 }
 
 add_task(async function() {
-  let onClickEvt = 'document.getElementById("out").textContent = event.target.localName + "," + event.clientX + "," + event.clientY;'
+  let onClickEvt = 'document.getElementById("out").textContent = event.target.localName + "," + event.clientX + "," + event.clientY;';
   const url = "<body onclick='" + onClickEvt + "' style='margin: 0'>" +
               "<button id='one' style='margin: 0; margin-left: 16px; margin-top: 14px; width: 30px; height: 40px;'>Test</button>" +
               "<div onmousedown='event.preventDefault()' style='margin: 0; width: 80px; height: 60px;'>Other</div>" +
               "<span id='out'></span></body>";
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "data:text/html," + url);
 
   let browser = tab.linkedBrowser;
   await BrowserTestUtils.synthesizeMouseAtCenter("#one", {}, browser);
--- a/testing/mochitest/tests/browser/browser_browserLoaded_content_loaded.js
+++ b/testing/mochitest/tests/browser/browser_browserLoaded_content_loaded.js
@@ -1,47 +1,47 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
-'use strict';
+"use strict";
 
 function isDOMLoaded(browser) {
   return ContentTask.spawn(browser, null, async function() {
     Assert.equal(content.document.readyState, "complete",
       "Browser should be loaded.");
   });
 }
 
 // It checks if calling BrowserTestUtils.browserLoaded() yields
 // browser object.
 add_task(async function() {
-  let tab = BrowserTestUtils.addTab(gBrowser, 'http://example.com');
+  let tab = BrowserTestUtils.addTab(gBrowser, "http://example.com");
   let browser = tab.linkedBrowser;
   await BrowserTestUtils.browserLoaded(browser);
   await isDOMLoaded(browser);
   gBrowser.removeTab(tab);
 });
 
 // It checks that BrowserTestUtils.browserLoaded() works well with
 // promise.all().
 add_task(async function() {
   let tabURLs = [
     `http://example.org`,
     `http://mochi.test:8888`,
     `http://test:80`,
   ];
-  //Add tabs, get the respective browsers
+  // Add tabs, get the respective browsers
   let browsers = tabURLs.map(u => BrowserTestUtils.addTab(gBrowser, u).linkedBrowser);
 
-  //wait for promises to settle
-  await Promise.all((function*() {
+  // wait for promises to settle
+  await Promise.all((function* () {
     for (let b of browsers) {
       yield BrowserTestUtils.browserLoaded(b);
     }
   })());
-  let expected = 'Expected all promised browsers to have loaded.';
+  let expected = "Expected all promised browsers to have loaded.";
   for (const browser of browsers) {
     await isDOMLoaded(browser);
   }
-  //cleanup
+  // cleanup
   browsers
     .map(browser => gBrowser.getTabForBrowser(browser))
     .forEach(tab => gBrowser.removeTab(tab));
 });
--- a/testing/mochitest/tests/browser/browser_getTestFile.js
+++ b/testing/mochitest/tests/browser/browser_getTestFile.js
@@ -1,44 +1,44 @@
 function test() {
   let {Promise} = ChromeUtils.import("resource://gre/modules/Promise.jsm");
   ChromeUtils.import("resource://gre/modules/osfile.jsm");
   let decoder = new TextDecoder();
 
   waitForExplicitFinish();
 
-  SimpleTest.doesThrow(function () {
-    getTestFilePath("/browser_getTestFile.js")
+  SimpleTest.doesThrow(function() {
+    getTestFilePath("/browser_getTestFile.js");
   }, "getTestFilePath rejects absolute paths");
 
   Promise.all([
     OS.File.exists(getTestFilePath("browser_getTestFile.js"))
-      .then(function (exists) {
+      .then(function(exists) {
         ok(exists, "getTestFilePath consider the path as being relative");
       }),
 
     OS.File.exists(getTestFilePath("./browser_getTestFile.js"))
-      .then(function (exists) {
+      .then(function(exists) {
         ok(exists, "getTestFilePath also accepts explicit relative path");
       }),
 
     OS.File.exists(getTestFilePath("./browser_getTestFileTypo.xul"))
-      .then(function (exists) {
+      .then(function(exists) {
         ok(!exists, "getTestFilePath do not throw if the file doesn't exists");
       }),
 
     OS.File.read(getTestFilePath("test-dir/test-file"))
-      .then(function (array) {
+      .then(function(array) {
         is(decoder.decode(array), "foo\n", "getTestFilePath can reach sub-folder files 1/2");
       }),
 
     OS.File.read(getTestFilePath("./test-dir/test-file"))
-      .then(function (array) {
+      .then(function(array) {
         is(decoder.decode(array), "foo\n", "getTestFilePath can reach sub-folder files 2/2");
       })
 
-  ]).then(function () {
+  ]).then(function() {
     finish();
-  }, function (error) {
+  }, function(error) {
     ok(false, error);
     finish();
   });
 }
--- a/testing/mochitest/tests/browser/browser_privileges.js
+++ b/testing/mochitest/tests/browser/browser_privileges.js
@@ -1,16 +1,15 @@
 function test() {
   // simple test to confirm we have chrome privileges
   let hasPrivileges = true;
 
   // this will throw an exception if we are not running with privileges
   try {
     var prefs = Cc["@mozilla.org/preferences-service;1"].
                 getService(Ci.nsIPrefBranch);
-  }
-  catch (e) {
+  } catch (e) {
     hasPrivileges = false;
   }
 
   // if we get here, we must have chrome privileges
   ok(hasPrivileges, "running with chrome privileges");
 }
--- a/testing/mochitest/tests/browser/browser_waitForFocus.js
+++ b/testing/mochitest/tests/browser/browser_waitForFocus.js
@@ -1,13 +1,12 @@
 
 const gBaseURL = "https://example.com/browser/testing/mochitest/tests/browser/";
 
-function promiseTabLoadEvent(tab, url)
-{
+function promiseTabLoadEvent(tab, url) {
   let promise = BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, url);
   if (url) {
     tab.linkedBrowser.loadURI(url);
   }
   return promise;
 }
 
 // Load a new blank tab
--- a/testing/mochitest/tests/browser/head.js
+++ b/testing/mochitest/tests/browser/head.js
@@ -1,12 +1,12 @@
-var headVar = "I'm a var in head file";
-
-function headMethod() {
-  return true;
-};
-
-ok(true, "I'm a test in head file");
-
-registerCleanupFunction(function() {
-  ok(true, "I'm a cleanup function in head file");
-  is(this.headVar, "I'm a var in head file", "Head cleanup function scope is correct");
-});
+var headVar = "I'm a var in head file";
+
+function headMethod() {
+  return true;
+}
+
+ok(true, "I'm a test in head file");
+
+registerCleanupFunction(function() {
+  ok(true, "I'm a cleanup function in head file");
+  is(this.headVar, "I'm a var in head file", "Head cleanup function scope is correct");
+});
new file mode 100644
--- /dev/null
+++ b/testing/mochitest/tests/python/files/.eslintrc.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = {
+  "extends": [
+    "plugin:mozilla/browser-test",
+    "plugin:mozilla/mochitest-test"
+  ]
+};
--- a/testing/mochitest/tests/python/files/test_assertion.html
+++ b/testing/mochitest/tests/python/files/test_assertion.html
@@ -7,17 +7,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <meta charset="utf-8">
   <title>Test Assertion</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
     const Cc = SpecialPowers.Cc;
     const Ci = SpecialPowers.Ci;
     let debug = Cc["@mozilla.org/xpcom/debug;1"].getService(Ci.nsIDebug2);
-    debug.assertion('failed assertion check', 'false', 'test_assertion.html', 15);
+    debug.assertion("failed assertion check", "false", "test_assertion.html", 15);
     ok(true, "Should pass");
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1343659">Mozilla Bug 1343659</a>
 <p id="display"></p>
 <div id="content" style="display: none">
 
--- a/testing/mochitest/tests/python/files/test_crash.html
+++ b/testing/mochitest/tests/python/files/test_crash.html
@@ -7,17 +7,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <meta charset="utf-8">
   <title>Test Crash</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="application/javascript">
     const Cc = SpecialPowers.Cc;
     const Ci = SpecialPowers.Ci;
     let debug = Cc["@mozilla.org/xpcom/debug;1"].getService(Ci.nsIDebug2);
-    debug.abort('test_crash.html', 15);
+    debug.abort("test_crash.html", 15);
     ok(true, "Should pass");
   </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1343659">Mozilla Bug 1343659</a>
 <p id="display"></p>
 <div id="content" style="display: none">