merge autoland to mozilla-central a=merge
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 14 Nov 2016 10:20:15 +0100
changeset 352303 add9dada238ed99b4f93c027b535423f067d3781
parent 352222 47e0584afe0ab0b867412189c610b302b6ba0ea7 (current diff)
parent 352302 9dc1fd87542cd7a89a1af4c67c6772a45924d91d (diff)
child 352419 1196bf3032e1bce1fb07a01fd9082a767426c5fb
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone52.0a1
merge autoland to mozilla-central a=merge
browser/base/content/test/general/browser_aboutTabCrashed.js
browser/base/content/test/general/browser_aboutTabCrashed_clearEmail.js
browser/base/content/test/general/browser_aboutTabCrashed_showForm.js
browser/base/content/test/general/browser_aboutTabCrashed_withoutDump.js
dom/inputport/AVInputPort.cpp
dom/inputport/AVInputPort.h
dom/inputport/DisplayPortInputPort.cpp
dom/inputport/DisplayPortInputPort.h
dom/inputport/FakeInputPortService.cpp
dom/inputport/FakeInputPortService.h
dom/inputport/HDMIInputPort.cpp
dom/inputport/HDMIInputPort.h
dom/inputport/InputPort.cpp
dom/inputport/InputPort.h
dom/inputport/InputPortData.cpp
dom/inputport/InputPortData.h
dom/inputport/InputPortListeners.cpp
dom/inputport/InputPortListeners.h
dom/inputport/InputPortManager.cpp
dom/inputport/InputPortManager.h
dom/inputport/InputPortServiceFactory.cpp
dom/inputport/InputPortServiceFactory.h
dom/inputport/moz.build
dom/inputport/nsIInputPortService.idl
dom/inputport/test/mochitest/mochitest.ini
dom/inputport/test/mochitest/test_inputport_connection_event.html
dom/inputport/test/mochitest/test_inputport_get_inputports.html
dom/inputport/test/xpcshell/test_inputport_data.js
dom/inputport/test/xpcshell/xpcshell.ini
dom/webidl/AVInputPort.webidl
dom/webidl/DisplayPortInputPort.webidl
dom/webidl/HDMIInputPort.webidl
dom/webidl/InputPort.webidl
dom/webidl/InputPortManager.webidl
testing/marionette/harness/session/__init__.py
testing/marionette/harness/session/runner/__init__.py
testing/marionette/harness/session/runner/base.py
testing/marionette/harness/session/runner/ping_server.py
testing/marionette/harness/session/runtests.py
testing/marionette/harness/session/session_test.py
testing/marionette/harness/session/tests/test_session.py
testing/marionette/harness/session/tests/unit-tests.ini
--- a/.eslintignore
+++ b/.eslintignore
@@ -75,36 +75,30 @@ browser/extensions/pdfjs/**
 browser/extensions/pocket/content/panels/js/tmpl.js
 browser/extensions/pocket/content/panels/js/vendor/**
 browser/locales/**
 
 # devtools/ exclusions
 devtools/client/canvasdebugger/**
 devtools/client/commandline/**
 devtools/client/debugger/**
-devtools/client/eyedropper/**
 devtools/client/framework/**
 !devtools/client/framework/selection.js
 !devtools/client/framework/toolbox.js
 devtools/client/jsonview/lib/**
 devtools/client/memory/**
 devtools/client/netmonitor/test/**
 devtools/client/netmonitor/har/test/**
 devtools/client/projecteditor/**
 devtools/client/promisedebugger/**
 devtools/client/responsivedesign/**
 devtools/client/scratchpad/**
 devtools/client/shadereditor/**
 devtools/client/shared/*.jsm
 devtools/client/shared/webgl-utils.js
-devtools/client/shared/developer-toolbar.js
-devtools/client/shared/components/test/**
-devtools/client/shared/redux/middleware/test/**
-devtools/client/shared/test/**
-!devtools/client/shared/test/test-actor-registry.js
 devtools/client/shared/widgets/*.jsm
 devtools/client/sourceeditor/test/*.js
 devtools/client/webaudioeditor/**
 devtools/client/webconsole/**
 !devtools/client/webconsole/panel.js
 !devtools/client/webconsole/jsterm.js
 !devtools/client/webconsole/console-commands.js
 devtools/client/webide/**
--- a/addon-sdk/source/lib/sdk/addon/installer.js
+++ b/addon-sdk/source/lib/sdk/addon/installer.js
@@ -59,17 +59,17 @@ exports.install = function install(xpiPa
     },
     onDownloadFailed: function(aInstall) {
       this.onInstallFailed(aInstall);
     }
   };
 
   // Order AddonManager to install the addon
   AddonManager.getInstallForFile(file, function(install) {
-    if (install.error != null) {
+    if (install.error == 0) {
       install.addListener(listener);
       install.install();
     } else {
       reject(install.error);
     }
   });
 
   return promise;
--- a/addon-sdk/source/lib/sdk/panel/utils.js
+++ b/addon-sdk/source/lib/sdk/panel/utils.js
@@ -250,17 +250,17 @@ function onPanelClick(event) {
 }
 
 function setupPanelFrame(frame) {
   frame.setAttribute("flex", 1);
   frame.setAttribute("transparent", "transparent");
   frame.setAttribute("autocompleteenabled", true);
   frame.setAttribute("tooltip", "aHTMLTooltip");
   if (platform === "darwin") {
-    frame.style.borderRadius = "6px";
+    frame.style.borderRadius = "var(--arrowpanel-border-radius, 3.5px)";
     frame.style.padding = "1px";
   }
 }
 
 function make(document, options) {
   document = document || getMostRecentBrowserWindow().document;
   let panel = document.createElementNS(XUL_NS, "panel");
   panel.setAttribute("type", "arrow");
--- a/b2g/dev/config/tooltool-manifests/linux64/hazard.manifest
+++ b/b2g/dev/config/tooltool-manifests/linux64/hazard.manifest
@@ -19,19 +19,19 @@
 "algorithm" : "sha512",
 "filename" : "gtk3.tar.xz",
 "setup" : "setup.sh",
 "unpack" : true,
 "digest" : "3915f8ec396c56a8a92e6f9695b70f09ce9d1582359d1258e37e3fd43a143bc974410e4cfc27f500e095f34a8956206e0ebf799b7287f0f38def0d5e34ed71c9",
 "size" : 12072532
 },
 {
-"version": "rustc 1.12.0 (3191fbae9 2016-09-23) repack",
-"size": 102403884,
-"digest": "a7c1512d955d3030bcc1ebddfbf512f7b11b66e31634726deab78d0403fc0ceadd603d32b08c1a5025d3e9ee4ff48ddcf5eaba33468bb2161cfb9fb1a557affa",
+"version": "rustc 1.13.0 (2c6933acc 2016-11-07) repack",
+"size": 68921028,
+"digest": "9a9ceccc02d4be445ffa64617683419a4f47990b1f2689980ac8db13d6369435ef4af1a3714d77377fb7b3b0ec213856ab7144ff22cbe0881d49aed44d82c0fc",
 "algorithm": "sha512",
 "filename": "rustc.tar.xz",
 "unpack": true
 },
 {
 "algorithm" : "sha512",
 "filename" : "sccache.tar.bz2",
 "unpack" : true,
--- a/b2g/dev/config/tooltool-manifests/linux64/releng.manifest
+++ b/b2g/dev/config/tooltool-manifests/linux64/releng.manifest
@@ -11,27 +11,27 @@
 "size": 12072532,
 "digest": "3915f8ec396c56a8a92e6f9695b70f09ce9d1582359d1258e37e3fd43a143bc974410e4cfc27f500e095f34a8956206e0ebf799b7287f0f38def0d5e34ed71c9",
 "algorithm": "sha512",
 "filename": "gtk3.tar.xz",
 "setup": "setup.sh",
 "unpack": true
 },
 {
-"version": "rustc 1.12.0 (3191fbae9 2016-09-23) repack",
-"size": 102403884,
-"digest": "a7c1512d955d3030bcc1ebddfbf512f7b11b66e31634726deab78d0403fc0ceadd603d32b08c1a5025d3e9ee4ff48ddcf5eaba33468bb2161cfb9fb1a557affa",
+"version": "rustc 1.13.0 (2c6933acc 2016-11-07) repack",
+"size": 68921028,
+"digest": "9a9ceccc02d4be445ffa64617683419a4f47990b1f2689980ac8db13d6369435ef4af1a3714d77377fb7b3b0ec213856ab7144ff22cbe0881d49aed44d82c0fc",
 "algorithm": "sha512",
 "filename": "rustc.tar.xz",
 "unpack": true
 },
 {
-"version": "cargo 0.13.0-nightly (e713e7f 2016-08-31)",
-"size": 3245716,
-"digest": "d5bb0d88ce7bb1b5a316d7a8ca6341672f5ee8008fa7754511bf53fabd54c0770e95397232896d6087547891f1143f6968d8b1e106e39800b43defeb0025c7c0",
+"version": "cargo 0.13.0-nightly (eca9e15 2016-11-01) repack",
+"size": 3027932,
+"digest": "a5c99eeb12b3b9b49632c259c762e34ec13cf72dadf90a0608b8ab1dc66b36cb114c5b45f71d326e12d31d9e88a41b029e6a728ca64cef392c0a8d211c2fe191",
 "algorithm": "sha512",
 "filename": "cargo.tar.xz",
 "unpack": true
 },
 {
 "size": 167175,
 "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1038,17 +1038,17 @@ pref("browser.taskbar.lists.enabled", tr
 pref("browser.taskbar.lists.frequent.enabled", true);
 pref("browser.taskbar.lists.recent.enabled", false);
 pref("browser.taskbar.lists.maxListItemCount", 7);
 pref("browser.taskbar.lists.tasks.enabled", true);
 pref("browser.taskbar.lists.refreshInSeconds", 120);
 #endif
 
 // The sync engines to use.
-pref("services.sync.registerEngines", "Bookmarks,Form,History,Password,Prefs,Tab,Addons");
+pref("services.sync.registerEngines", "Bookmarks,Form,History,Password,Prefs,Tab,Addons,ExtensionStorage");
 // Preferences to be synced by default
 pref("services.sync.prefs.sync.accessibility.blockautorefresh", true);
 pref("services.sync.prefs.sync.accessibility.browsewithcaret", true);
 pref("services.sync.prefs.sync.accessibility.typeaheadfind", true);
 pref("services.sync.prefs.sync.accessibility.typeaheadfind.linksonly", true);
 pref("services.sync.prefs.sync.addons.ignoreUserEnabledChanges", true);
 // The addons prefs related to repository verification are intentionally
 // not synced for security reasons. If a system is compromised, a user
@@ -1433,16 +1433,17 @@ pref("privacy.usercontext.about_newtab_s
 // us to change everybody to true in the future, when desired.
 pref("browser.tabs.remote.autostart.1", false);
 pref("browser.tabs.remote.autostart.2", true);
 #endif
 
 // For the about:tabcrashed page
 pref("browser.tabs.crashReporting.sendReport", true);
 pref("browser.tabs.crashReporting.includeURL", false);
+pref("browser.tabs.crashReporting.requestEmail", false);
 pref("browser.tabs.crashReporting.emailMe", false);
 pref("browser.tabs.crashReporting.email", "");
 
 // Enable e10s add-on interposition by default.
 pref("extensions.interposition.enabled", true);
 pref("extensions.interposition.prefetching", true);
 
 // Enable blocking of e10s for add-on users on beta/release.
--- a/browser/base/content/aboutTabCrashed.css
+++ b/browser/base/content/aboutTabCrashed.css
@@ -1,8 +1,11 @@
 /* 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/. */
 
 html:not(.crashDumpSubmitted) #reportSent,
-html:not(.crashDumpAvailable) #report-box {
+html:not(.crashDumpAvailable) #reportBox,
+.container[multiple="true"] > .offers > #offerHelpMessageSingle,
+.container[multiple="false"] > .offers > #offerHelpMessageMultiple,
+.container[multiple="false"] > .button-container > #restoreAll {
   display: none;
-}
+}
\ No newline at end of file
--- a/browser/base/content/aboutTabCrashed.js
+++ b/browser/base/content/aboutTabCrashed.js
@@ -57,17 +57,17 @@ var AboutTabCrashed = {
     addEventListener("DOMContentLoaded", this);
 
     document.title = this.pageData.title;
   },
 
   receiveMessage(message) {
     switch (message.name) {
       case "UpdateCount": {
-        this.showRestoreAll(message.data.count > 1);
+        this.setMultiple(message.data.count > 1);
         break;
       }
       case "SetCrashReportAvailable": {
         this.onSetCrashReportAvailable(message);
         break;
       }
       case "CrashReportSent": {
         this.onCrashReportSent();
@@ -146,48 +146,63 @@ var AboutTabCrashed = {
    * will respond with whether or not a crash report is available. This
    * method handles that message.
    *
    * @param message
    *        The message from the parent, which should contain a data
    *        Object property with the following properties:
    *
    *        hasReport (bool):
-   *          Whether or not there is a crash report
+   *          Whether or not there is a crash report.
    *
    *        sendReport (bool):
    *          Whether or not the the user prefers to send the report
-   *          by default
+   *          by default.
    *
    *        includeURL (bool):
    *          Whether or not the user prefers to send the URL of
    *          the tab that crashed.
    *
    *        emailMe (bool):
    *          Whether or not to send the email address of the user
    *          in the report.
    *
    *        email (String):
-   *          The email address of the user (empty if emailMe is false)
+   *          The email address of the user (empty if emailMe is false).
+   *
+   *        requestAutoSubmit (bool):
+   *          Whether or not we should ask the user to automatically
+   *          submit backlogged crash reports.
    *
    */
   onSetCrashReportAvailable(message) {
-    if (message.data.hasReport) {
+    let data = message.data;
+
+    if (data.hasReport) {
       this.hasReport = true;
       document.documentElement.classList.add("crashDumpAvailable");
 
-      let data = message.data;
       document.getElementById("sendReport").checked = data.sendReport;
       document.getElementById("includeURL").checked = data.includeURL;
-      document.getElementById("emailMe").checked = data.emailMe;
-      if (data.emailMe) {
-        document.getElementById("email").value = data.email;
+
+      if (data.requestEmail) {
+        document.getElementById("requestEmail").hidden = false;
+        document.getElementById("emailMe").checked = data.emailMe;
+        if (data.emailMe) {
+          document.getElementById("email").value = data.email;
+        }
       }
 
       this.showCrashReportUI(data.sendReport);
+    } else {
+      this.showCrashReportUI(false);
+    }
+
+    if (data.requestAutoSubmit) {
+      document.getElementById("requestAutoSubmit").hidden = false;
     }
 
     let event = new CustomEvent("AboutTabCrashedReady", {bubbles:true});
     document.dispatchEvent(event);
   },
 
   /**
    * Handler for when the parent reports that the crash report associated
@@ -200,34 +215,39 @@ var AboutTabCrashed = {
 
   /**
    * Toggles the display of the crash report form.
    *
    * @param shouldShow (bool)
    *        True if the crash report form should be shown
    */
   showCrashReportUI(shouldShow) {
-    let container = document.getElementById("crash-reporter-container");
-    container.hidden = !shouldShow;
+    let options = document.getElementById("options");
+    options.hidden = !shouldShow;
   },
 
   /**
-   * Toggles the display of the "Restore All" button.
+   * Toggles whether or not the page is one of several visible pages
+   * showing the crash reporter. This controls some of the language
+   * on the page, along with what the "primary" button is.
    *
-   * @param shouldShow (bool)
-   *        True if the "Restore All" button should be shown
+   * @param hasMultiple (bool)
+   *        True if there are multiple crash report pages being shown.
    */
-  showRestoreAll(shouldShow) {
-    let restoreAll = document.getElementById("restoreAll");
+  setMultiple(hasMultiple) {
+    let main = document.getElementById("main");
+    main.setAttribute("multiple", hasMultiple);
+
     let restoreTab = document.getElementById("restoreTab");
-    if (shouldShow) {
-      restoreAll.removeAttribute("hidden");
+
+    // The "Restore All" button has the "primary" class by default, so
+    // we only need to modify the "Restore Tab" button.
+    if (hasMultiple) {
       restoreTab.classList.remove("primary");
     } else {
-      restoreAll.setAttribute("hidden", true);
       restoreTab.classList.add("primary");
     }
   },
 
   /**
    * Sends a message to the parent in response to the user choosing
    * one of the actions available on the page. This might also send up
    * crash report information if the user has chosen to submit a crash
@@ -238,38 +258,51 @@ var AboutTabCrashed = {
    */
   sendMessage(messageName) {
     let comments = "";
     let email = "";
     let URL = "";
     let sendReport = false;
     let emailMe = false;
     let includeURL = false;
+    let autoSubmit = false;
 
     if (this.hasReport) {
       sendReport = document.getElementById("sendReport").checked;
       if (sendReport) {
         comments = document.getElementById("comments").value.trim();
 
         includeURL = document.getElementById("includeURL").checked;
         if (includeURL) {
           URL = this.pageData.URL.trim();
         }
 
-        emailMe = document.getElementById("emailMe").checked;
-        if (emailMe) {
-          email = document.getElementById("email").value.trim();
+        if (!document.getElementById("requestEmail").hidden) {
+          emailMe = document.getElementById("emailMe").checked;
+          if (emailMe) {
+            email = document.getElementById("email").value.trim();
+          }
         }
       }
     }
 
+    let requestAutoSubmit = document.getElementById("requestAutoSubmit");
+    if (requestAutoSubmit.hidden) {
+      // The checkbox is hidden if the user has already opted in to sending
+      // backlogged crash reports.
+      autoSubmit = true;
+    } else {
+      autoSubmit = document.getElementById("autoSubmit").checked;
+    }
+
     sendAsyncMessage(messageName, {
       sendReport,
       comments,
       email,
       emailMe,
       includeURL,
       URL,
+      autoSubmit,
     });
   },
 };
 
 AboutTabCrashed.init();
--- a/browser/base/content/aboutTabCrashed.xhtml
+++ b/browser/base/content/aboutTabCrashed.xhtml
@@ -25,47 +25,73 @@
           href="chrome://global/skin/in-content/info-pages.css"/>
     <link rel="stylesheet" type="text/css" media="all"
           href="chrome://browser/content/aboutTabCrashed.css"/>
     <link rel="stylesheet" type="text/css" media="all"
           href="chrome://browser/skin/aboutTabCrashed.css"/>
   </head>
 
   <body dir="&locale.dir;">
-    <div class="container">
+    <div id="main" class="container" multiple="false">
+
       <div class="title">
-        <h1 class="title-text">&tabCrashed.header;</h1>
+        <h1 class="title-text">&tabCrashed.header2;</h1>
+      </div>
+
+      <div class="offers">
+        <h2>&tabCrashed.offerHelp;</h2>
+        <p id="offerHelpMessageSingle">&tabCrashed.single.offerHelpMessage;</p>
+        <p id="offerHelpMessageMultiple">&tabCrashed.multiple.offerHelpMessage;</p>
       </div>
-      <p>&tabCrashed.message;</p>
+
+      <div id="reportBox">
+        <h2>&tabCrashed.requestHelp;</h2>
+        <p>&tabCrashed.requestHelpMessage;</p>
+
+        <h2>&tabCrashed.requestReport;</h2>
+
+        <div class="checkbox-with-label">
+          <input type="checkbox" id="sendReport"/>
+          <label for="sendReport">&tabCrashed.sendReport2;</label>
+        </div>
 
-      <div id="report-box">
-        <input type="checkbox" id="sendReport"/>
-        <label for="sendReport">&tabCrashed.sendReport;</label>
-        <div id="crash-reporter-container" hidden="true">
-          <p id="crash-reporter-title">&tabCrashed.crashReporter;</p>
-          <textarea id="comments" placeholder="&tabCrashed.commentPlaceholder;" rows="4"></textarea>
+        <ul id="options">
+          <li>
+            <textarea id="comments" placeholder="&tabCrashed.commentPlaceholder2;" rows="4"></textarea>
+          </li>
+
+          <li class="checkbox-with-label">
+            <input type="checkbox" id="includeURL"/>
+            <label for="includeURL">&tabCrashed.includeURL2;</label>
+          </li>
 
-          <ul id="options">
-            <li><input type="checkbox" id="includeURL"/>
-            <label for="includeURL">&tabCrashed.includeURL;</label></li>
+          <li id="requestEmail" hidden="true">
+            <div class="checkbox-with-label">
+              <input type="checkbox" id="emailMe"/>
+              <label for="emailMe">&tabCrashed.emailMe;</label>
+            </div>
+            <input type="text" id="email" placeholder="&tabCrashed.emailPlaceholder;"/>
+          </li>
+        </ul>
 
-            <li><input type="checkbox" id="emailMe"/>
-            <label for="emailMe">&tabCrashed.emailMe;</label></li>
-          </ul>
-
-          <input type="text" id="email" placeholder="&tabCrashed.emailPlaceholder;"/>
+        <div id="requestAutoSubmit" hidden="true">
+          <h2>&tabCrashed.requestAutoSubmit;</h2>
+          <div class="checkbox-with-label">
+            <input type="checkbox" id="autoSubmit"/>
+            <label for="autoSubmit">&tabCrashed.autoSubmit;</label>
+          </div>
         </div>
       </div>
 
       <p id="reportSent">&tabCrashed.reportSent;</p>
 
       <div class="button-container">
         <button id="closeTab">
           &tabCrashed.closeTab;</button>
-        <button id="restoreTab">
+        <button id="restoreTab" class="primary">
           &tabCrashed.restoreTab;</button>
         <button id="restoreAll" autofocus="true" class="primary">
           &tabCrashed.restoreAll;</button>
       </div>
     </div>
   </body>
   <script type="text/javascript;version=1.8" src="chrome://browser/content/aboutTabCrashed.js"/>
 </html>
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -479,23 +479,15 @@ tags = psm
 [browser_mcb_redirect.js]
 tags = mcb
 [browser_windowactivation.js]
 [browser_contextmenu_childprocess.js]
 [browser_bug963945.js]
 [browser_domFullscreen_fullscreenMode.js]
 tags = fullscreen
 [browser_menuButtonBadgeManager.js]
-[browser_aboutTabCrashed.js]
-skip-if = !e10s || !crashreporter
-[browser_aboutTabCrashed_clearEmail.js]
-skip-if = !e10s || !crashreporter
 [browser_newTabDrop.js]
 [browser_newWindowDrop.js]
-[browser_aboutTabCrashed_showForm.js]
-skip-if = !e10s || !crashreporter
-[browser_aboutTabCrashed_withoutDump.js]
-skip-if = !e10s
 [browser_csp_block_all_mixedcontent.js]
 tags = mcb
 [browser_newwindow_focus.js]
 skip-if = (os == "linux" && !e10s) # Bug 1263254 - Perma fails on Linux without e10s for some reason.
 [browser_bug1299667.js]
--- a/browser/base/content/test/general/head.js
+++ b/browser/base/content/test/general/head.js
@@ -986,114 +986,16 @@ function promiseOnBookmarkItemAdded(aExp
         Ci.nsINavBookmarkObserver,
       ])
     };
     info("Waiting for a bookmark to be added");
     PlacesUtils.bookmarks.addObserver(bookmarksObserver, false);
   });
 }
 
-/**
- * For an nsIPropertyBag, returns the value for a given
- * key.
- *
- * @param bag
- *        The nsIPropertyBag to retrieve the value from
- * @param key
- *        The key that we want to get the value for from the
- *        bag
- * @returns The value corresponding to the key from the bag,
- *          or null if the value could not be retrieved (for
- *          example, if no value is set at that key).
-*/
-function getPropertyBagValue(bag, key) {
-  try {
-    let val = bag.getProperty(key);
-    return val;
-  } catch (e) {
-    if (e.result != Cr.NS_ERROR_FAILURE) {
-      throw e;
-    }
-  }
-
-  return null;
-}
-
-/**
- * Returns a Promise that resolves once a crash report has
- * been submitted. This function will also test the crash
- * reports extra data to see if it matches expectedExtra.
- *
- * @param expectedExtra (object)
- *        An Object whose key-value pairs will be compared
- *        against the key-value pairs in the extra data of the
- *        crash report. A test failure will occur if there is
- *        a mismatch.
- *
- *        If the value of the key-value pair is "null", this will
- *        be interpreted as "this key should not be included in the
- *        extra data", and will cause a test failure if it is detected
- *        in the crash report.
- *
- *        Note that this will ignore any keys that are not included
- *        in expectedExtra. It's possible that the crash report
- *        will contain other extra information that is not
- *        compared against.
- * @returns Promise
- */
-function promiseCrashReport(expectedExtra={}) {
-  return Task.spawn(function*() {
-    info("Starting wait on crash-report-status");
-    let [subject, ] =
-      yield TestUtils.topicObserved("crash-report-status", (unused, data) => {
-        return data == "success";
-      });
-    info("Topic observed!");
-
-    if (!(subject instanceof Ci.nsIPropertyBag2)) {
-      throw new Error("Subject was not a Ci.nsIPropertyBag2");
-    }
-
-    let remoteID = getPropertyBagValue(subject, "serverCrashID");
-    if (!remoteID) {
-      throw new Error("Report should have a server ID");
-    }
-
-    let file = Cc["@mozilla.org/file/local;1"]
-                 .createInstance(Ci.nsILocalFile);
-    file.initWithPath(Services.crashmanager._submittedDumpsDir);
-    file.append(remoteID + ".txt");
-    if (!file.exists()) {
-      throw new Error("Report should have been received by the server");
-    }
-
-    file.remove(false);
-
-    let extra = getPropertyBagValue(subject, "extra");
-    if (!(extra instanceof Ci.nsIPropertyBag2)) {
-      throw new Error("extra was not a Ci.nsIPropertyBag2");
-    }
-
-    info("Iterating crash report extra keys");
-    let enumerator = extra.enumerator;
-    while (enumerator.hasMoreElements()) {
-      let key = enumerator.getNext().QueryInterface(Ci.nsIProperty).name;
-      let value = extra.getPropertyAsAString(key);
-      if (key in expectedExtra) {
-        if (expectedExtra[key] == null) {
-          ok(false, `Got unexpected key ${key} with value ${value}`);
-        } else {
-          is(value, expectedExtra[key],
-             `Crash report had the right extra value for ${key}`);
-        }
-      }
-    }
-  });
-}
-
 function promiseErrorPageLoaded(browser) {
   return new Promise(resolve => {
     browser.addEventListener("DOMContentLoaded", function onLoad() {
       browser.removeEventListener("DOMContentLoaded", onLoad, false, true);
       resolve();
     }, false, true);
   });
 }
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabcrashed/browser.ini
@@ -0,0 +1,13 @@
+[DEFAULT]
+support-files =
+  head.js
+[browser_shown.js]
+skip-if = !e10s || !crashreporter
+[browser_clearEmail.js]
+skip-if = !e10s || !crashreporter
+[browser_showForm.js]
+skip-if = !e10s || !crashreporter
+[browser_withoutDump.js]
+skip-if = !e10s
+[browser_autoSubmitRequest.js]
+skip-if = !e10s || !crashreporter
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabcrashed/browser_autoSubmitRequest.js
@@ -0,0 +1,97 @@
+"use strict";
+
+const PAGE = "data:text/html,<html><body>A%20regular,%20everyday,%20normal%20page.";
+const AUTOSUBMIT_PREF = "browser.crashReports.unsubmittedCheck.autoSubmit";
+
+const {TabStateFlusher} =
+  Cu.import("resource:///modules/sessionstore/TabStateFlusher.jsm", {});
+
+// On debug builds, crashing tabs results in much thinking, which
+// slows down the test and results in intermittent test timeouts,
+// so we'll pump up the expected timeout for this test.
+requestLongerTimeout(2);
+
+/**
+ * Tests that if the user is not configured to autosubmit
+ * backlogged crash reports, that we offer to do that, and
+ * that the user can accept that offer.
+ */
+add_task(function* test_show_form() {
+  yield SpecialPowers.pushPrefEnv({
+    set: [[AUTOSUBMIT_PREF, false]],
+  })
+
+  return BrowserTestUtils.withNewTab({
+    gBrowser,
+    url: PAGE,
+  }, function*(browser) {
+    // Make sure we've flushed the browser messages so that
+    // we can restore it.
+    yield TabStateFlusher.flush(browser);
+
+    // Now crash the browser.
+    yield BrowserTestUtils.crashBrowser(browser);
+
+    let doc = browser.contentDocument;
+
+    // Ensure the request is visible. We can safely reach into
+    // the content since about:tabcrashed is an in-process URL.
+    let requestAutoSubmit = doc.getElementById("requestAutoSubmit");
+    Assert.ok(!requestAutoSubmit.hidden,
+              "Request for autosubmission is visible.");
+
+    // Since the pref is set to false, the checkbox should be
+    // unchecked.
+    let autoSubmit = doc.getElementById("autoSubmit");
+    Assert.ok(!autoSubmit.checked,
+              "Checkbox for autosubmission is not checked.")
+
+    // Check the checkbox, and then restore the tab.
+    autoSubmit.checked = true;
+    let restoreButton = doc.getElementById("restoreTab");
+    restoreButton.click();
+
+    yield BrowserTestUtils.browserLoaded(browser, false, PAGE);
+
+    // The autosubmission pref should now be set.
+    Assert.ok(Services.prefs.getBoolPref(AUTOSUBMIT_PREF),
+              "Autosubmission pref should have been set.");
+  });
+});
+
+/**
+ * Tests that if the user is autosubmitting backlogged crash reports
+ * that we don't make the offer again.
+ */
+add_task(function* test_show_form() {
+  yield SpecialPowers.pushPrefEnv({
+    set: [[AUTOSUBMIT_PREF, true]],
+  })
+
+  return BrowserTestUtils.withNewTab({
+    gBrowser,
+    url: PAGE,
+  }, function*(browser) {
+    yield TabStateFlusher.flush(browser);
+    // Now crash the browser.
+    yield BrowserTestUtils.crashBrowser(browser);
+
+    let doc = browser.contentDocument;
+
+    // Ensure the request is NOT visible. We can safely reach into
+    // the content since about:tabcrashed is an in-process URL.
+    let requestAutoSubmit = doc.getElementById("requestAutoSubmit");
+    Assert.ok(requestAutoSubmit.hidden,
+              "Request for autosubmission is not visible.");
+
+    // Restore the tab.
+    let restoreButton = doc.getElementById("restoreTab");
+    restoreButton.click();
+
+    yield BrowserTestUtils.browserLoaded(browser, false, PAGE);
+
+    // The autosubmission pref should still be set to true.
+    Assert.ok(Services.prefs.getBoolPref(AUTOSUBMIT_PREF),
+              "Autosubmission pref should have been set.");
+  });
+});
rename from browser/base/content/test/general/browser_aboutTabCrashed_clearEmail.js
rename to browser/base/content/test/tabcrashed/browser_clearEmail.js
--- a/browser/base/content/test/general/browser_aboutTabCrashed_clearEmail.js
+++ b/browser/base/content/test/tabcrashed/browser_clearEmail.js
@@ -16,16 +16,22 @@ add_task(function* setup() {
   // which CrashSubmit.jsm uses as a server override.
   let env = Cc["@mozilla.org/process/environment;1"]
               .getService(Components.interfaces.nsIEnvironment);
   let noReport = env.get("MOZ_CRASHREPORTER_NO_REPORT");
   let serverUrl = env.get("MOZ_CRASHREPORTER_URL");
   env.set("MOZ_CRASHREPORTER_NO_REPORT", "");
   env.set("MOZ_CRASHREPORTER_URL", SERVER_URL);
 
+  // By default, requesting the email address of the user is disabled.
+  // For the purposes of this test, we turn it back on.
+  yield SpecialPowers.pushPrefEnv({
+    set: [["browser.tabs.crashReporting.requestEmail", true]],
+  });
+
   registerCleanupFunction(function() {
     env.set("MOZ_CRASHREPORTER_NO_REPORT", noReport);
     env.set("MOZ_CRASHREPORTER_URL", serverUrl);
   });
 });
 
 /**
  * Test that if we have an email address stored in prefs, and we decide
rename from browser/base/content/test/general/browser_aboutTabCrashed_showForm.js
rename to browser/base/content/test/tabcrashed/browser_showForm.js
--- a/browser/base/content/test/general/browser_aboutTabCrashed_showForm.js
+++ b/browser/base/content/test/tabcrashed/browser_showForm.js
@@ -14,25 +14,27 @@ requestLongerTimeout(2);
 add_task(function* test_show_form() {
   return BrowserTestUtils.withNewTab({
     gBrowser,
     url: PAGE,
   }, function*(browser) {
     // Flip the pref so that the checkbox should be checked
     // by default.
     let pref = TabCrashHandler.prefs.root + "sendReport";
-    yield pushPrefs([pref, true]);
+    yield SpecialPowers.pushPrefEnv({
+      set: [[pref, true]]
+    });
 
     // Now crash the browser.
     yield BrowserTestUtils.crashBrowser(browser);
 
     let doc = browser.contentDocument;
 
     // Ensure the checkbox is checked. We can safely reach into
     // the content since about:tabcrashed is an in-process URL.
     let checkbox = doc.getElementById("sendReport");
     ok(checkbox.checked, "Send report checkbox is checked.");
 
-    // Ensure the form is displayed.
-    let container = doc.getElementById("crash-reporter-container");
-    ok(!container.hidden, "Showing the crash report detail form.");
+    // Ensure the options form is displayed.
+    let options = doc.getElementById("options");
+    ok(!options.hidden, "Showing the crash report options form.");
   });
 });
rename from browser/base/content/test/general/browser_aboutTabCrashed.js
rename to browser/base/content/test/tabcrashed/browser_shown.js
rename from browser/base/content/test/general/browser_aboutTabCrashed_withoutDump.js
rename to browser/base/content/test/tabcrashed/browser_withoutDump.js
--- a/browser/base/content/test/general/browser_aboutTabCrashed_withoutDump.js
+++ b/browser/base/content/test/tabcrashed/browser_withoutDump.js
@@ -27,18 +27,18 @@ add_task(function* test_without_dump() {
 
     let tabRemovedPromise = BrowserTestUtils.removeTab(tab, { dontRemove: true });
 
     yield ContentTask.spawn(browser, null, function*() {
       let doc = content.document;
       Assert.ok(!doc.documentElement.classList.contains("crashDumpAvailable"),
          "doesn't have crash dump");
 
-      let container = doc.getElementById("crash-reporter-container");
-      Assert.ok(container, "has crash-reporter-container");
-      Assert.ok(container.hidden, "crash-reporter-container is hidden");
+      let options = doc.getElementById("options");
+      Assert.ok(options, "has crash report options");
+      Assert.ok(options.hidden, "crash report options are hidden");
 
       doc.getElementById("closeTab").click();
     });
 
     yield tabRemovedPromise;
   });
 });
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabcrashed/head.js
@@ -0,0 +1,98 @@
+/**
+ * Returns a Promise that resolves once a crash report has
+ * been submitted. This function will also test the crash
+ * reports extra data to see if it matches expectedExtra.
+ *
+ * @param expectedExtra (object)
+ *        An Object whose key-value pairs will be compared
+ *        against the key-value pairs in the extra data of the
+ *        crash report. A test failure will occur if there is
+ *        a mismatch.
+ *
+ *        If the value of the key-value pair is "null", this will
+ *        be interpreted as "this key should not be included in the
+ *        extra data", and will cause a test failure if it is detected
+ *        in the crash report.
+ *
+ *        Note that this will ignore any keys that are not included
+ *        in expectedExtra. It's possible that the crash report
+ *        will contain other extra information that is not
+ *        compared against.
+ * @returns Promise
+ */
+function promiseCrashReport(expectedExtra={}) {
+  return Task.spawn(function*() {
+    info("Starting wait on crash-report-status");
+    let [subject, ] =
+      yield TestUtils.topicObserved("crash-report-status", (unused, data) => {
+        return data == "success";
+      });
+    info("Topic observed!");
+
+    if (!(subject instanceof Ci.nsIPropertyBag2)) {
+      throw new Error("Subject was not a Ci.nsIPropertyBag2");
+    }
+
+    let remoteID = getPropertyBagValue(subject, "serverCrashID");
+    if (!remoteID) {
+      throw new Error("Report should have a server ID");
+    }
+
+    let file = Cc["@mozilla.org/file/local;1"]
+                 .createInstance(Ci.nsILocalFile);
+    file.initWithPath(Services.crashmanager._submittedDumpsDir);
+    file.append(remoteID + ".txt");
+    if (!file.exists()) {
+      throw new Error("Report should have been received by the server");
+    }
+
+    file.remove(false);
+
+    let extra = getPropertyBagValue(subject, "extra");
+    if (!(extra instanceof Ci.nsIPropertyBag2)) {
+      throw new Error("extra was not a Ci.nsIPropertyBag2");
+    }
+
+    info("Iterating crash report extra keys");
+    let enumerator = extra.enumerator;
+    while (enumerator.hasMoreElements()) {
+      let key = enumerator.getNext().QueryInterface(Ci.nsIProperty).name;
+      let value = extra.getPropertyAsAString(key);
+      if (key in expectedExtra) {
+        if (expectedExtra[key] == null) {
+          ok(false, `Got unexpected key ${key} with value ${value}`);
+        } else {
+          is(value, expectedExtra[key],
+             `Crash report had the right extra value for ${key}`);
+        }
+      }
+    }
+  });
+}
+
+
+/**
+ * For an nsIPropertyBag, returns the value for a given
+ * key.
+ *
+ * @param bag
+ *        The nsIPropertyBag to retrieve the value from
+ * @param key
+ *        The key that we want to get the value for from the
+ *        bag
+ * @returns The value corresponding to the key from the bag,
+ *          or null if the value could not be retrieved (for
+ *          example, if no value is set at that key).
+*/
+function getPropertyBagValue(bag, key) {
+  try {
+    let val = bag.getProperty(key);
+    return val;
+  } catch (e) {
+    if (e.result != Cr.NS_ERROR_FAILURE) {
+      throw e;
+    }
+  }
+
+  return null;
+}
--- a/browser/base/moz.build
+++ b/browser/base/moz.build
@@ -17,16 +17,17 @@ MOCHITEST_CHROME_MANIFESTS += [
 BROWSER_CHROME_MANIFESTS += [
     'content/test/alerts/browser.ini',
     'content/test/general/browser.ini',
     'content/test/newtab/browser.ini',
     'content/test/plugins/browser.ini',
     'content/test/popupNotifications/browser.ini',
     'content/test/referrer/browser.ini',
     'content/test/social/browser.ini',
+    'content/test/tabcrashed/browser.ini',
     'content/test/tabPrompts/browser.ini',
     'content/test/tabs/browser.ini',
     'content/test/urlbar/browser.ini',
     'content/test/webrtc/browser.ini',
 ]
 
 DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
 DEFINES['MOZ_APP_VERSION_DISPLAY'] = CONFIG['MOZ_APP_VERSION_DISPLAY']
--- a/browser/components/sessionstore/test/browser_crashedTabs.js
+++ b/browser/components/sessionstore/test/browser_crashedTabs.js
@@ -387,17 +387,18 @@ add_task(function* test_hide_restore_all
 
   // Crash the tab
   yield BrowserTestUtils.crashBrowser(browser);
 
   let doc = browser.contentDocument;
   let restoreAllButton = doc.getElementById("restoreAll");
   let restoreOneButton = doc.getElementById("restoreTab");
 
-  is(restoreAllButton.getAttribute("hidden"), "true", "Restore All button should be hidden");
+  let restoreAllStyles = window.getComputedStyle(restoreAllButton);
+  is(restoreAllStyles.display, "none", "Restore All button should be hidden");
   ok(restoreOneButton.classList.contains("primary"), "Restore Tab button should have the primary class");
 
   let newTab2 = gBrowser.addTab();
   gBrowser.selectedTab = newTab;
 
   browser.loadURI(PAGE_2);
   yield promiseBrowserLoaded(browser);
 
@@ -416,17 +417,18 @@ add_task(function* test_hide_restore_all
   // Crash the first tab.
   yield BrowserTestUtils.crashBrowser(browser);
   yield otherBrowserReady;
 
   doc = browser.contentDocument;
   restoreAllButton = doc.getElementById("restoreAll");
   restoreOneButton = doc.getElementById("restoreTab");
 
-  ok(!restoreAllButton.hasAttribute("hidden"), "Restore All button should not be hidden");
+  restoreAllStyles = window.getComputedStyle(restoreAllButton);
+  isnot(restoreAllStyles.display, "none", "Restore All button should not be hidden");
   ok(!(restoreOneButton.classList.contains("primary")), "Restore Tab button should not have the primary class");
 
   yield BrowserTestUtils.closeWindow(win2);
   gBrowser.removeTab(newTab);
   gBrowser.removeTab(newTab2);
 });
 
 add_task(function* test_aboutcrashedtabzoom() {
--- a/browser/config/tooltool-manifests/linux32/releng.manifest
+++ b/browser/config/tooltool-manifests/linux32/releng.manifest
@@ -11,27 +11,27 @@
 "size": 11189216,
 "digest": "18bc52b0599b1308b667e282abb45f47597bfc98a5140cfcab8da71dacf89dd76d0dee22a04ce26fe7ad1f04e2d6596991f9e5b01fd2aaaab5542965f596b0e6",
 "algorithm": "sha512",
 "filename": "gtk3.tar.xz",
 "setup": "setup.sh",
 "unpack": true
 },
 {
-"version": "rustc 1.12.0 (3191fbae9 2016-09-23) repack x86_64+i586",
-"size": 102403884,
-"digest": "a7c1512d955d3030bcc1ebddfbf512f7b11b66e31634726deab78d0403fc0ceadd603d32b08c1a5025d3e9ee4ff48ddcf5eaba33468bb2161cfb9fb1a557affa",
+"version": "rustc 1.13.0 (2c6933acc 2016-11-07) repack x86_64+i586",
+"size": 68921028,
+"digest": "9a9ceccc02d4be445ffa64617683419a4f47990b1f2689980ac8db13d6369435ef4af1a3714d77377fb7b3b0ec213856ab7144ff22cbe0881d49aed44d82c0fc",
 "algorithm": "sha512",
 "filename": "rustc.tar.xz",
 "unpack": true
 },
 {
-"version": "cargo 0.13.0-nightly (e713e7f 2016-08-31)",
-"size": 3245716,
-"digest": "d5bb0d88ce7bb1b5a316d7a8ca6341672f5ee8008fa7754511bf53fabd54c0770e95397232896d6087547891f1143f6968d8b1e106e39800b43defeb0025c7c0",
+"version": "cargo 0.13.0-nightly (eca9e15 2016-11-01) repack",
+"size": 3027932,
+"digest": "a5c99eeb12b3b9b49632c259c762e34ec13cf72dadf90a0608b8ab1dc66b36cb114c5b45f71d326e12d31d9e88a41b029e6a728ca64cef392c0a8d211c2fe191",
 "algorithm": "sha512",
 "filename": "cargo.tar.xz",
 "unpack": true
 },
 {
 "size": 167175,
 "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
--- a/browser/config/tooltool-manifests/linux64/hazard.manifest
+++ b/browser/config/tooltool-manifests/linux64/hazard.manifest
@@ -19,19 +19,19 @@
 "digest" : "3915f8ec396c56a8a92e6f9695b70f09ce9d1582359d1258e37e3fd43a143bc974410e4cfc27f500e095f34a8956206e0ebf799b7287f0f38def0d5e34ed71c9",
 "unpack" : true,
 "setup" : "setup.sh",
 "algorithm" : "sha512",
 "filename" : "gtk3.tar.xz",
 "size" : 12072532
 },
 {
-"version": "rustc 1.12.0 (3191fbae9 2016-09-23) repack",
-"size": 102403884,
-"digest": "a7c1512d955d3030bcc1ebddfbf512f7b11b66e31634726deab78d0403fc0ceadd603d32b08c1a5025d3e9ee4ff48ddcf5eaba33468bb2161cfb9fb1a557affa",
+"version": "rustc 1.13.0 (2c6933acc 2016-11-07) repack",
+"size": 68921028,
+"digest": "9a9ceccc02d4be445ffa64617683419a4f47990b1f2689980ac8db13d6369435ef4af1a3714d77377fb7b3b0ec213856ab7144ff22cbe0881d49aed44d82c0fc",
 "algorithm": "sha512",
 "filename": "rustc.tar.xz",
 "unpack": true
 },
 {
 "filename" : "sccache.tar.bz2",
 "algorithm" : "sha512",
 "digest" : "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
--- a/browser/config/tooltool-manifests/linux64/releng.manifest
+++ b/browser/config/tooltool-manifests/linux64/releng.manifest
@@ -11,27 +11,27 @@
 "size": 12072532,
 "digest": "3915f8ec396c56a8a92e6f9695b70f09ce9d1582359d1258e37e3fd43a143bc974410e4cfc27f500e095f34a8956206e0ebf799b7287f0f38def0d5e34ed71c9",
 "algorithm": "sha512",
 "filename": "gtk3.tar.xz",
 "setup": "setup.sh",
 "unpack": true
 },
 {
-"version": "rustc 1.12.0 (3191fbae9 2016-09-23) repack",
-"size": 102403884,
-"digest": "a7c1512d955d3030bcc1ebddfbf512f7b11b66e31634726deab78d0403fc0ceadd603d32b08c1a5025d3e9ee4ff48ddcf5eaba33468bb2161cfb9fb1a557affa",
+"version": "rustc 1.13.0 (2c6933acc 2016-11-07) repack",
+"size": 68921028,
+"digest": "9a9ceccc02d4be445ffa64617683419a4f47990b1f2689980ac8db13d6369435ef4af1a3714d77377fb7b3b0ec213856ab7144ff22cbe0881d49aed44d82c0fc",
 "algorithm": "sha512",
 "filename": "rustc.tar.xz",
 "unpack": true
 },
 {
-"version": "cargo 0.13.0-nightly (e713e7f 2016-08-31)",
-"size": 3245716,
-"digest": "d5bb0d88ce7bb1b5a316d7a8ca6341672f5ee8008fa7754511bf53fabd54c0770e95397232896d6087547891f1143f6968d8b1e106e39800b43defeb0025c7c0",
+"version": "cargo 0.13.0-nightly (eca9e15 2016-11-01) repack",
+"size": 3027932,
+"digest": "a5c99eeb12b3b9b49632c259c762e34ec13cf72dadf90a0608b8ab1dc66b36cb114c5b45f71d326e12d31d9e88a41b029e6a728ca64cef392c0a8d211c2fe191",
 "algorithm": "sha512",
 "filename": "cargo.tar.xz",
 "unpack": true
 },
 {
 "size": 167175,
 "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
--- a/browser/config/tooltool-manifests/macosx64/cross-releng.manifest
+++ b/browser/config/tooltool-manifests/macosx64/cross-releng.manifest
@@ -19,19 +19,19 @@
 "size": 35215976, 
 "visibility": "internal", 
 "digest": "8be736545ddab25ebded188458ce974d5c9a7e29f3c50d2ebfbcb878f6aff853dd2ff5a3528bdefc64396a10101a1b50fd2fe52000140df33643cebe1ea759da", 
 "algorithm": "sha512", 
 "unpack": true,
 "filename": "MacOSX10.7.sdk.tar.bz2"
 },
 {
-"version": "cargo 0.13.0-nightly (e713e7f 2016-08-31)",
-"size": 3245716,
-"digest": "d5bb0d88ce7bb1b5a316d7a8ca6341672f5ee8008fa7754511bf53fabd54c0770e95397232896d6087547891f1143f6968d8b1e106e39800b43defeb0025c7c0",
+"version": "cargo 0.13.0-nightly (eca9e15 2016-11-01) repack",
+"size": 3027932,
+"digest": "a5c99eeb12b3b9b49632c259c762e34ec13cf72dadf90a0608b8ab1dc66b36cb114c5b45f71d326e12d31d9e88a41b029e6a728ca64cef392c0a8d211c2fe191",
 "algorithm": "sha512",
 "filename": "cargo.tar.xz",
 "unpack": true
 },
 {
 "size": 167175,
 "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
@@ -50,16 +50,16 @@
 "size": 188880, 
 "visibility": "public", 
 "digest": "1ffddd43efb03aed897ee42035d9d8d758a8d66ab6c867599ef755e1a586768fc22011ce03698af61454920b00fe8bed08c9a681e7bd324d7f8f78c026c83943", 
 "algorithm": "sha512", 
 "unpack": true,
 "filename": "genisoimage.tar.xz"
 },
 {
-"version": "rustc 1.12.0 (3191fbae9 2016-09-23) repack",
-"size": 179757256,
-"digest": "26bbd6a34beab36620634f7eafe63281e3398ae4673b3a4d49e1da4eae0467bc6efc2471ef842682db527ad137e702b74c68f278025c60c8bb69d244cff1e6b6",
+"version": "rustc 1.13.0 (2c6933acc 2016-11-07) repack",
+"size": 119642844,
+"digest": "b219c07d78819b9ea930024205ac905f89b958948fbfb3146864724bf4994401911fdb1636d6f32e46de1f587f4ee9ae7975a886bfacc5f0bde8ea5955b4e42a",
 "algorithm": "sha512",
 "filename": "rustc.tar.xz",
 "unpack": true
 }
 ]
--- a/browser/config/tooltool-manifests/macosx64/releng.manifest
+++ b/browser/config/tooltool-manifests/macosx64/releng.manifest
@@ -3,27 +3,27 @@
 "version": "clang 3.8.0",
 "size": 133060926,
 "digest": "aff5ad3ac2d41db19d1ba0df5f97b189a7d7e1b6af8c56e22c2b0cced84d75fa98394ded6a4ba5713652e6684a0a46f47aeccf87991f9e849bf8d7d82e564f6f",
 "algorithm": "sha512",
 "filename": "clang.tar.bz2",
 "unpack": true
 },
 {
-"version": "rustc 1.12.0 (3191fbae9 2016-09-23) repack",
-"size": 152905062,
-"digest": "1fb64d68ad41e5ca444a5a91f752efec154957d22bdf078adbc7b6a1cdbeefbadbc618de96cc46540a33849d43ac95a520a463d4f852e1a5a1f636d7079d969f",
+"version": "rustc 1.13.0 (2c6933acc 2016-11-07) repack",
+"size": 104593379,
+"digest": "9cbc4a6d4d647dd79629e97c0e7b177443d30e669ccd761ab520728d8c2b7e1cc4ab38ec444c1957649338c4088861db3bfe4f840ec3fedcc01f9f1a74da200a",
 "algorithm": "sha512",
 "filename": "rustc.tar.bz2",
 "unpack": true
 },
 {
-"version": "cargo 0.13.0-nightly (e713e7f 2016-08-31)",
-"size": 2715131,
-"digest": "f037d2bbbeccb2c95519e083d6d9eecb5cb06a510e849b5721d6933a6c2428203b93ed3d20d3f20329f4d4eee17177d762f051b1ae79fee97d93b84611f3df66",
+"version": "cargo 0.13.0-nightly (eca9e15 2016-11-01) repack",
+"size": 2351877,
+"digest": "76283ceda49015f66b03d18b3c28f70ed4baa09accdfc17b2ec935c7af3e9471d140256a33737563baa2545c34e556a125ade6d4858b9226b8c770dbd7c0756f",
 "algorithm": "sha512",
 "filename": "cargo.tar.bz2",
 "unpack": true
 },
 {
 "version": "cctools port from commit hash db1f8d906cb28, ld only",
 "size": 634496,
 "digest": "037f31fcf29e7bb7fada0d2bdd5e95c7d4cb2692f2a5c98ed6f6a7561b9d81622d015f0d12b291d3667719655f1369e8ce8a0a4a4773aa0ee4753e04a8821173",
--- a/browser/config/tooltool-manifests/win32/build-clang-cl.manifest
+++ b/browser/config/tooltool-manifests/win32/build-clang-cl.manifest
@@ -1,27 +1,27 @@
 [
 {
 "size": 266240,
 "digest": "bb345b0e700ffab4d09436981f14b5de84da55a3f18a7f09ebc4364a4488acdeab8d46f447b12ac70f2da1444a68b8ce8b8675f0dae2ccf845e966d1df0f0869",
 "algorithm": "sha512",
 "filename": "mozmake.exe"
 },
 {
-"version": "rustc 1.12.0 (3191fbae9 2016-09-23) repack",
-"size": 89434100,
-"digest": "4da0efd2c36c77f29846f328d9f3c095a7b7e0dfd94f76b3159d441aae02b25007a475a979fb5bf313cf8fecb22fec81684871809effcb6b514419bc3854f398",
+"version": "rustc 1.13.0 (2c6933acc 2016-11-07) repack",
+"size": 58997576,
+"digest": "be97bb7f60fea39b9b0411b7ce247036a9373b01ed8cc60f30ed3c6254473ab7ef1881f222f10845253e0608c6f3d21add0871d0485d9de413297906d5c5409c",
 "algorithm": "sha512",
 "filename": "rustc.tar.bz2",
 "unpack": true
 },
 {
-"version": "cargo 0.13.0-nightly (e713e7f 2016-08-31)",
-"size": 2402000,
-"digest": "56f12f7ac437742ed717ce0ccfb0b4134160948e45d73016e48d9033567e5b01a171ac95dd7965eb007702c31da73274b5913281655f461f611ddeee37181ecc",
+"version": "cargo 0.13.0-nightly (eca9e15 2016-11-01) repack",
+"size": 2214397,
+"digest": "4f378fc4178d72d9e0434fca3df342d9dd7619c7c524ec6aedeee78a19583f2a675dfc54224be87030d72a36cef77f997e5275fe1cebac065c38949fa464d842",
 "algorithm": "sha512",
 "filename": "cargo.tar.bz2",
 "unpack": true
 },
 {
 "size": 167175,
 "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
--- a/browser/config/tooltool-manifests/win32/clang.manifest
+++ b/browser/config/tooltool-manifests/win32/clang.manifest
@@ -1,19 +1,19 @@
 [
 {
 "size": 266240,
 "digest": "bb345b0e700ffab4d09436981f14b5de84da55a3f18a7f09ebc4364a4488acdeab8d46f447b12ac70f2da1444a68b8ce8b8675f0dae2ccf845e966d1df0f0869",
 "algorithm": "sha512",
 "filename": "mozmake.exe"
 },
 {
-"version": "rustc 1.12.0 (3191fbae9 2016-09-23) repack",
-"size": 89434100,
-"digest": "4da0efd2c36c77f29846f328d9f3c095a7b7e0dfd94f76b3159d441aae02b25007a475a979fb5bf313cf8fecb22fec81684871809effcb6b514419bc3854f398",
+"version": "rustc 1.13.0 (2c6933acc 2016-11-07) repack",
+"size": 58997576,
+"digest": "be97bb7f60fea39b9b0411b7ce247036a9373b01ed8cc60f30ed3c6254473ab7ef1881f222f10845253e0608c6f3d21add0871d0485d9de413297906d5c5409c",
 "algorithm": "sha512",
 "filename": "rustc.tar.bz2",
 "unpack": true
 },
 {
 "size": 167175,
 "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
--- a/browser/config/tooltool-manifests/win32/releng.manifest
+++ b/browser/config/tooltool-manifests/win32/releng.manifest
@@ -1,27 +1,27 @@
 [
 {
 "size": 266240,
 "digest": "bb345b0e700ffab4d09436981f14b5de84da55a3f18a7f09ebc4364a4488acdeab8d46f447b12ac70f2da1444a68b8ce8b8675f0dae2ccf845e966d1df0f0869",
 "algorithm": "sha512",
 "filename": "mozmake.exe"
 },
 {
-"version": "rustc 1.12.0 (3191fbae9 2016-09-23) repack",
-"size": 89434100,
-"digest": "4da0efd2c36c77f29846f328d9f3c095a7b7e0dfd94f76b3159d441aae02b25007a475a979fb5bf313cf8fecb22fec81684871809effcb6b514419bc3854f398",
+"version": "rustc 1.13.0 (2c6933acc 2016-11-07) repack",
+"size": 58997576,
+"digest": "be97bb7f60fea39b9b0411b7ce247036a9373b01ed8cc60f30ed3c6254473ab7ef1881f222f10845253e0608c6f3d21add0871d0485d9de413297906d5c5409c",
 "algorithm": "sha512",
 "filename": "rustc.tar.bz2",
 "unpack": true
 },
 {
-"version": "cargo 0.13.0-nightly (e713e7f 2016-08-31)",
-"size": 2402000,
-"digest": "56f12f7ac437742ed717ce0ccfb0b4134160948e45d73016e48d9033567e5b01a171ac95dd7965eb007702c31da73274b5913281655f461f611ddeee37181ecc",
+"version": "cargo 0.13.0-nightly (eca9e15 2016-11-01) repack",
+"size": 2214397,
+"digest": "4f378fc4178d72d9e0434fca3df342d9dd7619c7c524ec6aedeee78a19583f2a675dfc54224be87030d72a36cef77f997e5275fe1cebac065c38949fa464d842",
 "algorithm": "sha512",
 "filename": "cargo.tar.bz2",
 "unpack": true
 },
 {
 "size": 167175,
 "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
--- a/browser/config/tooltool-manifests/win64/clang.manifest
+++ b/browser/config/tooltool-manifests/win64/clang.manifest
@@ -1,19 +1,19 @@
 [
 {
 "size": 266240,
 "digest": "bb345b0e700ffab4d09436981f14b5de84da55a3f18a7f09ebc4364a4488acdeab8d46f447b12ac70f2da1444a68b8ce8b8675f0dae2ccf845e966d1df0f0869",
 "algorithm": "sha512",
 "filename": "mozmake.exe"
 },
 {
-"version": "rustc 1.12.0 (3191fbae9 2016-09-23) repack",
-"size": 94812923,
-"digest": "f8ff01a44caf38711c352e49c06e8ef6bbac7836bed1050bb043f89ba70f70a11c88001f453baec0cbc56a013efb0fd6b16d612923d07e29b5d8d4512dbaab07",
+"version": "rustc 1.13.0 (2c6933acc 2016-11-07) repack",
+"size": 63966131,
+"digest": "a431492ca5ae3454e7d5de3962ff0b40d96f69a9046428a1fe310397a5dda9ba2f6b697958e8386b119d56b700563ffe1b58c63f84b527b2df320893306854cf",
 "algorithm": "sha512",
 "visibility": "public",
 "filename": "rustc.tar.bz2",
 "unpack": true
 },
 {
 "size": 167175,
 "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
--- a/browser/config/tooltool-manifests/win64/releng.manifest
+++ b/browser/config/tooltool-manifests/win64/releng.manifest
@@ -1,28 +1,28 @@
 [
 {
 "size": 266240,
 "digest": "bb345b0e700ffab4d09436981f14b5de84da55a3f18a7f09ebc4364a4488acdeab8d46f447b12ac70f2da1444a68b8ce8b8675f0dae2ccf845e966d1df0f0869",
 "algorithm": "sha512",
 "filename": "mozmake.exe"
 },
 {
-"version": "rustc 1.12.0 (3191fbae9 2016-09-23) repack",
-"size": 94812923,
-"digest": "f8ff01a44caf38711c352e49c06e8ef6bbac7836bed1050bb043f89ba70f70a11c88001f453baec0cbc56a013efb0fd6b16d612923d07e29b5d8d4512dbaab07",
+"version": "rustc 1.13.0 (2c6933acc 2016-11-07) repack",
+"size": 63966131,
+"digest": "a431492ca5ae3454e7d5de3962ff0b40d96f69a9046428a1fe310397a5dda9ba2f6b697958e8386b119d56b700563ffe1b58c63f84b527b2df320893306854cf",
 "algorithm": "sha512",
 "visibility": "public",
 "filename": "rustc.tar.bz2",
 "unpack": true
 },
 {
-"version": "cargo 0.13.0-nightly (e713e7f 2016-08-31)",
-"size": 2677831,
-"digest": "eada1edd6142dcde907f14f23c08a2a0b86f108a8fb242f62be6573bbbe1d3b2a4a04c05465d561253d6a617e18cdabee3c87d8cef9a1b5bdd20fe835ef25ff1",
+"version": "cargo 0.13.0-nightly (eca9e15 2016-11-01) repack",
+"size": 2466539,
+"digest": "78b129bd5c933d77c1f09a24c57a652c7cf228fc986000c162f892a46a53fc0f56b8fe1ac924c7e5aaefc4728fd07b679fbf149feb4ed5f2f30c4fd2f776ab7e",
 "algorithm": "sha512",
 "filename": "cargo.tar.bz2",
 "unpack": true
 },
 {
 "size": 167175,
 "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
--- a/browser/locales/en-US/chrome/browser/aboutTabCrashed.dtd
+++ b/browser/locales/en-US/chrome/browser/aboutTabCrashed.dtd
@@ -1,16 +1,30 @@
 <!-- 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/. -->
 
-<!ENTITY tabCrashed.header "Bad news first: This tab has crashed">
-<!ENTITY tabCrashed.message "Now for the good news: You can just close this tab, restore it or restore all your crashed tabs.">
-<!ENTITY tabCrashed.sendReport "Submit a crash report to help prevent more bad news">
-<!ENTITY tabCrashed.includeURL "Include the address of the page I was on">
-<!ENTITY tabCrashed.commentPlaceholder "Add a comment (comments are publicly visible)">
-<!ENTITY tabCrashed.emailPlaceholder "Enter your email address here">
-<!ENTITY tabCrashed.emailMe "Email me when more information is available">
-<!ENTITY tabCrashed.crashReporter "Mozilla Crash Reporter">
-<!ENTITY tabCrashed.reportSent "Crash report already submitted; thank you for helping make &brandShortName; better!">
 <!ENTITY tabCrashed.closeTab "Close This Tab">
 <!ENTITY tabCrashed.restoreTab "Restore This Tab">
 <!ENTITY tabCrashed.restoreAll "Restore All Crashed Tabs">
+
+<!-- LOCALIZATION NOTE (tabCrashed.header2): "Gah" is an English slang word
+     used to express surprise or frustration (or both at the same time).  We
+     are using it to communicate in an informal way that it is both
+     frustrating that your tab crashed and a surprise that we didn't want to
+     happen. If you have a similar word or short phrase that is not profane or
+     vulgar, use it. If not, feel free to skip the word in your
+     translation. -->
+<!ENTITY tabCrashed.header2 "Gah. Your tab just crashed.">
+<!ENTITY tabCrashed.offerHelp "We can help you!">
+<!ENTITY tabCrashed.single.offerHelpMessage "Choose &tabCrashed.restoreTab; to reload page content.">
+<!ENTITY tabCrashed.multiple.offerHelpMessage "Choose &tabCrashed.restoreTab; or &tabCrashed.restoreAll; to reload page content.">
+<!ENTITY tabCrashed.requestHelp "Will you help us?">
+<!ENTITY tabCrashed.requestHelpMessage "Crash reports help us diagnose problems and make &brandShortName; better.">
+<!ENTITY tabCrashed.requestReport "Report this tab">
+<!ENTITY tabCrashed.sendReport2 "Send a crash report for the tab you are viewing">
+<!ENTITY tabCrashed.commentPlaceholder2 "Optional comments (comments are publicly visible)">
+<!ENTITY tabCrashed.includeURL2 "Include page URL with this crash report">
+<!ENTITY tabCrashed.emailPlaceholder "Enter your email address here">
+<!ENTITY tabCrashed.emailMe "Email me when more information is available">
+<!ENTITY tabCrashed.reportSent "Crash report already submitted; thank you for helping make &brandShortName; better!">
+<!ENTITY tabCrashed.requestAutoSubmit "Request background tabs">
+<!ENTITY tabCrashed.autoSubmit "Update preferences to automatically submit backlogged crash reports (and get fewer messages like this from us in the future)">
\ No newline at end of file
--- a/browser/modules/ContentCrashHandlers.jsm
+++ b/browser/modules/ContentCrashHandlers.jsm
@@ -330,16 +330,22 @@ this.TabCrashHandler = {
    *        even if they are empty.
    */
   maybeSendCrashReport(message) {
     if (!AppConstants.MOZ_CRASHREPORTER)
       return;
 
     let browser = message.target.browser;
 
+    if (message.data.autoSubmit) {
+      // The user has opted in to autosubmitted backlogged
+      // crash reports in the future.
+      UnsubmittedCrashHandler.autoSubmit = true;
+    }
+
     let childID = this.browserMap.get(browser.permanentKey);
     let dumpID = this.childMap.get(childID);
     if (!dumpID)
       return
 
     if (!message.data.sendReport) {
       Services.telemetry.getHistogramById("FX_CONTENT_CRASH_NOT_SUBMITTED").add(1);
       this.prefs.setBoolPref("sendReport", false);
@@ -444,21 +450,31 @@ this.TabCrashHandler = {
     let dumpID = this.getDumpID(browser);
     if (!dumpID) {
       message.target.sendAsyncMessage("SetCrashReportAvailable", {
         hasReport: false,
       });
       return;
     }
 
+    let requestAutoSubmit = !UnsubmittedCrashHandler.autoSubmit;
+    let requestEmail = this.prefs.getBoolPref("requestEmail");
     let sendReport = this.prefs.getBoolPref("sendReport");
     let includeURL = this.prefs.getBoolPref("includeURL");
     let emailMe = this.prefs.getBoolPref("emailMe");
 
-    let data = { hasReport: true, sendReport, includeURL, emailMe };
+    let data = {
+      hasReport: true,
+      sendReport,
+      includeURL,
+      emailMe,
+      requestAutoSubmit,
+      requestEmail,
+    };
+
     if (emailMe) {
       data.email = this.prefs.getCharPref("email", "");
     }
 
     // Make sure to only count once even if there are multiple windows
     // that will all show about:tabcrashed.
     if (this._crashedTabCount == 1) {
       Services.telemetry.getHistogramById("FX_CONTENT_CRASH_PRESENTED").add(1);
--- a/browser/themes/shared/aboutTabCrashed.css
+++ b/browser/themes/shared/aboutTabCrashed.css
@@ -1,42 +1,79 @@
 /* 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/. */
 
+body {
+  font-size: 1.25rem;
+}
+
 .title {
   background-image: url("chrome://browser/skin/tab-crashed.svg");
 }
 
+.title > h1,
+.offers {
+  margin-left: 14px;
+}
+
+.title > h1 {
+  /**
+   * Add commentary?
+   */
+  padding-right: 14px;
+}
+
+.container {
+  width: 45%;
+}
+
 #reportSent {
   font-weight: bold;
 }
 
-#crash-reporter-container {
-  width: 80%;
+#reportBox {
   background-color: var(--in-content-box-background-hover);
   margin: 24px 0;
   padding: 14px;
   border: 1px solid var(--in-content-box-border-color);
   border-radius: 2px;
 }
 
+#reportBox > h2:first-child {
+  margin-top: 0;
+}
+
 #crash-reporter-title {
   font-weight: bold;
   margin: 0 0 14px 0;
 }
 
 input[type="text"],
 textarea {
   width: 100%;
   box-sizing: border-box;
   resize: none;
 }
 
+input[type="text"],
+input[type="checkbox"] {
+  -moz-margin-start: 0px;
+}
+
 #options {
   list-style: none;
   margin-inline-start: 0;
 }
 
-input[type="text"],
-#options > li {
-  margin: 14px 0 0 0;
+#options > li,
+#email {
+  margin-top: 14px;
 }
+
+.checkbox-with-label {
+  display: flex;
+}
+
+.checkbox-with-label > label {
+  margin-top: auto;
+  margin-bottom: auto;
+}
\ No newline at end of file
--- a/build/autoconf/sanitize.m4
+++ b/build/autoconf/sanitize.m4
@@ -21,16 +21,21 @@ if test -n "$MOZ_ASAN"; then
           MOZ_CLANG_RT_ASAN_LIB=clang_rt.asan_dynamic-i386.dll
         fi
         # We use MOZ_PATH_PROG in order to get a Windows style path.
         MOZ_PATH_PROG(MOZ_CLANG_RT_ASAN_LIB_PATH, $MOZ_CLANG_RT_ASAN_LIB)
         if test -z "$MOZ_CLANG_RT_ASAN_LIB_PATH"; then
             AC_MSG_ERROR([Couldn't find $MOZ_CLANG_RT_ASAN_LIB.  It should be available in the same location as clang-cl.])
         fi
         AC_SUBST(MOZ_CLANG_RT_ASAN_LIB_PATH)
+        # Suppressing errors in recompiled code.
+        if test "$OS_ARCH" = "WINNT"; then
+            CFLAGS="-fsanitize-blacklist=$_topsrcdir/build/sanitizers/asan_blacklist_win.txt $CFLAGS"
+            CXXFLAGS="-fsanitize-blacklist=$_topsrcdir/build/sanitizers/asan_blacklist_win.txt $CXXFLAGS"
+        fi
     fi
     CFLAGS="-fsanitize=address $CFLAGS"
     CXXFLAGS="-fsanitize=address $CXXFLAGS"
     if test -z "$CLANG_CL"; then
         LDFLAGS="-fsanitize=address $LDFLAGS"
     fi
     AC_DEFINE(MOZ_ASAN)
     MOZ_PATH_PROG(LLVM_SYMBOLIZER, llvm-symbolizer)
new file mode 100644
--- /dev/null
+++ b/build/sanitizers/asan_blacklist_win.txt
@@ -0,0 +1,26 @@
+# This is originally copied from Chromium tools/memory/asan/blacklist_win.txt.
+# The rules in this file are only applied at compile time. If you can modify the
+# source in question, consider function attributes to disable instrumentation.
+
+# Bug 1200740 - ASan crash due to child process function interceptions
+# Sandbox executes some of its code before the ASan RTL gets initialized and
+# maps shadow memory.  As a result, instrmented code tries to access unavailable
+# shadow memory and faults.
+fun:*TargetNtSetInformationThread@20
+fun:*TargetNtOpenThreadToken@20
+fun:*TargetNtOpenThreadTokenEx@24
+fun:*TargetNtMapViewOfSection@44
+fun:*AutoProtectMemory*sandbox*
+fun:*EatResolverThunk*sandbox*
+fun:*InterceptionAgent*sandbox*
+fun:*ResolverThunk*sandbox*
+fun:*Target*SandboxFactory*sandbox*
+fun:*ProcessState*sandbox*
+src:*pe_image.h
+src:*pe_image.cc
+src:*resolver_32.cc
+src:*filesystem_interception.cc
+src:*process_thread_interception.cc
+src:*registry_interception.cc
+src:*sandbox_nt_util.cc
+src:*sync_interception.cc
--- a/devtools/client/framework/target.js
+++ b/devtools/client/framework/target.js
@@ -560,17 +560,17 @@ TabTarget.prototype = {
 
   // Automatically respawn the toolbox when the tab changes between being
   // loaded within the parent process and loaded from a content process.
   // Process change can go in both ways.
   onRemotenessChange: function () {
     // Responsive design do a crazy dance around tabs and triggers
     // remotenesschange events. But we should ignore them as at the end
     // the content doesn't change its remoteness.
-    if (this._tab.isReponsiveDesignMode) {
+    if (this._tab.isResponsiveDesignMode) {
       return;
     }
 
     // Save a reference to the tab as it will be nullified on destroy
     let tab = this._tab;
     let onToolboxDestroyed = (event, target) => {
       if (target != this) {
         return;
--- a/devtools/client/jsonview/components/json-panel.js
+++ b/devtools/client/jsonview/components/json-panel.js
@@ -54,17 +54,17 @@ define(function (require, exports, modul
     },
 
     onFilter: function (object) {
       if (!this.props.searchFilter) {
         return true;
       }
 
       let json = JSON.stringify(object).toLowerCase();
-      return json.indexOf(this.props.searchFilter) >= 0;
+      return json.indexOf(this.props.searchFilter.toLowerCase()) >= 0;
     },
 
     getExpandedNodes: function (object, path = "", level = 0) {
       if (typeof object != "object") {
         return null;
       }
 
       if (level > AUTO_EXPAND_MAX_LEVEL) {
--- a/devtools/client/responsive.html/browser/swap.js
+++ b/devtools/client/responsive.html/browser/swap.js
@@ -47,17 +47,17 @@ function swapToInnerBrowser({ tab, conta
       bubbles: true,
     });
     from.dispatchEvent(event);
   };
 
   return {
 
     start: Task.async(function* () {
-      tab.isReponsiveDesignMode = true;
+      tab.isResponsiveDesignMode = true;
 
       // Freeze navigation temporarily to avoid "blinking" in the location bar.
       freezeNavigationState(tab);
 
       // 1. Create a temporary, hidden tab to load the tool UI.
       let containerTab = gBrowser.addTab(containerURL, {
         skipAnimation: true,
       });
@@ -148,17 +148,17 @@ function swapToInnerBrowser({ tab, conta
       gBrowser.swapBrowsersAndCloseOther(tab, contentTab);
       gBrowser = null;
 
       // The focus manager seems to get a little dizzy after all this swapping.  If a
       // content element had been focused inside the viewport before stopping, it will
       // have lost focus.  Activate the frame to restore expected focus.
       tab.linkedBrowser.frameLoader.activateRemoteFrame();
 
-      delete tab.isReponsiveDesignMode;
+      delete tab.isResponsiveDesignMode;
     },
 
   };
 }
 
 /**
  * Browser navigation properties we'll freeze temporarily to avoid "blinking" in the
  * location bar, etc. caused by the containerURL peeking through before the swap is
--- a/devtools/client/responsive.html/browser/tunnel.js
+++ b/devtools/client/responsive.html/browser/tunnel.js
@@ -425,17 +425,17 @@ MessageManagerTunnel.prototype = {
     // Messages sent from findbar.xml
     "Findbar:",
     // Messages sent from RemoteFinder.jsm
     "Finder:",
     // Messages sent from InlineSpellChecker.jsm
     "InlineSpellChecker:",
     // Messages sent from pageinfo.js
     "PageInfo:",
-    // Messsage sent from printUtils.js
+    // Messages sent from printUtils.js
     "Printing:",
     // Messages sent from browser-social.js
     "Social:",
     "PageMetadata:",
     // Messages sent from viewSourceUtils.js
     "ViewSource:",
   ],
 
@@ -445,17 +445,17 @@ MessageManagerTunnel.prototype = {
     // Messages sent to DevTools
     "debug:",
     // Messages sent to findbar.xml
     "Findbar:",
     // Messages sent to RemoteFinder.jsm
     "Finder:",
     // Messages sent to pageinfo.js
     "PageInfo:",
-    // Messsage sent from printUtils.js
+    // Messages sent to printUtils.js
     "Printing:",
     // Messages sent to browser-social.js
     "Social:",
     "PageMetadata:",
     // Messages sent to viewSourceUtils.js
     "ViewSource:",
   ],
 
--- a/devtools/client/shared/components/test/browser/browser_notification_box_basic.js
+++ b/devtools/client/shared/components/test/browser/browser_notification_box_basic.js
@@ -1,15 +1,17 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
+/* import-globals-from ../../../../framework/test/shared-head.js */
+
 Services.scriptloader.loadSubScript(
   "chrome://mochitests/content/browser/devtools/client/framework/test/shared-head.js", this);
 
 const TEST_URI = "data:text/html;charset=utf-8,Test page";
 
 /**
  * Basic test that checks existence of the Notification box.
  */
--- a/devtools/client/shared/components/test/mochitest/head.js
+++ b/devtools/client/shared/components/test/mochitest/head.js
@@ -44,39 +44,39 @@ SimpleTest.waitForExplicitFinish();
 
 function onNextAnimationFrame(fn) {
   return () =>
     requestAnimationFrame(() =>
       requestAnimationFrame(fn));
 }
 
 function setState(component, newState) {
-  var deferred = defer();
-  component.setState(newState, onNextAnimationFrame(deferred.resolve));
-  return deferred.promise;
+  return new Promise(resolve => {
+    component.setState(newState, onNextAnimationFrame(resolve));
+  });
 }
 
-function setProps(component, newState) {
-  var deferred = defer();
-  component.setProps(newState, onNextAnimationFrame(deferred.resolve));
-  return deferred.promise;
+function setProps(component, newProps) {
+  return new Promise(resolve => {
+    component.setProps(newProps, onNextAnimationFrame(resolve));
+  });
 }
 
 function dumpn(msg) {
   dump(`SHARED-COMPONENTS-TEST: ${msg}\n`);
 }
 
 /**
  * Tree
  */
 
 var TEST_TREE_INTERFACE = {
   getParent: x => TEST_TREE.parent[x],
   getChildren: x => TEST_TREE.children[x],
-  renderItem: (x, depth, focused, arrow) => "-".repeat(depth) + x + ":" + focused + "\n",
+  renderItem: (x, depth, focused) => "-".repeat(depth) + x + ":" + focused + "\n",
   getRoots: () => ["A", "M"],
   getKey: x => "key-" + x,
   itemHeight: 1,
   onExpand: x => TEST_TREE.expanded.add(x),
   onCollapse: x => TEST_TREE.expanded.delete(x),
   isExpanded: x => TEST_TREE.expanded.has(x),
 };
 
@@ -140,28 +140,31 @@ var TEST_TREE = {
     O: "N"
   },
   expanded: new Set(),
 };
 
 /**
  * Frame
  */
-function checkFrameString({ el, file, line, column, source, functionName, shouldLink, tooltip }) {
+function checkFrameString({
+  el, file, line, column, source, functionName, shouldLink, tooltip
+}) {
   let $ = selector => el.querySelector(selector);
 
   let $func = $(".frame-link-function-display-name");
   let $source = $(".frame-link-source");
   let $sourceInner = $(".frame-link-source-inner");
   let $filename = $(".frame-link-filename");
   let $line = $(".frame-link-line");
 
   is($filename.textContent, file, "Correct filename");
   is(el.getAttribute("data-line"), line ? `${line}` : null, "Expected `data-line` found");
-  is(el.getAttribute("data-column"), column ? `${column}` : null, "Expected `data-column` found");
+  is(el.getAttribute("data-column"),
+     column ? `${column}` : null, "Expected `data-column` found");
   is($sourceInner.getAttribute("title"), tooltip, "Correct tooltip");
   is($source.tagName, shouldLink ? "A" : "SPAN", "Correct linkable status");
   if (shouldLink) {
     is($source.getAttribute("href"), source, "Correct source");
   }
 
   if (line != null) {
     let lineText = `:${line}`;
--- a/devtools/client/shared/components/test/mochitest/test_stack-trace.html
+++ b/devtools/client/shared/components/test/mochitest/test_stack-trace.html
@@ -11,20 +11,25 @@ Test the rendering of a stack trace
   <title>StackTrace component test</title>
   <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
 </head>
 <body>
 <script src="head.js"></script>
 <script>
-window.onload = function() {
+/* import-globals-from head.js */
+"use strict";
+
+window.onload = function () {
   let ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");
   let React = browserRequire("devtools/client/shared/vendor/react");
-  let StackTrace = React.createFactory(browserRequire("devtools/client/shared/components/stack-trace"));
+  let StackTrace = React.createFactory(
+    browserRequire("devtools/client/shared/components/stack-trace")
+  );
   ok(StackTrace, "Got the StackTrace factory");
 
   add_task(function* () {
     let stacktrace = [
       {
         filename: "http://myfile.com/mahscripts.js",
         lineNumber: 55,
         columnNumber: 10
@@ -62,17 +67,18 @@ window.onload = function() {
       file: "http://myfile.com/mahscripts.js",
       line: 55,
       column: 10,
       shouldLink: true,
       tooltip: "View source in Debugger → http://myfile.com/mahscripts.js:55:10",
     });
 
     // Check the async cause node
-    is(frameEls[1].className, "frame-link-async-cause", "Async cause has the right class");
+    is(frameEls[1].className, "frame-link-async-cause",
+       "Async cause has the right class");
     is(frameEls[1].textContent, "(Async: because)", "Async cause has the right label");
 
     // Check the third frame, the source should be parsed into a valid source URL
     checkFrameString({
       el: frameEls[2],
       functionName: "loadFunc",
       source: "http://myfile.com/loadee.js",
       file: "http://myfile.com/loadee.js",
@@ -85,12 +91,12 @@ window.onload = function() {
     // Check the tabs and newlines in the stack trace textContent
     let traceText = traceEl.textContent;
     let traceLines = traceText.split("\n");
     ok(traceLines.length > 0, "There are newlines in the stack trace text");
     is(traceLines.pop(), "", "There is a newline at the end of the stack trace text");
     is(traceLines.length, 3, "The stack trace text has 3 lines");
     ok(traceLines.every(l => l[0] == "\t"), "Every stack trace line starts with tab");
   });
-}
+};
 </script>
 </body>
 </html>
--- a/devtools/client/shared/developer-toolbar.js
+++ b/devtools/client/shared/developer-toolbar.js
@@ -1,26 +1,26 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-const { Cc, Ci, Cu } = require("chrome");
+const { Ci } = require("chrome");
 const promise = require("promise");
 const defer = require("devtools/shared/defer");
 const Services = require("Services");
 const { TargetFactory } = require("devtools/client/framework/target");
 const Telemetry = require("devtools/client/shared/telemetry");
 const {ViewHelpers} = require("devtools/client/shared/widgets/view-helpers");
 const {LocalizationHelper} = require("devtools/shared/l10n");
 const L10N = new LocalizationHelper("devtools/client/locales/toolbox.properties");
+const {Task} = require("devtools/shared/task");
 
 const NS_XHTML = "http://www.w3.org/1999/xhtml";
-const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
 const { PluralForm } = require("devtools/shared/plural-form");
 
 loader.lazyGetter(this, "prefBranch", function () {
   return Services.prefs.getBranch(null)
                     .QueryInterface(Ci.nsIPrefBranch2);
 });
 
@@ -39,17 +39,17 @@ var CommandUtils = {
   /**
    * Utility to ensure that things are loaded in the correct order
    */
   createRequisition: function (target, options) {
     if (!gcliInit) {
       return promise.reject("Unable to load gcli");
     }
     return gcliInit.getSystem(target).then(system => {
-      var Requisition = require("gcli/cli").Requisition;
+      let Requisition = require("gcli/cli").Requisition;
       return new Requisition(system, options);
     });
   },
 
   /**
    * Destroy the remote side of the requisition as well as the local side
    */
   destroyRequisition: function (requisition, target) {
@@ -85,28 +85,26 @@ var CommandUtils = {
           throw new Error("No command '" + typed + "'");
         }
 
         if (command.buttonId != null) {
           button.id = command.buttonId;
           if (command.buttonClass != null) {
             button.className = command.buttonClass;
           }
-        }
-        else {
+        } else {
           button.setAttribute("text-as-image", "true");
           button.setAttribute("label", command.name);
         }
 
         button.classList.add("devtools-button");
 
         if (command.tooltipText != null) {
           button.setAttribute("title", command.tooltipText);
-        }
-        else if (command.description != null) {
+        } else if (command.description != null) {
           button.setAttribute("title", command.description);
         }
 
         button.addEventListener("click",
           requisition.updateExec.bind(requisition, typed));
 
         button.addEventListener("keypress", (event) => {
           if (ViewHelpers.isSpaceOrReturn(event)) {
@@ -123,44 +121,41 @@ var CommandUtils = {
           /**
            * The onChange event should be called with an event object that
            * contains a target property which specifies which target the event
            * applies to. For legacy reasons the event object can also contain
            * a tab property.
            */
           onChange = (eventName, ev) => {
             if (ev.target == target || ev.tab == target.tab) {
-
               let updateChecked = (checked) => {
                 if (checked) {
                   button.setAttribute("checked", true);
-                }
-                else if (button.hasAttribute("checked")) {
+                } else if (button.hasAttribute("checked")) {
                   button.removeAttribute("checked");
                 }
               };
 
               // isChecked would normally be synchronous. An annoying quirk
               // of the 'csscoverage toggle' command forces us to accept a
               // promise here, but doing Promise.resolve(reply).then(...) here
               // makes this async for everyone, which breaks some tests so we
               // treat non-promise replies separately to keep then synchronous.
               let reply = command.state.isChecked(target);
               if (typeof reply.then == "function") {
                 reply.then(updateChecked, console.error);
-              }
-              else {
+              } else {
                 updateChecked(reply);
               }
             }
           };
 
           command.state.onChange(target, onChange);
           onChange("", { target: target });
-        };
+        }
         document.defaultView.addEventListener("unload", function (event) {
           if (onChange && command.state.offChange) {
             command.state.offChange(target, onChange);
           }
           button.remove();
           button = null;
         }, { once: true });
 
@@ -197,22 +192,24 @@ var CommandUtils = {
         return this.target.tab.ownerDocument.defaultView;
       },
 
       get chromeDocument() {
         return this.target.tab.ownerDocument.defaultView.document;
       },
 
       get window() {
-        // throw new Error("environment.window is not available in runAt:client commands");
+        // throw new
+        //    Error("environment.window is not available in runAt:client commands");
         return this.chromeWindow.gBrowser.contentWindowAsCPOW;
       },
 
       get document() {
-        // throw new Error("environment.document is not available in runAt:client commands");
+        // throw new
+        //    Error("environment.document is not available in runAt:client commands");
         return this.chromeWindow.gBrowser.contentDocumentAsCPOW;
       }
     };
   },
 };
 
 exports.CommandUtils = CommandUtils;
 
@@ -228,25 +225,25 @@ loader.lazyGetter(this, "isLinux", funct
 });
 loader.lazyGetter(this, "isMac", function () {
   return Services.appinfo.OS == "Darwin";
 });
 
 /**
  * A component to manage the global developer toolbar, which contains a GCLI
  * and buttons for various developer tools.
- * @param aChromeWindow The browser window to which this toolbar is attached
+ * @param chromeWindow The browser window to which this toolbar is attached
  */
-function DeveloperToolbar(aChromeWindow)
-{
-  this._chromeWindow = aChromeWindow;
+function DeveloperToolbar(chromeWindow) {
+  this._chromeWindow = chromeWindow;
 
-  this.target = null; // Will be setup when show() is called
+  // Will be setup when show() is called
+  this.target = null;
 
-  this._doc = aChromeWindow.document;
+  this._doc = chromeWindow.document;
 
   this._telemetry = new Telemetry();
   this._errorsCount = {};
   this._warningsCount = {};
   this._errorListeners = {};
 
   this._onToolboxReady = this._onToolboxReady.bind(this);
   this._onToolboxDestroyed = this._onToolboxDestroyed.bind(this);
@@ -352,62 +349,61 @@ DeveloperToolbar.prototype.createToolbar
     toolbar.appendChild(toolboxBtn);
     toolbar.appendChild(close);
   }
 
   this._element = toolbar;
   let bottomBox = this._doc.getElementById("browser-bottombox");
   if (bottomBox) {
     bottomBox.appendChild(this._element);
-  } else { // SeaMonkey does not have a "browser-bottombox".
+  } else {
+    // SeaMonkey does not have a "browser-bottombox".
     let statusBar = this._doc.getElementById("status-bar");
-    if (statusBar)
+    if (statusBar) {
       statusBar.parentNode.insertBefore(this._element, statusBar);
+    }
   }
 };
 
 /**
  * Called from browser.xul in response to menu-click or keyboard shortcut to
  * toggle the toolbar
  */
 DeveloperToolbar.prototype.toggle = function () {
   if (this.visible) {
     return this.hide().catch(console.error);
-  } else {
-    return this.show(true).catch(console.error);
   }
+  return this.show(true).catch(console.error);
 };
 
 /**
  * Called from browser.xul in response to menu-click or keyboard shortcut to
  * toggle the toolbar
  */
 DeveloperToolbar.prototype.focus = function () {
   if (this.visible) {
     this._input.focus();
     return promise.resolve();
-  } else {
-    return this.show(true);
   }
+  return this.show(true);
 };
 
 /**
  * Called from browser.xul in response to menu-click or keyboard shortcut to
  * toggle the toolbar
  */
 DeveloperToolbar.prototype.focusToggle = function () {
   if (this.visible) {
     // If we have focus then the active element is the HTML input contained
     // inside the xul input element
     let active = this._chromeWindow.document.activeElement;
     let position = this._input.compareDocumentPosition(active);
     if (position & nodeConstants.DOCUMENT_POSITION_CONTAINED_BY) {
       this.hide();
-    }
-    else {
+    } else {
       this._input.focus();
     }
   } else {
     this.show(true);
   }
 };
 
 /**
@@ -421,155 +417,157 @@ DeveloperToolbar.introShownThisSession =
 /**
  * Show the developer toolbar
  */
 DeveloperToolbar.prototype.show = function (focus) {
   if (this._showPromise != null) {
     return this._showPromise;
   }
 
-  // hide() is async, so ensure we don't need to wait for hide() to finish
-  var waitPromise = this._hidePromise || promise.resolve();
+  this._showPromise = Task.spawn((function* () {
+    // hide() is async, so ensure we don't need to wait for hide() to
+    // finish.  We unconditionally yield here, even if _hidePromise is
+    // null, so that the spawn call returns a promise before starting
+    // to do any real work.
+    yield this._hidePromise;
 
-  this._showPromise = waitPromise.then(() => {
     this.createToolbar();
 
     Services.prefs.setBoolPref("devtools.toolbar.visible", true);
 
     this._telemetry.toolOpened("developertoolbar");
 
     this._notify(NOTIFICATIONS.LOAD);
 
     this._input = this._doc.querySelector(".gclitoolbar-input-node");
 
     // Initializing GCLI can only be done when we've got content windows to
     // write to, so this needs to be done asynchronously.
     let panelPromises = [
       TooltipPanel.create(this),
       OutputPanel.create(this)
     ];
-    return promise.all(panelPromises).then(panels => {
-      [ this.tooltipPanel, this.outputPanel ] = panels;
+    let panels = yield promise.all(panelPromises);
 
-      this._doc.getElementById("menu_devToolbar").setAttribute("checked", "true");
+    [ this.tooltipPanel, this.outputPanel ] = panels;
+
+    this._doc.getElementById("menu_devToolbar").setAttribute("checked", "true");
 
-      this.target = TargetFactory.forTab(this._chromeWindow.gBrowser.selectedTab);
-      const options = {
-        environment: CommandUtils.createEnvironment(this, "target"),
-        document: this.outputPanel.document,
-      };
-      return CommandUtils.createRequisition(this.target, options).then(requisition => {
-        this.requisition = requisition;
+    this.target = TargetFactory.forTab(this._chromeWindow.gBrowser.selectedTab);
+    const options = {
+      environment: CommandUtils.createEnvironment(this, "target"),
+      document: this.outputPanel.document,
+    };
+    let requisition = yield CommandUtils.createRequisition(this.target, options);
+    this.requisition = requisition;
 
-        // The <textbox> `value` may still be undefined on the XUL binding if
-        // we fetch it early
-        let value = this._input.value || "";
-        return this.requisition.update(value).then(() => {
-          const Inputter = require("gcli/mozui/inputter").Inputter;
-          const Completer = require("gcli/mozui/completer").Completer;
-          const Tooltip = require("gcli/mozui/tooltip").Tooltip;
-          const FocusManager = require("gcli/ui/focus").FocusManager;
+    // The <textbox> `value` may still be undefined on the XUL binding if
+    // we fetch it early
+    let value = this._input.value || "";
+    yield this.requisition.update(value);
 
-          this.onOutput = this.requisition.commandOutputManager.onOutput;
+    const Inputter = require("gcli/mozui/inputter").Inputter;
+    const Completer = require("gcli/mozui/completer").Completer;
+    const Tooltip = require("gcli/mozui/tooltip").Tooltip;
+    const FocusManager = require("gcli/ui/focus").FocusManager;
 
-          this.focusManager = new FocusManager(this._doc, requisition.system.settings);
+    this.onOutput = this.requisition.commandOutputManager.onOutput;
+
+    this.focusManager = new FocusManager(this._doc, requisition.system.settings);
 
-          this.inputter = new Inputter({
-            requisition: this.requisition,
-            focusManager: this.focusManager,
-            element: this._input,
-          });
+    this.inputter = new Inputter({
+      requisition: this.requisition,
+      focusManager: this.focusManager,
+      element: this._input,
+    });
 
-          this.completer = new Completer({
-            requisition: this.requisition,
-            inputter: this.inputter,
-            backgroundElement: this._doc.querySelector(".gclitoolbar-stack-node"),
-            element: this._doc.querySelector(".gclitoolbar-complete-node"),
-          });
+    this.completer = new Completer({
+      requisition: this.requisition,
+      inputter: this.inputter,
+      backgroundElement: this._doc.querySelector(".gclitoolbar-stack-node"),
+      element: this._doc.querySelector(".gclitoolbar-complete-node"),
+    });
 
-          this.tooltip = new Tooltip({
-            requisition: this.requisition,
-            focusManager: this.focusManager,
-            inputter: this.inputter,
-            element: this.tooltipPanel.hintElement,
-          });
+    this.tooltip = new Tooltip({
+      requisition: this.requisition,
+      focusManager: this.focusManager,
+      inputter: this.inputter,
+      element: this.tooltipPanel.hintElement,
+    });
 
-          this.inputter.tooltip = this.tooltip;
-
-          this.focusManager.addMonitoredElement(this.outputPanel._frame);
-          this.focusManager.addMonitoredElement(this._element);
+    this.inputter.tooltip = this.tooltip;
 
-          this.focusManager.onVisibilityChange.add(this.outputPanel._visibilityChanged,
-                                                   this.outputPanel);
-          this.focusManager.onVisibilityChange.add(this.tooltipPanel._visibilityChanged,
-                                                   this.tooltipPanel);
-          this.onOutput.add(this.outputPanel._outputChanged, this.outputPanel);
+    this.focusManager.addMonitoredElement(this.outputPanel._frame);
+    this.focusManager.addMonitoredElement(this._element);
+
+    this.focusManager.onVisibilityChange.add(this.outputPanel._visibilityChanged,
+                                             this.outputPanel);
+    this.focusManager.onVisibilityChange.add(this.tooltipPanel._visibilityChanged,
+                                             this.tooltipPanel);
+    this.onOutput.add(this.outputPanel._outputChanged, this.outputPanel);
 
-          let tabbrowser = this._chromeWindow.gBrowser;
-          tabbrowser.tabContainer.addEventListener("TabSelect", this, false);
-          tabbrowser.tabContainer.addEventListener("TabClose", this, false);
-          tabbrowser.addEventListener("load", this, true);
-          tabbrowser.addEventListener("beforeunload", this, true);
+    let tabbrowser = this._chromeWindow.gBrowser;
+    tabbrowser.tabContainer.addEventListener("TabSelect", this, false);
+    tabbrowser.tabContainer.addEventListener("TabClose", this, false);
+    tabbrowser.addEventListener("load", this, true);
+    tabbrowser.addEventListener("beforeunload", this, true);
 
-          gDevTools.on("toolbox-ready", this._onToolboxReady);
-          gDevTools.on("toolbox-destroyed", this._onToolboxDestroyed);
+    gDevTools.on("toolbox-ready", this._onToolboxReady);
+    gDevTools.on("toolbox-destroyed", this._onToolboxDestroyed);
 
-          this._initErrorsCount(tabbrowser.selectedTab);
+    this._initErrorsCount(tabbrowser.selectedTab);
 
-          this._element.hidden = false;
+    this._element.hidden = false;
 
-          if (focus) {
-            // If the toolbar was just inserted, the <textbox> may still have
-            // its binding in process of being applied and not be focusable yet
-            let waitForBinding = () => {
-              // Bail out if the toolbar has been destroyed in the meantime
-              if (!this._input) {
-                return;
-              }
-              // mInputField is a xbl field of <xul:textbox>
-              if (typeof this._input.mInputField != "undefined") {
-                this._input.focus();
-                this._notify(NOTIFICATIONS.SHOW);
-              } else {
-                this._input.ownerDocument.defaultView.setTimeout(waitForBinding, 50);
-              }
-            };
-            waitForBinding();
-          } else {
-            this._notify(NOTIFICATIONS.SHOW);
-          }
+    if (focus) {
+      // If the toolbar was just inserted, the <textbox> may still have
+      // its binding in process of being applied and not be focusable yet
+      let waitForBinding = () => {
+        // Bail out if the toolbar has been destroyed in the meantime
+        if (!this._input) {
+          return;
+        }
+        // mInputField is a xbl field of <xul:textbox>
+        if (typeof this._input.mInputField != "undefined") {
+          this._input.focus();
+          this._notify(NOTIFICATIONS.SHOW);
+        } else {
+          this._input.ownerDocument.defaultView.setTimeout(waitForBinding, 50);
+        }
+      };
+      waitForBinding();
+    } else {
+      this._notify(NOTIFICATIONS.SHOW);
+    }
 
-          if (!DeveloperToolbar.introShownThisSession) {
-            let intro = require("gcli/ui/intro");
-            intro.maybeShowIntro(this.requisition.commandOutputManager,
-                                 this.requisition.conversionContext,
-                                 this.outputPanel);
-            DeveloperToolbar.introShownThisSession = true;
-          }
+    if (!DeveloperToolbar.introShownThisSession) {
+      let intro = require("gcli/ui/intro");
+      intro.maybeShowIntro(this.requisition.commandOutputManager,
+                           this.requisition.conversionContext,
+                           this.outputPanel);
+      DeveloperToolbar.introShownThisSession = true;
+    }
 
-          this._showPromise = null;
-        });
-      });
-    });
-  });
+    this._showPromise = null;
+  }).bind(this));
 
   return this._showPromise;
 };
 
 /**
  * Hide the developer toolbar.
  */
 DeveloperToolbar.prototype.hide = function () {
   // If we're already in the process of hiding, just use the other promise
   if (this._hidePromise != null) {
     return this._hidePromise;
   }
 
   // show() is async, so ensure we don't need to wait for show() to finish
-  var waitPromise = this._showPromise || promise.resolve();
+  let waitPromise = this._showPromise || promise.resolve();
 
   this._hidePromise = waitPromise.then(() => {
     this._element.hidden = true;
 
     Services.prefs.setBoolPref("devtools.toolbar.visible", false);
 
     this._doc.getElementById("menu_devToolbar").setAttribute("checked", "false");
     this.destroy();
@@ -637,17 +635,18 @@ DeveloperToolbar.prototype._stopErrorsCo
   this._updateErrorsCount();
 };
 
 /**
  * Hide the developer toolbar
  */
 DeveloperToolbar.prototype.destroy = function () {
   if (this._input == null) {
-    return; // Already destroyed
+    // Already destroyed
+    return;
   }
 
   let tabbrowser = this._chromeWindow.gBrowser;
   tabbrowser.tabContainer.removeEventListener("TabSelect", this, false);
   tabbrowser.tabContainer.removeEventListener("TabClose", this, false);
   tabbrowser.removeEventListener("load", this, true);
   tabbrowser.removeEventListener("beforeunload", this, true);
 
@@ -716,21 +715,19 @@ DeveloperToolbar.prototype.handleEvent =
       });
 
       if (ev.type == "TabSelect") {
         let toolboxOpen = gDevToolsBrowser.hasToolboxOpened(this._chromeWindow);
         this._errorCounterButton.setAttribute("checked", toolboxOpen);
         this._initErrorsCount(ev.target);
       }
     }
-  }
-  else if (ev.type == "TabClose") {
+  } else if (ev.type == "TabClose") {
     this._stopErrorsCount(ev.target);
-  }
-  else if (ev.type == "beforeunload") {
+  } else if (ev.type == "beforeunload") {
     this._onPageBeforeUnload(ev);
   }
 };
 
 /**
  * Update toolbox toggle button when toolbox goes on and off
  */
 DeveloperToolbar.prototype._onToolboxReady = function () {
@@ -863,17 +860,17 @@ function OutputPanel() {
  * called on Windows and OSX (bug 692348) ... this prevents the panel from
  * appearing the first time it is shown. Setting the panel's height to 1px
  * before calling openPopup works around this issue as we resize it ourselves
  * anyway.
  *
  * @param devtoolbar The parent DeveloperToolbar object
  */
 OutputPanel.create = function (devtoolbar) {
-  var outputPanel = Object.create(OutputPanel.prototype);
+  let outputPanel = Object.create(OutputPanel.prototype);
   return outputPanel._init(devtoolbar);
 };
 
 /**
  * @private See OutputPanel.create
  */
 OutputPanel.prototype._init = function (devtoolbar) {
   this._devtoolbar = devtoolbar;
@@ -1061,18 +1058,17 @@ OutputPanel.prototype._outputChanged = f
   }
 
   this.remove();
 
   this.displayedOutput = ev.output;
 
   if (this.displayedOutput.completed) {
     this._update();
-  }
-  else {
+  } else {
     this.displayedOutput.promise.then(this._update, this._update)
                                 .then(null, console.error);
   }
 };
 
 /**
  * Called when displayed Output says it's changed or from outputChanged, which
  * happens when there is a new displayed Output.
@@ -1094,18 +1090,18 @@ OutputPanel.prototype._update = function
       if (node == null) {
         return;
       }
 
       while (this._div.hasChildNodes()) {
         this._div.removeChild(this._div.firstChild);
       }
 
-      var links = node.querySelectorAll("*[href]");
-      for (var i = 0; i < links.length; i++) {
+      let links = node.querySelectorAll("*[href]");
+      for (let i = 0; i < links.length; i++) {
         links[i].setAttribute("target", "_blank");
       }
 
       this._div.appendChild(node);
       this.show();
     });
   }
 };
@@ -1183,27 +1179,26 @@ function TooltipPanel() {
  * called on Windows and OSX (bug 692348) ... this prevents the panel from
  * appearing the first time it is shown. Setting the panel's height to 1px
  * before calling openPopup works around this issue as we resize it ourselves
  * anyway.
  *
  * @param devtoolbar The parent DeveloperToolbar object
  */
 TooltipPanel.create = function (devtoolbar) {
-  var tooltipPanel = Object.create(TooltipPanel.prototype);
+  let tooltipPanel = Object.create(TooltipPanel.prototype);
   return tooltipPanel._init(devtoolbar);
 };
 
 /**
  * @private See TooltipPanel.create
  */
 TooltipPanel.prototype._init = function (devtoolbar) {
   let deferred = defer();
 
-  let chromeDocument = devtoolbar._doc;
   this._devtoolbar = devtoolbar;
   this._input = devtoolbar._doc.querySelector(".gclitoolbar-input-node");
   this._toolbar = devtoolbar._doc.querySelector("#developer-toolbar");
   this._dimensions = { start: 0, end: 0 };
 
   /*
   <tooltip|panel id="gcli-tooltip"
          type="arrow"
new file mode 100644
--- /dev/null
+++ b/devtools/client/shared/redux/middleware/test/.eslintrc.js
@@ -0,0 +1,17 @@
+"use strict";
+
+module.exports = {
+  // Extend from the shared list of defined globals for mochitests.
+  "extends": "../../../../../.eslintrc.mochitests.js",
+  "globals": {
+    "run_test": true,
+    "run_next_test": true,
+    "equal": true,
+    "do_print": true,
+    "waitUntilState": true
+  },
+  "rules": {
+    // Stop giving errors for run_test
+    "camelcase": "off"
+  }
+};
--- a/devtools/client/shared/redux/middleware/test/head.js
+++ b/devtools/client/shared/redux/middleware/test/head.js
@@ -1,28 +1,27 @@
 /* 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/. */
 
-var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
-var flags = require("devtools/shared/flags");
-var promise = require("promise");
-var defer = require("devtools/shared/defer");
+/* exported waitUntilState */
+
+"use strict";
+
+const { require } = Components.utils.import("resource://devtools/shared/Loader.jsm", {});
+const flags = require("devtools/shared/flags");
 
 flags.testing = true;
 
 function waitUntilState(store, predicate) {
-  let deferred = defer();
-  let unsubscribe = store.subscribe(check);
-
-  function check() {
-    if (predicate(store.getState())) {
-      unsubscribe();
-      deferred.resolve();
+  return new Promise(resolve => {
+    let unsubscribe = store.subscribe(check);
+    function check() {
+      if (predicate(store.getState())) {
+        unsubscribe();
+        resolve();
+      }
     }
-  }
 
-  // Fire the check immediately incase the action has already occurred
-  check();
-
-  return deferred.promise;
+    // Fire the check immediately incase the action has already occurred
+    check();
+  });
 }
--- a/devtools/client/shared/redux/middleware/test/test_middleware-task-01.js
+++ b/devtools/client/shared/redux/middleware/test/test_middleware-task-01.js
@@ -1,12 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+"use strict";
+
 const { createStore, applyMiddleware } = require("devtools/client/shared/vendor/redux");
 const { task } = require("devtools/client/shared/redux/middleware/task");
 
 /**
  * Tests that task middleware allows dispatching generators, promises and objects
  * that return actions;
  */
 
@@ -14,21 +16,23 @@ function run_test() {
   run_next_test();
 }
 
 add_task(function* () {
   let store = applyMiddleware(task)(createStore)(reducer);
 
   store.dispatch(fetch1("generator"));
   yield waitUntilState(store, () => store.getState().length === 1);
-  equal(store.getState()[0].data, "generator", "task middleware async dispatches an action via generator");
+  equal(store.getState()[0].data, "generator",
+        "task middleware async dispatches an action via generator");
 
   store.dispatch(fetch2("sync"));
   yield waitUntilState(store, () => store.getState().length === 2);
-  equal(store.getState()[1].data, "sync", "task middleware sync dispatches an action via sync");
+  equal(store.getState()[1].data, "sync",
+        "task middleware sync dispatches an action via sync");
 });
 
 function fetch1(data) {
   return function* (dispatch, getState) {
     equal(getState().length, 0, "`getState` is accessible in a generator action");
     let moreData = yield new Promise(resolve => resolve(data));
     // Ensure it handles more than one yield
     moreData = yield new Promise(resolve => resolve(data));
--- a/devtools/client/shared/redux/middleware/test/test_middleware-task-02.js
+++ b/devtools/client/shared/redux/middleware/test/test_middleware-task-02.js
@@ -1,12 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+"use strict";
+
 /**
  * Tests that task middleware allows dispatching generators that dispatch
  * additional sync and async actions.
  */
 
 const { createStore, applyMiddleware } = require("devtools/client/shared/vendor/redux");
 const { task } = require("devtools/client/shared/redux/middleware/task");
 
@@ -15,22 +17,28 @@ function run_test() {
 }
 
 add_task(function* () {
   let store = applyMiddleware(task)(createStore)(reducer);
 
   store.dispatch(comboAction());
   yield waitUntilState(store, () => store.getState().length === 3);
 
-  equal(store.getState()[0].type, "fetchAsync-start", "Async dispatched actions in a generator task are fired");
-  equal(store.getState()[1].type, "fetchAsync-end", "Async dispatched actions in a generator task are fired");
-  equal(store.getState()[2].type, "fetchSync", "Return values of yielded sync dispatched actions are correct");
-  equal(store.getState()[3].type, "fetch-done", "Return values of yielded async dispatched actions are correct");
-  equal(store.getState()[3].data.sync.data, "sync", "Return values of dispatched sync values are correct");
-  equal(store.getState()[3].data.async, "async", "Return values of dispatched async values are correct");
+  equal(store.getState()[0].type, "fetchAsync-start",
+        "Async dispatched actions in a generator task are fired");
+  equal(store.getState()[1].type, "fetchAsync-end",
+        "Async dispatched actions in a generator task are fired");
+  equal(store.getState()[2].type, "fetchSync",
+        "Return values of yielded sync dispatched actions are correct");
+  equal(store.getState()[3].type, "fetch-done",
+        "Return values of yielded async dispatched actions are correct");
+  equal(store.getState()[3].data.sync.data, "sync",
+        "Return values of dispatched sync values are correct");
+  equal(store.getState()[3].data.async, "async",
+        "Return values of dispatched async values are correct");
 });
 
 function comboAction() {
   return function* (dispatch, getState) {
     let data = {};
     data.async = yield dispatch(fetchAsync("async"));
     data.sync = yield dispatch(fetchSync("sync"));
     dispatch({ type: "fetch-done", data });
--- a/devtools/client/shared/redux/middleware/test/test_middleware-task-03.js
+++ b/devtools/client/shared/redux/middleware/test/test_middleware-task-03.js
@@ -1,35 +1,40 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+"use strict";
+
 const { createStore, applyMiddleware } = require("devtools/client/shared/vendor/redux");
 const { task, ERROR_TYPE } = require("devtools/client/shared/redux/middleware/task");
 
 /**
  * Tests that the middleware handles errors thrown in tasks, and rejected promises.
  */
 
 function run_test() {
   run_next_test();
 }
 
 add_task(function* () {
   let store = applyMiddleware(task)(createStore)(reducer);
 
   store.dispatch(generatorError());
   yield waitUntilState(store, () => store.getState().length === 1);
-  equal(store.getState()[0].type, ERROR_TYPE, "generator errors dispatch ERROR_TYPE actions");
-  equal(store.getState()[0].error, "task-middleware-error-generator", "generator errors dispatch ERROR_TYPE actions with error");
+  equal(store.getState()[0].type, ERROR_TYPE,
+        "generator errors dispatch ERROR_TYPE actions");
+  equal(store.getState()[0].error, "task-middleware-error-generator",
+        "generator errors dispatch ERROR_TYPE actions with error");
 });
 
 function generatorError() {
   return function* (dispatch, getState) {
-    throw "task-middleware-error-generator";
+    let error = "task-middleware-error-generator";
+    throw error;
   };
 }
 
 function reducer(state = [], action) {
   do_print("Action called: " + action.type);
   if (action.type === ERROR_TYPE) {
     state.push(action);
   }
--- a/devtools/client/shared/test/.eslintrc.js
+++ b/devtools/client/shared/test/.eslintrc.js
@@ -1,6 +1,9 @@
 "use strict";
 
 module.exports = {
   // Extend from the shared list of defined globals for mochitests.
-  "extends": "../../../.eslintrc.mochitests.js"
+  "extends": "../../../.eslintrc.mochitests.js",
+  "globals": {
+    "DeveloperToolbar": true
+  }
 };
--- a/devtools/client/shared/test/browser_css_angle.js
+++ b/devtools/client/shared/test/browser_css_angle.js
@@ -36,18 +36,20 @@ function testAngleUtils() {
   }
 }
 
 function testAngleValidity() {
   let data = getAngleValidityData();
 
   for (let {angle, result} of data) {
     let testAngle = new angleUtils.CssAngle(angle);
+    let validString = testAngle.valid ? " a valid" : "an invalid";
 
-    is(testAngle.valid, result, `Testing that "${angle}" is ${testAngle.valid ? " a valid" : "an invalid" } angle`);
+    is(testAngle.valid, result,
+       `Testing that "${angle}" is ${validString} angle`);
   }
 }
 
 function testToString(angle, deg, rad, grad, turn) {
   angle.angleUnit = angleUtils.CssAngle.ANGLEUNIT.deg;
   is(angle.toString(), deg, "toString() with deg type");
 
   angle.angleUnit = angleUtils.CssAngle.ANGLEUNIT.rad;
--- a/devtools/client/shared/test/browser_css_color.js
+++ b/devtools/client/shared/test/browser_css_color.js
@@ -1,21 +1,21 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 const TEST_URI = "data:text/html;charset=utf-8,browser_css_color.js";
 var {colorUtils} = require("devtools/shared/css/color");
 /* global getFixtureColorData */
 loadHelperScript("helper_color_data.js");
 
-var origColorUnit;
-
 add_task(function* () {
   yield addTab("about:blank");
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [host,, doc] = yield createHost("bottom", TEST_URI);
 
   info("Creating a test canvas element to test colors");
   let canvas = createTestCanvas(doc);
   info("Starting the test");
   testColorUtils(canvas);
 
   host.destroy();
   gBrowser.removeCurrentTab();
@@ -64,41 +64,42 @@ function testToString(color, name, hex, 
 
 function testColorMatch(name, hex, hsl, rgb, rgba, canvas) {
   let target;
   let ctx = canvas.getContext("2d");
 
   let clearCanvas = function () {
     canvas.width = 1;
   };
-  let setColor = function (aColor) {
-    ctx.fillStyle = aColor;
+  let setColor = function (color) {
+    ctx.fillStyle = color;
     ctx.fillRect(0, 0, 1, 1);
   };
   let setTargetColor = function () {
     clearCanvas();
     // All colors have rgba so we can use this to compare against.
     setColor(rgba);
     let [r, g, b, a] = ctx.getImageData(0, 0, 1, 1).data;
     target = {r: r, g: g, b: b, a: a};
   };
-  let test = function (aColor, type) {
-    let tolerance = 3; // hsla -> rgba -> hsla produces inaccurate results so we
-                       // need some tolerence here.
+  let test = function (color, type) {
+    // hsla -> rgba -> hsla produces inaccurate results so we
+    // need some tolerence here.
+    let tolerance = 3;
     clearCanvas();
 
-    setColor(aColor);
+    setColor(color);
     let [r, g, b, a] = ctx.getImageData(0, 0, 1, 1).data;
 
     let rgbFail = Math.abs(r - target.r) > tolerance ||
                   Math.abs(g - target.g) > tolerance ||
                   Math.abs(b - target.b) > tolerance;
     ok(!rgbFail, "color " + rgba + " matches target. Type: " + type);
     if (rgbFail) {
-      info("target: " + (target.toSource()) + ", color: [r: " + r + ", g: " + g + ", b: " + b + ", a: " + a + "]");
+      info(`target: ${target.toSource()}, color: [r: ${r}, g: ${g}, b: ${b}, a: ${a}]`);
     }
 
     let alphaFail = a !== target.a;
     ok(!alphaFail, "color " + rgba + " alpha value matches target.");
   };
 
   setTargetColor();
 
@@ -115,20 +116,22 @@ function testSetAlpha() {
     ["rgba", "rgba(120, 34, 23, 1)", 0.25, "rgba(120, 34, 23, 0.25)"],
     ["rgb", "rgb(120, 34, 23)", 0.25, "rgba(120, 34, 23, 0.25)"],
     ["hsl", "hsl(208, 100%, 97%)", 0.75, "rgba(240, 248, 255, 0.75)"],
     ["hsla", "hsla(208, 100%, 97%, 1)", 0.75, "rgba(240, 248, 255, 0.75)"],
     ["alphahex", "#f08f", 0.6, "rgba(255, 0, 136, 0.6)"],
     ["longalphahex", "#00ff80ff", 0.2, "rgba(0, 255, 128, 0.2)"]
   ];
   values.forEach(([type, value, alpha, expected]) => {
-    is(colorUtils.setAlpha(value, alpha), expected, "correctly sets alpha value for " + type);
+    is(colorUtils.setAlpha(value, alpha), expected,
+       "correctly sets alpha value for " + type);
   });
 
   try {
     colorUtils.setAlpha("rgb(24, 25%, 45, 1)", 1);
     ok(false, "Should fail when passing in an invalid color.");
   } catch (e) {
     ok(true, "Fails when setAlpha receives an invalid color.");
   }
 
-  is(colorUtils.setAlpha("#fff"), "rgba(255, 255, 255, 1)", "sets alpha to 1 if invalid.");
+  is(colorUtils.setAlpha("#fff"), "rgba(255, 255, 255, 1)",
+     "sets alpha to 1 if invalid.");
 }
--- a/devtools/client/shared/test/browser_cubic-bezier-01.js
+++ b/devtools/client/shared/test/browser_cubic-bezier-01.js
@@ -7,17 +7,17 @@
 // Tests that the CubicBezierWidget generates content in a given parent node
 
 const {CubicBezierWidget} =
   require("devtools/client/shared/widgets/CubicBezierWidget");
 
 const TEST_URI = `data:text/html,<div id="cubic-bezier-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [host,, doc] = yield createHost("bottom", TEST_URI);
 
   info("Checking that the graph markup is created in the parent");
   let container = doc.querySelector("#cubic-bezier-container");
   let w = new CubicBezierWidget(container);
 
   ok(container.querySelector(".display-wrap"),
     "The display has been added");
 
--- a/devtools/client/shared/test/browser_cubic-bezier-02.js
+++ b/devtools/client/shared/test/browser_cubic-bezier-02.js
@@ -106,87 +106,87 @@ function* curveCanBeClicked(widget, win,
 
 function* pointsCanBeMovedWithKeyboard(widget, win, doc, offsets) {
   info("Checking that points respond to keyboard events");
 
   let singleStep = 3;
   let shiftStep = 30;
 
   info("Moving P1 to the left");
-  let newOffset = parseInt(widget.p1.style.left) - singleStep;
-  let x = widget.bezierCanvas.
-          offsetsToCoordinates({style: {left: newOffset}})[0];
+  let newOffset = parseInt(widget.p1.style.left, 10) - singleStep;
+  let x = widget.bezierCanvas
+          .offsetsToCoordinates({style: {left: newOffset}})[0];
 
   let onUpdated = widget.once("updated");
   widget._onPointKeyDown(getKeyEvent(widget.p1, 37));
   let bezier = yield onUpdated;
 
   is(bezier.P1[0], x, "The new P1 time coordinate is correct");
   is(bezier.P1[1], 0.75, "The new P1 progress coordinate is correct");
 
   info("Moving P1 to the left, fast");
-  newOffset = parseInt(widget.p1.style.left) - shiftStep;
-  x = widget.bezierCanvas.
-      offsetsToCoordinates({style: {left: newOffset}})[0];
+  newOffset = parseInt(widget.p1.style.left, 10) - shiftStep;
+  x = widget.bezierCanvas
+      .offsetsToCoordinates({style: {left: newOffset}})[0];
 
   onUpdated = widget.once("updated");
   widget._onPointKeyDown(getKeyEvent(widget.p1, 37, true));
   bezier = yield onUpdated;
   is(bezier.P1[0], x, "The new P1 time coordinate is correct");
   is(bezier.P1[1], 0.75, "The new P1 progress coordinate is correct");
 
   info("Moving P1 to the right, fast");
-  newOffset = parseInt(widget.p1.style.left) + shiftStep;
-  x = widget.bezierCanvas.
-    offsetsToCoordinates({style: {left: newOffset}})[0];
+  newOffset = parseInt(widget.p1.style.left, 10) + shiftStep;
+  x = widget.bezierCanvas
+    .offsetsToCoordinates({style: {left: newOffset}})[0];
 
   onUpdated = widget.once("updated");
   widget._onPointKeyDown(getKeyEvent(widget.p1, 39, true));
   bezier = yield onUpdated;
   is(bezier.P1[0], x, "The new P1 time coordinate is correct");
   is(bezier.P1[1], 0.75, "The new P1 progress coordinate is correct");
 
   info("Moving P1 to the bottom");
-  newOffset = parseInt(widget.p1.style.top) + singleStep;
-  let y = widget.bezierCanvas.
-    offsetsToCoordinates({style: {top: newOffset}})[1];
+  newOffset = parseInt(widget.p1.style.top, 10) + singleStep;
+  let y = widget.bezierCanvas
+    .offsetsToCoordinates({style: {top: newOffset}})[1];
 
   onUpdated = widget.once("updated");
   widget._onPointKeyDown(getKeyEvent(widget.p1, 40));
   bezier = yield onUpdated;
   is(bezier.P1[0], x, "The new P1 time coordinate is correct");
   is(bezier.P1[1], y, "The new P1 progress coordinate is correct");
 
   info("Moving P1 to the bottom, fast");
-  newOffset = parseInt(widget.p1.style.top) + shiftStep;
-  y = widget.bezierCanvas.
-    offsetsToCoordinates({style: {top: newOffset}})[1];
+  newOffset = parseInt(widget.p1.style.top, 10) + shiftStep;
+  y = widget.bezierCanvas
+    .offsetsToCoordinates({style: {top: newOffset}})[1];
 
   onUpdated = widget.once("updated");
   widget._onPointKeyDown(getKeyEvent(widget.p1, 40, true));
   bezier = yield onUpdated;
   is(bezier.P1[0], x, "The new P1 time coordinate is correct");
   is(bezier.P1[1], y, "The new P1 progress coordinate is correct");
 
   info("Moving P1 to the top, fast");
-  newOffset = parseInt(widget.p1.style.top) - shiftStep;
-  y = widget.bezierCanvas.
-    offsetsToCoordinates({style: {top: newOffset}})[1];
+  newOffset = parseInt(widget.p1.style.top, 10) - shiftStep;
+  y = widget.bezierCanvas
+    .offsetsToCoordinates({style: {top: newOffset}})[1];
 
   onUpdated = widget.once("updated");
   widget._onPointKeyDown(getKeyEvent(widget.p1, 38, true));
   bezier = yield onUpdated;
   is(bezier.P1[0], x, "The new P1 time coordinate is correct");
   is(bezier.P1[1], y, "The new P1 progress coordinate is correct");
 
   info("Checking that keyboard events also work with P2");
   info("Moving P2 to the left");
-  newOffset = parseInt(widget.p2.style.left) - singleStep;
-  x = widget.bezierCanvas.
-    offsetsToCoordinates({style: {left: newOffset}})[0];
+  newOffset = parseInt(widget.p2.style.left, 10) - singleStep;
+  x = widget.bezierCanvas
+    .offsetsToCoordinates({style: {left: newOffset}})[0];
 
   onUpdated = widget.once("updated");
   widget._onPointKeyDown(getKeyEvent(widget.p2, 37));
   bezier = yield onUpdated;
   is(bezier.P2[0], x, "The new P2 time coordinate is correct");
   is(bezier.P2[1], 0.25, "The new P2 progress coordinate is correct");
 }
 
--- a/devtools/client/shared/test/browser_cubic-bezier-03.js
+++ b/devtools/client/shared/test/browser_cubic-bezier-03.js
@@ -8,17 +8,17 @@
 
 const {CubicBezierWidget} =
   require("devtools/client/shared/widgets/CubicBezierWidget");
 const {PREDEFINED} = require("devtools/client/shared/widgets/CubicBezierPresets");
 
 const TEST_URI = `data:text/html,<div id="cubic-bezier-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [host,, doc] = yield createHost("bottom", TEST_URI);
 
   let container = doc.querySelector("#cubic-bezier-container");
   let w = new CubicBezierWidget(container, PREDEFINED.linear);
 
   yield coordinatesCanBeChangedByProvidingAnArray(w);
   yield coordinatesCanBeChangedByProvidingAValue(w);
 
   w.destroy();
--- a/devtools/client/shared/test/browser_cubic-bezier-04.js
+++ b/devtools/client/shared/test/browser_cubic-bezier-04.js
@@ -8,17 +8,17 @@
 
 const {CubicBezierPresetWidget} =
   require("devtools/client/shared/widgets/CubicBezierWidget");
 const {PRESETS} = require("devtools/client/shared/widgets/CubicBezierPresets");
 
 const TEST_URI = `data:text/html,<div id="cubic-bezier-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [host,, doc] = yield createHost("bottom", TEST_URI);
 
   let container = doc.querySelector("#cubic-bezier-container");
   let w = new CubicBezierPresetWidget(container);
 
   info("Checking that the presets are created in the parent");
   ok(container.querySelector(".preset-pane"),
      "The preset pane has been added");
 
--- a/devtools/client/shared/test/browser_cubic-bezier-05.js
+++ b/devtools/client/shared/test/browser_cubic-bezier-05.js
@@ -9,29 +9,29 @@
 const {CubicBezierPresetWidget} =
   require("devtools/client/shared/widgets/CubicBezierWidget");
 const {PREDEFINED, PRESETS, DEFAULT_PRESET_CATEGORY} =
   require("devtools/client/shared/widgets/CubicBezierPresets");
 
 const TEST_URI = `data:text/html,<div id="cubic-bezier-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [host,, doc] = yield createHost("bottom", TEST_URI);
 
   let container = doc.querySelector("#cubic-bezier-container");
   let w = new CubicBezierPresetWidget(container);
 
   info("Checking that preset is selected if coordinates are known");
 
   w.refreshMenu([0, 0, 0, 0]);
   is(w.activeCategory, container.querySelector(`#${DEFAULT_PRESET_CATEGORY}`),
     "The default category is selected");
   is(w._activePreset, null, "There is no selected category");
 
-  w.refreshMenu(PREDEFINED["linear"]);
+  w.refreshMenu(PREDEFINED.linear);
   is(w.activeCategory, container.querySelector("#ease-in-out"),
      "The ease-in-out category is active");
   is(w._activePreset, container.querySelector("#ease-in-out-linear"),
      "The ease-in-out-linear preset is active");
 
   w.refreshMenu(PRESETS["ease-out"]["ease-out-sine"]);
   is(w.activeCategory, container.querySelector("#ease-out"),
      "The ease-out category is active");
--- a/devtools/client/shared/test/browser_devices.js
+++ b/devtools/client/shared/test/browser_devices.js
@@ -1,11 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 const {
   getDevices,
   getDeviceString,
   addDevice
 } = require("devtools/client/shared/devices");
 
 add_task(function* () {
   Services.prefs.setCharPref("devtools.devices.url",
--- a/devtools/client/shared/test/browser_filter-editor-01.js
+++ b/devtools/client/shared/test/browser_filter-editor-01.js
@@ -21,17 +21,17 @@ function verifyURL(string) {
   if (!token || token.tokenType !== "url") {
     return false;
   }
 
   return lexer.nextToken() === null;
 }
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [,, doc] = yield createHost("bottom", TEST_URI);
   const cssIsValid = getClientCssProperties().getValidityChecker(doc);
 
   const container = doc.querySelector("#filter-container");
   let widget = new CSSFilterEditorWidget(container, "none", cssIsValid);
 
   info("Test parsing of a valid CSS Filter value");
   widget.setCssValue("blur(2px) contrast(200%)");
   is(widget.getCssValue(),
--- a/devtools/client/shared/test/browser_filter-editor-02.js
+++ b/devtools/client/shared/test/browser_filter-editor-02.js
@@ -10,17 +10,17 @@ const {getClientCssProperties} = require
 
 const { LocalizationHelper } = require("devtools/shared/l10n");
 const STRINGS_URI = "devtools/client/locales/filterwidget.properties";
 const L10N = new LocalizationHelper(STRINGS_URI);
 
 const TEST_URI = `data:text/html,<div id="filter-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [,, doc] = yield createHost("bottom", TEST_URI);
   const cssIsValid = getClientCssProperties().getValidityChecker(doc);
 
   const TEST_DATA = [
     {
       cssValue: "blur(2px) contrast(200%) hue-rotate(20.2deg) drop-shadow(5px 5px black)",
       expected: [
         {
           label: "blur",
@@ -70,34 +70,32 @@ add_task(function* () {
     }
   ];
 
   const container = doc.querySelector("#filter-container");
   let widget = new CSSFilterEditorWidget(container, "none", cssIsValid);
 
   info("Test rendering of different types");
 
-
   for (let {cssValue, expected} of TEST_DATA) {
     widget.setCssValue(cssValue);
 
     if (cssValue === "none") {
       const text = container.querySelector("#filters").textContent;
       ok(text.indexOf(L10N.getStr("emptyFilterList")) > -1,
          "Contains |emptyFilterList| string when given value 'none'");
       ok(text.indexOf(L10N.getStr("addUsingList")) > -1,
          "Contains |addUsingList| string when given value 'none'");
       continue;
     }
     const filters = container.querySelectorAll(".filter");
     testRenderedFilters(filters, expected);
   }
 });
 
-
 function testRenderedFilters(filters, expected) {
   for (let [index, filter] of [...filters].entries()) {
     let [name, value] = filter.children,
       label = name.children[1],
       [input, unit] = value.children;
 
     const eq = expected[index];
     is(label.textContent, eq.label, "Label should match");
--- a/devtools/client/shared/test/browser_filter-editor-03.js
+++ b/devtools/client/shared/test/browser_filter-editor-03.js
@@ -8,17 +8,17 @@
 const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
 const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
 const GRAYSCALE_MAX = 100;
 const INVERT_MIN = 0;
 
 const TEST_URI = `data:text/html,<div id="filter-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [,, doc] = yield createHost("bottom", TEST_URI);
   const cssIsValid = getClientCssProperties().getValidityChecker(doc);
 
   const container = doc.querySelector("#filter-container");
   let widget = new CSSFilterEditorWidget(container, "none", cssIsValid);
 
   info("Test add method");
   const blur = widget.add("blur", "10.2px");
   is(widget.getCssValue(), "blur(10.2px)",
--- a/devtools/client/shared/test/browser_filter-editor-04.js
+++ b/devtools/client/shared/test/browser_filter-editor-04.js
@@ -7,17 +7,17 @@
 
 const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
 const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
 const LIST_ITEM_HEIGHT = 32;
 
 const TEST_URI = `data:text/html,<div id="filter-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [,, doc] = yield createHost("bottom", TEST_URI);
   const cssIsValid = getClientCssProperties().getValidityChecker(doc);
 
   const container = doc.querySelector("#filter-container");
   const initialValue = "blur(2px) contrast(200%) brightness(200%)";
   let widget = new CSSFilterEditorWidget(container, initialValue, cssIsValid);
 
   const filters = widget.el.querySelector("#filters");
   function first() {
@@ -25,17 +25,16 @@ add_task(function* () {
   }
   function mid() {
     return filters.children[1];
   }
   function last() {
     return filters.children[2];
   }
 
-
   info("Test re-ordering neighbour filters");
   widget._mouseDown({
     target: first().querySelector("i"),
     pageY: 0
   });
   widget._mouseMove({ pageY: LIST_ITEM_HEIGHT });
 
   // Element re-ordering should be instant
--- a/devtools/client/shared/test/browser_filter-editor-05.js
+++ b/devtools/client/shared/test/browser_filter-editor-05.js
@@ -15,21 +15,23 @@ const SLOW_VALUE_MULTIPLIER = 0.1;
 const DEFAULT_VALUE_MULTIPLIER = 1;
 
 const GRAYSCALE_MAX = 100,
   GRAYSCALE_MIN = 0;
 
 const TEST_URI = `data:text/html,<div id="filter-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [,, doc] = yield createHost("bottom", TEST_URI);
   const cssIsValid = getClientCssProperties().getValidityChecker(doc);
 
   const container = doc.querySelector("#filter-container");
-  let widget = new CSSFilterEditorWidget(container, "grayscale(0%) url(test.svg)", cssIsValid);
+  let widget = new CSSFilterEditorWidget(
+    container, "grayscale(0%) url(test.svg)", cssIsValid
+  );
 
   const filters = widget.el.querySelector("#filters");
   const grayscale = filters.children[0];
   const url = filters.children[1];
 
   info("Test label-dragging on number-type filters without modifiers");
   widget._mouseDown({
     target: grayscale.querySelector("label"),
@@ -45,29 +47,31 @@ add_task(function* () {
   });
   let expected = DEFAULT_VALUE_MULTIPLIER * 12;
   is(widget.getValueAt(0),
      `${expected}%`,
      "Should update value correctly without modifiers");
 
   info("Test label-dragging on number-type filters with alt");
   widget._mouseMove({
-    pageX: 20, // 20 - 12 = 8
+    // 20 - 12 = 8
+    pageX: 20,
     altKey: true,
     shiftKey: false
   });
 
   expected = expected + SLOW_VALUE_MULTIPLIER * 8;
   is(widget.getValueAt(0),
      `${expected}%`,
      "Should update value correctly with alt key");
 
   info("Test label-dragging on number-type filters with shift");
   widget._mouseMove({
-    pageX: 25, // 25 - 20 = 5
+    // 25 - 20 = 5
+    pageX: 25,
     altKey: false,
     shiftKey: true
   });
 
   expected = expected + FAST_VALUE_MULTIPLIER * 5;
   is(widget.getValueAt(0),
      `${expected}%`,
      "Should update value correctly with shift key");
@@ -92,17 +96,18 @@ add_task(function* () {
   expected = expected + DEFAULT_VALUE_MULTIPLIER * 5;
   is(widget.getValueAt(0),
      `${expected}%`,
      "Should reset multiplier to default");
 
   info("Test value ranges");
 
   widget._mouseMove({
-    pageX: 30, // 30 - 25 = 5
+    // 30 - 25 = 5
+    pageX: 30,
     altKey: false,
     shiftKey: true
   });
 
   expected = GRAYSCALE_MAX;
   is(widget.getValueAt(0),
      `${expected}%`,
      "Shouldn't allow values higher than max");
--- a/devtools/client/shared/test/browser_filter-editor-06.js
+++ b/devtools/client/shared/test/browser_filter-editor-06.js
@@ -10,17 +10,17 @@ const {getClientCssProperties} = require
 
 const { LocalizationHelper } = require("devtools/shared/l10n");
 const STRINGS_URI = "devtools/client/locales/filterwidget.properties";
 const L10N = new LocalizationHelper(STRINGS_URI);
 
 const TEST_URI = `data:text/html,<div id="filter-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [,, doc] = yield createHost("bottom", TEST_URI);
   const cssIsValid = getClientCssProperties().getValidityChecker(doc);
 
   const container = doc.querySelector("#filter-container");
   let widget = new CSSFilterEditorWidget(container, "none", cssIsValid);
 
   const select = widget.el.querySelector("select"),
     add = widget.el.querySelector("#add-filter");
 
--- a/devtools/client/shared/test/browser_filter-editor-07.js
+++ b/devtools/client/shared/test/browser_filter-editor-07.js
@@ -3,27 +3,25 @@
 
 "use strict";
 
 // Tests the Filter Editor Widget's remove button
 
 const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
 const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
 
-const { LocalizationHelper } = require("devtools/shared/l10n");
-const STRINGS_URI = "devtools/client/locales/filterwidget.properties";
-const L10N = new LocalizationHelper(STRINGS_URI);
-
 const TEST_URI = `data:text/html,<div id="filter-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [,, doc] = yield createHost("bottom", TEST_URI);
   const cssIsValid = getClientCssProperties().getValidityChecker(doc);
 
   const container = doc.querySelector("#filter-container");
-  let widget = new CSSFilterEditorWidget(container, "blur(2px) contrast(200%)", cssIsValid);
+  let widget = new CSSFilterEditorWidget(
+    container, "blur(2px) contrast(200%)", cssIsValid
+  );
 
   info("Test removing filters with remove button");
   widget.el.querySelector(".filter button").click();
 
   is(widget.getCssValue(), "contrast(200%)",
      "Should remove the clicked filter");
 });
--- a/devtools/client/shared/test/browser_filter-editor-08.js
+++ b/devtools/client/shared/test/browser_filter-editor-08.js
@@ -11,17 +11,17 @@ const {getClientCssProperties} = require
 
 const FAST_VALUE_MULTIPLIER = 10;
 const SLOW_VALUE_MULTIPLIER = 0.1;
 const DEFAULT_VALUE_MULTIPLIER = 1;
 
 const TEST_URI = `data:text/html,<div id="filter-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [,, doc] = yield createHost("bottom", TEST_URI);
   const cssIsValid = getClientCssProperties().getValidityChecker(doc);
 
   const container = doc.querySelector("#filter-container");
   const initialValue = "blur(2px)";
   let widget = new CSSFilterEditorWidget(container, initialValue, cssIsValid);
 
   let value = 2;
 
--- a/devtools/client/shared/test/browser_filter-editor-09.js
+++ b/devtools/client/shared/test/browser_filter-editor-09.js
@@ -11,17 +11,17 @@ const {getClientCssProperties} = require
 
 const FAST_VALUE_MULTIPLIER = 10;
 const SLOW_VALUE_MULTIPLIER = 0.1;
 const DEFAULT_VALUE_MULTIPLIER = 1;
 
 const TEST_URI = `data:text/html,<div id="filter-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [,, doc] = yield createHost("bottom", TEST_URI);
   const cssIsValid = getClientCssProperties().getValidityChecker(doc);
 
   const container = doc.querySelector("#filter-container");
   const initialValue = "drop-shadow(rgb(0, 0, 0) 1px 1px 0px)";
   let widget = new CSSFilterEditorWidget(container, initialValue, cssIsValid);
   widget.el.querySelector("#filters input").setSelectionRange(13, 13);
 
   let value = 1;
--- a/devtools/client/shared/test/browser_filter-editor-10.js
+++ b/devtools/client/shared/test/browser_filter-editor-10.js
@@ -4,24 +4,22 @@
 "use strict";
 
 // Tests the Filter Editor Widget inputs increase/decrease value when cursor is
 // on a number using arrow keys if cursor is behind/mid/after the number strings
 
 const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
 const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
 
-const FAST_VALUE_MULTIPLIER = 10;
-const SLOW_VALUE_MULTIPLIER = 0.1;
 const DEFAULT_VALUE_MULTIPLIER = 1;
 
 const TEST_URI = `data:text/html,<div id="filter-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [,, doc] = yield createHost("bottom", TEST_URI);
   const cssIsValid = getClientCssProperties().getValidityChecker(doc);
 
   const container = doc.querySelector("#filter-container");
   const initialValue = "drop-shadow(rgb(0, 0, 0) 10px 1px 0px)";
   let widget = new CSSFilterEditorWidget(container, initialValue, cssIsValid);
   const input = widget.el.querySelector("#filters input");
 
   let value = 10;
--- a/devtools/client/shared/test/browser_filter-presets-01.js
+++ b/devtools/client/shared/test/browser_filter-presets-01.js
@@ -6,17 +6,17 @@
 // Tests saving presets
 
 const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
 const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
 
 const TEST_URI = `data:text/html,<div id="filter-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [,, doc] = yield createHost("bottom", TEST_URI);
   const cssIsValid = getClientCssProperties().getValidityChecker(doc);
 
   const container = doc.querySelector("#filter-container");
   let widget = new CSSFilterEditorWidget(container, "none", cssIsValid);
   // First render
   yield widget.once("render");
 
   const VALUE = "blur(2px) contrast(150%)";
--- a/devtools/client/shared/test/browser_filter-presets-02.js
+++ b/devtools/client/shared/test/browser_filter-presets-02.js
@@ -6,17 +6,17 @@
 // Tests loading presets
 
 const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
 const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
 
 const TEST_URI = `data:text/html,<div id="filter-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [,, doc] = yield createHost("bottom", TEST_URI);
   const cssIsValid = getClientCssProperties().getValidityChecker(doc);
 
   const container = doc.querySelector("#filter-container");
   let widget = new CSSFilterEditorWidget(container, "none", cssIsValid);
   // First render
   yield widget.once("render");
 
   const VALUE = "blur(2px) contrast(150%)";
--- a/devtools/client/shared/test/browser_filter-presets-03.js
+++ b/devtools/client/shared/test/browser_filter-presets-03.js
@@ -6,17 +6,17 @@
 // Tests deleting presets
 
 const {CSSFilterEditorWidget} = require("devtools/client/shared/widgets/FilterWidget");
 const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
 
 const TEST_URI = `data:text/html,<div id="filter-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [,, doc] = yield createHost("bottom", TEST_URI);
   const cssIsValid = getClientCssProperties().getValidityChecker(doc);
 
   const container = doc.querySelector("#filter-container");
   let widget = new CSSFilterEditorWidget(container, "none", cssIsValid);
   // First render
   yield widget.once("render");
 
   const NAME = "Test";
--- a/devtools/client/shared/test/browser_flame-graph-01.js
+++ b/devtools/client/shared/test/browser_flame-graph-01.js
@@ -1,29 +1,34 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that flame graph widget works properly.
 
-var {FlameGraph} = require("devtools/client/shared/widgets/FlameGraph");
+const {FlameGraph} = require("devtools/client/shared/widgets/FlameGraph");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
-  doc.body.setAttribute("style", "position: fixed; width: 100%; height: 100%; margin: 0;");
+  let [host,, doc] = yield createHost();
+  doc.body.setAttribute("style",
+                        "position: fixed; width: 100%; height: 100%; margin: 0;");
 
   let graph = new FlameGraph(doc.body);
 
   let readyEventEmitted;
-  graph.once("ready", () => readyEventEmitted = true);
+  graph.once("ready", () => {
+    readyEventEmitted = true;
+  });
 
   yield graph.ready();
   ok(readyEventEmitted, "The 'ready' event should have been emitted");
 
   testGraph(host, graph);
 
   yield graph.destroy();
   host.destroy();
--- a/devtools/client/shared/test/browser_flame-graph-02.js
+++ b/devtools/client/shared/test/browser_flame-graph-02.js
@@ -1,24 +1,27 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that flame graph widgets may have a fixed width or height.
 
-var {FlameGraph} = require("devtools/client/shared/widgets/FlameGraph");
+const {FlameGraph} = require("devtools/client/shared/widgets/FlameGraph");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
-  doc.body.setAttribute("style", "position: fixed; width: 100%; height: 100%; margin: 0;");
+  let [host,, doc] = yield createHost();
+  doc.body.setAttribute("style",
+                        "position: fixed; width: 100%; height: 100%; margin: 0;");
 
   let graph = new FlameGraph(doc.body);
   graph.fixedWidth = 200;
   graph.fixedHeight = 100;
 
   yield graph.ready();
   testGraph(host, graph);
 
--- a/devtools/client/shared/test/browser_flame-graph-03a.js
+++ b/devtools/client/shared/test/browser_flame-graph-03a.js
@@ -1,29 +1,46 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that selections in the flame graph widget work properly.
 
-var TEST_DATA = [{ color: "#f00", blocks: [{ x: 0, y: 0, width: 50, height: 20, text: "FOO" }, { x: 50, y: 0, width: 100, height: 20, text: "BAR" }] }, { color: "#00f", blocks: [{ x: 0, y: 30, width: 30, height: 20, text: "BAZ" }] }];
-var TEST_BOUNDS = { startTime: 0, endTime: 150 };
-var TEST_WIDTH = 200;
-var TEST_HEIGHT = 100;
+const TEST_DATA = [
+  {
+    color: "#f00",
+    blocks: [
+      { x: 0, y: 0, width: 50, height: 20, text: "FOO" },
+      { x: 50, y: 0, width: 100, height: 20, text: "BAR" }
+    ]
+  },
+  {
+    color: "#00f",
+    blocks: [
+      { x: 0, y: 30, width: 30, height: 20, text: "BAZ" }
+    ]
+  }
+];
+const TEST_BOUNDS = { startTime: 0, endTime: 150 };
+const TEST_WIDTH = 200;
+const TEST_HEIGHT = 100;
 
-var {FlameGraph} = require("devtools/client/shared/widgets/FlameGraph");
+const {FlameGraph} = require("devtools/client/shared/widgets/FlameGraph");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
-  doc.body.setAttribute("style", "position: fixed; width: 100%; height: 100%; margin: 0;");
+  let [host,, doc] = yield createHost();
+  doc.body.setAttribute("style",
+                        "position: fixed; width: 100%; height: 100%; margin: 0;");
 
   let graph = new FlameGraph(doc.body, 1);
   graph.fixedWidth = TEST_WIDTH;
   graph.fixedHeight = TEST_HEIGHT;
   graph.horizontalPanThreshold = 0;
   graph.verticalPanThreshold = 0;
 
   yield graph.ready();
@@ -109,13 +126,13 @@ function dragStop(graph, x, y = 1) {
 
 var HORIZONTAL_AXIS = 1;
 var VERTICAL_AXIS = 2;
 
 function scroll(graph, wheel, axis, x, y = 1) {
   x /= window.devicePixelRatio;
   y /= window.devicePixelRatio;
   graph._onMouseMove({ testX: x, testY: y });
-  graph._onMouseWheel({ testX: x, testY: y, axis, detail: wheel, axis,
+  graph._onMouseWheel({ testX: x, testY: y, axis, detail: wheel,
     HORIZONTAL_AXIS,
     VERTICAL_AXIS
   });
 }
--- a/devtools/client/shared/test/browser_flame-graph-03b.js
+++ b/devtools/client/shared/test/browser_flame-graph-03b.js
@@ -1,30 +1,47 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that selections in the flame graph widget work properly on HiDPI.
 
-var TEST_DATA = [{ color: "#f00", blocks: [{ x: 0, y: 0, width: 50, height: 20, text: "FOO" }, { x: 50, y: 0, width: 100, height: 20, text: "BAR" }] }, { color: "#00f", blocks: [{ x: 0, y: 30, width: 30, height: 20, text: "BAZ" }] }];
-var TEST_BOUNDS = { startTime: 0, endTime: 150 };
-var TEST_WIDTH = 200;
-var TEST_HEIGHT = 100;
-var TEST_DPI_DENSITIY = 2;
+const TEST_DATA = [
+  {
+    color: "#f00",
+    blocks: [
+      { x: 0, y: 0, width: 50, height: 20, text: "FOO" },
+      { x: 50, y: 0, width: 100, height: 20, text: "BAR" }
+    ]
+  },
+  {
+    color: "#00f",
+    blocks: [
+      { x: 0, y: 30, width: 30, height: 20, text: "BAZ" }
+    ]
+  }
+];
+const TEST_BOUNDS = { startTime: 0, endTime: 150 };
+const TEST_WIDTH = 200;
+const TEST_HEIGHT = 100;
+const TEST_DPI_DENSITIY = 2;
 
 var {FlameGraph} = require("devtools/client/shared/widgets/FlameGraph");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
-  doc.body.setAttribute("style", "position: fixed; width: 100%; height: 100%; margin: 0;");
+  let [host,, doc] = yield createHost();
+  doc.body.setAttribute("style",
+                        "position: fixed; width: 100%; height: 100%; margin: 0;");
 
   let graph = new FlameGraph(doc.body, TEST_DPI_DENSITIY);
   graph.fixedWidth = TEST_WIDTH;
   graph.fixedHeight = TEST_HEIGHT;
 
   yield graph.ready();
 
   testGraph(graph);
@@ -63,13 +80,13 @@ function testGraph(graph) {
 
 var HORIZONTAL_AXIS = 1;
 var VERTICAL_AXIS = 2;
 
 function scroll(graph, wheel, axis, x, y = 1) {
   x /= window.devicePixelRatio;
   y /= window.devicePixelRatio;
   graph._onMouseMove({ testX: x, testY: y });
-  graph._onMouseWheel({ testX: x, testY: y, axis, detail: wheel, axis,
+  graph._onMouseWheel({ testX: x, testY: y, axis, detail: wheel,
     HORIZONTAL_AXIS,
     VERTICAL_AXIS
   });
 }
--- a/devtools/client/shared/test/browser_flame-graph-03c.js
+++ b/devtools/client/shared/test/browser_flame-graph-03c.js
@@ -1,30 +1,47 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that vertical panning in the flame graph widget works properly.
 
-var TEST_DATA = [{ color: "#f00", blocks: [{ x: 0, y: 0, width: 50, height: 20, text: "FOO" }, { x: 50, y: 0, width: 100, height: 20, text: "BAR" }] }, { color: "#00f", blocks: [{ x: 0, y: 30, width: 30, height: 20, text: "BAZ" }] }];
-var TEST_BOUNDS = { startTime: 0, endTime: 150 };
-var TEST_WIDTH = 200;
-var TEST_HEIGHT = 100;
-var TEST_DPI_DENSITIY = 2;
+const TEST_DATA = [
+  {
+    color: "#f00",
+    blocks: [
+      { x: 0, y: 0, width: 50, height: 20, text: "FOO" },
+      { x: 50, y: 0, width: 100, height: 20, text: "BAR" }
+    ]
+  },
+  {
+    color: "#00f",
+    blocks: [
+      { x: 0, y: 30, width: 30, height: 20, text: "BAZ" }
+    ]
+  }
+];
+const TEST_BOUNDS = { startTime: 0, endTime: 150 };
+const TEST_WIDTH = 200;
+const TEST_HEIGHT = 100;
+const TEST_DPI_DENSITIY = 2;
 
-var {FlameGraph} = require("devtools/client/shared/widgets/FlameGraph");
+const {FlameGraph} = require("devtools/client/shared/widgets/FlameGraph");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
-  doc.body.setAttribute("style", "position: fixed; width: 100%; height: 100%; margin: 0;");
+  let [host,, doc] = yield createHost();
+  doc.body.setAttribute("style",
+                        "position: fixed; width: 100%; height: 100%; margin: 0;");
 
   let graph = new FlameGraph(doc.body, TEST_DPI_DENSITIY);
   graph.fixedWidth = TEST_WIDTH;
   graph.fixedHeight = TEST_HEIGHT;
 
   yield graph.ready();
 
   testGraph(graph);
--- a/devtools/client/shared/test/browser_flame-graph-04.js
+++ b/devtools/client/shared/test/browser_flame-graph-04.js
@@ -1,27 +1,29 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that text metrics in the flame graph widget work properly.
 
-var HTML_NS = "http://www.w3.org/1999/xhtml";
-var {ELLIPSIS} = require("devtools/shared/l10n");
-var {FlameGraph} = require("devtools/client/shared/widgets/FlameGraph");
-var {FLAME_GRAPH_BLOCK_TEXT_FONT_SIZE} = require("devtools/client/shared/widgets/FlameGraph");
-var {FLAME_GRAPH_BLOCK_TEXT_FONT_FAMILY} = require("devtools/client/shared/widgets/FlameGraph");
+const HTML_NS = "http://www.w3.org/1999/xhtml";
+const {ELLIPSIS} = require("devtools/shared/l10n");
+const {FlameGraph} = require("devtools/client/shared/widgets/FlameGraph");
+const {FLAME_GRAPH_BLOCK_TEXT_FONT_SIZE} = require("devtools/client/shared/widgets/FlameGraph");
+const {FLAME_GRAPH_BLOCK_TEXT_FONT_FAMILY} = require("devtools/client/shared/widgets/FlameGraph");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new FlameGraph(doc.body, 1);
   yield graph.ready();
 
   testGraph(graph);
 
   yield graph.destroy();
   host.destroy();
 }
@@ -59,18 +61,19 @@ function testGraph(graph) {
     "The fitted text for text font size width is correct.");
 
   is(graph._getFittedText(text, 1), "",
     "The fitted text for 1px width is correct.");
 }
 
 function getAverageCharWidth() {
   let letterWidthsSum = 0;
-  let start = 32; // space
-  let end = 123; // "z"
+
+  let start = " ".charCodeAt(0);
+  let end = "z".charCodeAt(0) + 1;
 
   for (let i = start; i < end; i++) {
     let char = String.fromCharCode(i);
     letterWidthsSum += getCharWidth(char);
   }
 
   return letterWidthsSum / (end - start);
 }
--- a/devtools/client/shared/test/browser_flame-graph-05.js
+++ b/devtools/client/shared/test/browser_flame-graph-05.js
@@ -1,33 +1,49 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that flame graph widget has proper keyboard support.
 
-var TEST_DATA = [{ color: "#f00", blocks: [{ x: 0, y: 0, width: 50, height: 20, text: "FOO" }, { x: 50, y: 0, width: 100, height: 20, text: "BAR" }] }, { color: "#00f", blocks: [{ x: 0, y: 30, width: 30, height: 20, text: "BAZ" }] }];
-var TEST_BOUNDS = { startTime: 0, endTime: 150 };
-var TEST_DPI_DENSITIY = 2;
+const TEST_DATA = [
+  {
+    color: "#f00",
+    blocks: [
+      { x: 0, y: 0, width: 50, height: 20, text: "FOO" },
+      { x: 50, y: 0, width: 100, height: 20, text: "BAR" }
+    ]
+  },
+  {
+    color: "#00f",
+    blocks: [
+      { x: 0, y: 30, width: 30, height: 20, text: "BAZ" }
+    ]
+  }
+];
+const TEST_BOUNDS = { startTime: 0, endTime: 150 };
+const TEST_DPI_DENSITIY = 2;
 
 const KEY_CODE_UP = 38;
-const KEY_CODE_DOWN = 40;
 const KEY_CODE_LEFT = 37;
 const KEY_CODE_RIGHT = 39;
 
 var {FlameGraph} = require("devtools/client/shared/widgets/FlameGraph");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
-  doc.body.setAttribute("style", "position: fixed; width: 100%; height: 100%; margin: 0;");
+  let [host,, doc] = yield createHost();
+  doc.body.setAttribute("style",
+                        "position: fixed; width: 100%; height: 100%; margin: 0;");
 
   let graph = new FlameGraph(doc.body, TEST_DPI_DENSITIY);
   yield graph.ready();
 
   yield testGraph(host, graph);
 
   yield graph.destroy();
   host.destroy();
@@ -73,27 +89,25 @@ function* testGraph(host, graph) {
   let distanceLeft = graph._selection.start;
   let distanceRight = TEST_BOUNDS.endTime * TEST_DPI_DENSITIY - graph._selection.end;
 
   ok(Math.abs(distanceRight - distanceLeft) < 0.1,
     "The graph zoomed correctly towards the center point.");
 }
 
 function pressKeyForTime(graph, keyCode, ms) {
-  let deferred = defer();
-
   graph._onKeyDown({
     keyCode,
-    preventDefault: () => { },
-    stopPropagation: () => { },
+    preventDefault: () => {},
+    stopPropagation: () => {},
   });
 
-  setTimeout(() => {
-    graph._onKeyUp({
-      keyCode,
-      preventDefault: () => { },
-      stopPropagation: () => { },
-    });
-    deferred.resolve();
-  }, ms);
-
-  return deferred.promise;
+  return new Promise(resolve => {
+    setTimeout(() => {
+      graph._onKeyUp({
+        keyCode,
+        preventDefault: () => {},
+        stopPropagation: () => {},
+      });
+      resolve();
+    }, ms);
+  });
 }
--- a/devtools/client/shared/test/browser_flame-graph-utils-01.js
+++ b/devtools/client/shared/test/browser_flame-graph-utils-01.js
@@ -1,16 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that text metrics and data conversion from profiler samples
 // widget work properly in the flame graph.
 
-var {FlameGraphUtils} = require("devtools/client/shared/widgets/FlameGraph");
-var {PALLETTE_SIZE} = require("devtools/client/shared/widgets/FlameGraph");
+const {FlameGraphUtils} = require("devtools/client/shared/widgets/FlameGraph");
+const {PALLETTE_SIZE} = require("devtools/client/shared/widgets/FlameGraph");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
--- a/devtools/client/shared/test/browser_flame-graph-utils-02.js
+++ b/devtools/client/shared/test/browser_flame-graph-utils-02.js
@@ -1,15 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests consecutive duplicate frames are removed from the flame graph data.
 
-var {FlameGraphUtils} = require("devtools/client/shared/widgets/FlameGraph");
-var {PALLETTE_SIZE} = require("devtools/client/shared/widgets/FlameGraph");
+const {FlameGraphUtils} = require("devtools/client/shared/widgets/FlameGraph");
+const {PALLETTE_SIZE} = require("devtools/client/shared/widgets/FlameGraph");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
--- a/devtools/client/shared/test/browser_flame-graph-utils-03.js
+++ b/devtools/client/shared/test/browser_flame-graph-utils-03.js
@@ -1,16 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests if platform frames are removed from the flame graph data.
 
-var {FlameGraphUtils} = require("devtools/client/shared/widgets/FlameGraph");
-var {PALLETTE_SIZE} = require("devtools/client/shared/widgets/FlameGraph");
-var {FrameNode} = require("devtools/client/performance/modules/logic/tree-model");
+const {FlameGraphUtils} = require("devtools/client/shared/widgets/FlameGraph");
+const {PALLETTE_SIZE} = require("devtools/client/shared/widgets/FlameGraph");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
@@ -55,17 +56,16 @@ var TEST_DATA = synthesizeProfileForTest
   }, {
     location: "chrome://D"
   }, {
     location: "resource://E"
   }],
   time: 50,
 }]);
 
-
 var EXPECTED_OUTPUT = [{
   blocks: []
 }, {
   blocks: []
 }, {
   blocks: [{
     startTime: 0,
     frameKey: "http://A",
--- a/devtools/client/shared/test/browser_flame-graph-utils-04.js
+++ b/devtools/client/shared/test/browser_flame-graph-utils-04.js
@@ -1,16 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests if (idle) nodes are added when necessary in the flame graph data.
 
-var {FlameGraphUtils} = require("devtools/client/shared/widgets/FlameGraph");
-var {PALLETTE_SIZE} = require("devtools/client/shared/widgets/FlameGraph");
-var {FrameNode} = require("devtools/client/performance/modules/logic/tree-model");
+const {FlameGraphUtils} = require("devtools/client/shared/widgets/FlameGraph");
+const {PALLETTE_SIZE} = require("devtools/client/shared/widgets/FlameGraph");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
--- a/devtools/client/shared/test/browser_flame-graph-utils-05.js
+++ b/devtools/client/shared/test/browser_flame-graph-utils-05.js
@@ -1,31 +1,37 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that flame graph data is cached, and that the cache may be cleared.
 
-var {FlameGraphUtils} = require("devtools/client/shared/widgets/FlameGraph");
+const {FlameGraphUtils} = require("devtools/client/shared/widgets/FlameGraph");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
   let out1 = FlameGraphUtils.createFlameGraphDataFromThread(TEST_DATA);
   let out2 = FlameGraphUtils.createFlameGraphDataFromThread(TEST_DATA);
   is(out1, out2, "The outputted data is identical.");
 
-  let out3 = FlameGraphUtils.createFlameGraphDataFromThread(TEST_DATA, { flattenRecursion: true });
+  let out3 = FlameGraphUtils.createFlameGraphDataFromThread(
+    TEST_DATA, { flattenRecursion: true }
+  );
   is(out2, out3, "The outputted data is still identical.");
 
   FlameGraphUtils.removeFromCache(TEST_DATA);
-  let out4 = FlameGraphUtils.createFlameGraphDataFromThread(TEST_DATA, { flattenRecursion: true });
+  let out4 = FlameGraphUtils.createFlameGraphDataFromThread(
+    TEST_DATA, { flattenRecursion: true }
+  );
   isnot(out3, out4, "The outputted data is not identical anymore.");
 }
 
 var TEST_DATA = synthesizeProfileForTest([{
   frames: [{
     location: "A"
   }, {
     location: "A"
--- a/devtools/client/shared/test/browser_flame-graph-utils-06.js
+++ b/devtools/client/shared/test/browser_flame-graph-utils-06.js
@@ -1,18 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that the text displayed is the function name, file name and line number
 // if applicable and demangling.
 
-var {FlameGraphUtils} = require("devtools/client/shared/widgets/FlameGraph");
-var {PALLETTE_SIZE} = require("devtools/client/shared/widgets/FlameGraph");
-var MANGLED_FN = "__Z3FooIiEvv";
-var UNMANGLED_FN = "void Foo<int>()";
+const {FlameGraphUtils} = require("devtools/client/shared/widgets/FlameGraph");
+const {PALLETTE_SIZE} = require("devtools/client/shared/widgets/FlameGraph");
+const MANGLED_FN = "__Z3FooIiEvv";
+const UNMANGLED_FN = "void Foo<int>()";
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
--- a/devtools/client/shared/test/browser_flame-graph-utils-hash.js
+++ b/devtools/client/shared/test/browser_flame-graph-utils-hash.js
@@ -1,24 +1,24 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests if (idle) nodes are added when necessary in the flame graph data.
 
-var {FlameGraphUtils} = require("devtools/client/shared/widgets/FlameGraph");
+const {FlameGraphUtils} = require("devtools/client/shared/widgets/FlameGraph");
 
-var test = Task.async(function* () {
+add_task(function* () {
   let hash1 = FlameGraphUtils._getStringHash("abc");
   let hash2 = FlameGraphUtils._getStringHash("acb");
   let hash3 = FlameGraphUtils._getStringHash(Array.from(Array(100000)).join("a"));
   let hash4 = FlameGraphUtils._getStringHash(Array.from(Array(100000)).join("b"));
 
   isnot(hash1, hash2, "The hashes should not be equal (1).");
   isnot(hash2, hash3, "The hashes should not be equal (2).");
   isnot(hash3, hash4, "The hashes should not be equal (3).");
 
   ok(Number.isInteger(hash1), "The hashes should be integers, not Infinity or NaN (1).");
   ok(Number.isInteger(hash2), "The hashes should be integers, not Infinity or NaN (2).");
   ok(Number.isInteger(hash3), "The hashes should be integers, not Infinity or NaN (3).");
   ok(Number.isInteger(hash4), "The hashes should be integers, not Infinity or NaN (4).");
-
-  finish();
 });
--- a/devtools/client/shared/test/browser_graphs-01.js
+++ b/devtools/client/shared/test/browser_graphs-01.js
@@ -1,30 +1,35 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that graph widgets works properly.
 
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
   finish();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
-  doc.body.setAttribute("style", "position: fixed; width: 100%; height: 100%; margin: 0;");
+  let [host,, doc] = yield createHost();
+  doc.body.setAttribute("style",
+                        "position: fixed; width: 100%; height: 100%; margin: 0;");
 
   let graph = new LineGraphWidget(doc.body, "fps");
 
   let readyEventEmitted;
-  graph.once("ready", () => readyEventEmitted = true);
+  graph.once("ready", () => {
+    readyEventEmitted = true;
+  });
 
   yield graph.ready();
   ok(readyEventEmitted, "The 'ready' event should have been emitted");
 
   testGraph(host, graph);
 
   yield graph.destroy();
   host.destroy();
--- a/devtools/client/shared/test/browser_graphs-02.js
+++ b/devtools/client/shared/test/browser_graphs-02.js
@@ -1,25 +1,48 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that graph widgets can properly add data, regions and highlights.
 
-const TEST_DATA = [{ delta: 112, value: 48 }, { delta: 213, value: 59 }, { delta: 313, value: 60 }, { delta: 413, value: 59 }, { delta: 530, value: 59 }, { delta: 646, value: 58 }, { delta: 747, value: 60 }, { delta: 863, value: 48 }, { delta: 980, value: 37 }, { delta: 1097, value: 30 }, { delta: 1213, value: 29 }, { delta: 1330, value: 23 }, { delta: 1430, value: 10 }, { delta: 1534, value: 17 }, { delta: 1645, value: 20 }, { delta: 1746, value: 22 }, { delta: 1846, value: 39 }, { delta: 1963, value: 26 }, { delta: 2080, value: 27 }, { delta: 2197, value: 35 }, { delta: 2312, value: 47 }, { delta: 2412, value: 53 }, { delta: 2514, value: 60 }, { delta: 2630, value: 37 }, { delta: 2730, value: 36 }, { delta: 2830, value: 37 }, { delta: 2946, value: 36 }, { delta: 3046, value: 40 }, { delta: 3163, value: 47 }, { delta: 3280, value: 41 }, { delta: 3380, value: 35 }, { delta: 3480, value: 27 }, { delta: 3580, value: 39 }, { delta: 3680, value: 42 }, { delta: 3780, value: 49 }, { delta: 3880, value: 55 }, { delta: 3980, value: 60 }, { delta: 4080, value: 60 }, { delta: 4180, value: 60 }];
+const TEST_DATA = [
+  { delta: 112, value: 48 }, { delta: 213, value: 59 },
+  { delta: 313, value: 60 }, { delta: 413, value: 59 },
+  { delta: 530, value: 59 }, { delta: 646, value: 58 },
+  { delta: 747, value: 60 }, { delta: 863, value: 48 },
+  { delta: 980, value: 37 }, { delta: 1097, value: 30 },
+  { delta: 1213, value: 29 }, { delta: 1330, value: 23 },
+  { delta: 1430, value: 10 }, { delta: 1534, value: 17 },
+  { delta: 1645, value: 20 }, { delta: 1746, value: 22 },
+  { delta: 1846, value: 39 }, { delta: 1963, value: 26 },
+  { delta: 2080, value: 27 }, { delta: 2197, value: 35 },
+  { delta: 2312, value: 47 }, { delta: 2412, value: 53 },
+  { delta: 2514, value: 60 }, { delta: 2630, value: 37 },
+  { delta: 2730, value: 36 }, { delta: 2830, value: 37 },
+  { delta: 2946, value: 36 }, { delta: 3046, value: 40 },
+  { delta: 3163, value: 47 }, { delta: 3280, value: 41 },
+  { delta: 3380, value: 35 }, { delta: 3480, value: 27 },
+  { delta: 3580, value: 39 }, { delta: 3680, value: 42 },
+  { delta: 3780, value: 49 }, { delta: 3880, value: 55 },
+  { delta: 3980, value: 60 }, { delta: 4080, value: 60 },
+  { delta: 4180, value: 60 }
+];
 const TEST_REGIONS = [{ start: 320, end: 460 }, { start: 780, end: 860 }];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
   yield graph.once("ready");
 
   testDataAndRegions(graph);
   testHighlights(graph);
 
   yield graph.destroy();
   host.destroy();
@@ -44,21 +67,23 @@ function testDataAndRegions(graph) {
     thrown2 = true;
   }
   ok(thrown2, "Setting regions twice shouldn't work.");
 
   ok(graph.hasData(), "The graph should now have the data source set.");
   ok(graph.hasRegions(), "The graph should now have the regions set.");
 
   is(graph.dataScaleX,
-     graph.width / 4180, // last & first tick in TEST_DATA
+     // last & first tick in TEST_DATA
+     graph.width / 4180,
     "The data scale on the X axis is correct.");
 
   is(graph.dataScaleY,
-     graph.height / 60 * 0.85, // max value in TEST_DATA * GRAPH_DAMPEN_VALUES
+     // max value in TEST_DATA * GRAPH_DAMPEN_VALUES
+     graph.height / 60 * 0.85,
     "The data scale on the Y axis is correct.");
 
   for (let i = 0; i < TEST_REGIONS.length; i++) {
     let original = TEST_REGIONS[i];
     let normalized = graph._regions[i];
 
     is(original.start * graph.dataScaleX, normalized.start,
       "The region's start value was properly normalized.");
--- a/devtools/client/shared/test/browser_graphs-03.js
+++ b/devtools/client/shared/test/browser_graphs-03.js
@@ -1,24 +1,26 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that graph widgets can handle clients getting/setting the
 // selection or cursor.
 
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
   yield graph.once("ready");
 
   yield testSelection(graph);
   yield testCursor(graph);
 
   yield graph.destroy();
   host.destroy();
--- a/devtools/client/shared/test/browser_graphs-04.js
+++ b/devtools/client/shared/test/browser_graphs-04.js
@@ -1,23 +1,25 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that graph widgets can correctly compare selections and cursors.
 
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
   yield graph.once("ready");
 
   testGraph(graph);
 
   yield graph.destroy();
   host.destroy();
 }
--- a/devtools/client/shared/test/browser_graphs-05.js
+++ b/devtools/client/shared/test/browser_graphs-05.js
@@ -1,25 +1,48 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that graph widgets can correctly determine which regions are hovered.
 
-const TEST_DATA = [{ delta: 112, value: 48 }, { delta: 213, value: 59 }, { delta: 313, value: 60 }, { delta: 413, value: 59 }, { delta: 530, value: 59 }, { delta: 646, value: 58 }, { delta: 747, value: 60 }, { delta: 863, value: 48 }, { delta: 980, value: 37 }, { delta: 1097, value: 30 }, { delta: 1213, value: 29 }, { delta: 1330, value: 23 }, { delta: 1430, value: 10 }, { delta: 1534, value: 17 }, { delta: 1645, value: 20 }, { delta: 1746, value: 22 }, { delta: 1846, value: 39 }, { delta: 1963, value: 26 }, { delta: 2080, value: 27 }, { delta: 2197, value: 35 }, { delta: 2312, value: 47 }, { delta: 2412, value: 53 }, { delta: 2514, value: 60 }, { delta: 2630, value: 37 }, { delta: 2730, value: 36 }, { delta: 2830, value: 37 }, { delta: 2946, value: 36 }, { delta: 3046, value: 40 }, { delta: 3163, value: 47 }, { delta: 3280, value: 41 }, { delta: 3380, value: 35 }, { delta: 3480, value: 27 }, { delta: 3580, value: 39 }, { delta: 3680, value: 42 }, { delta: 3780, value: 49 }, { delta: 3880, value: 55 }, { delta: 3980, value: 60 }, { delta: 4080, value: 60 }, { delta: 4180, value: 60 }];
+const TEST_DATA = [
+  { delta: 112, value: 48 }, { delta: 213, value: 59 },
+  { delta: 313, value: 60 }, { delta: 413, value: 59 },
+  { delta: 530, value: 59 }, { delta: 646, value: 58 },
+  { delta: 747, value: 60 }, { delta: 863, value: 48 },
+  { delta: 980, value: 37 }, { delta: 1097, value: 30 },
+  { delta: 1213, value: 29 }, { delta: 1330, value: 23 },
+  { delta: 1430, value: 10 }, { delta: 1534, value: 17 },
+  { delta: 1645, value: 20 }, { delta: 1746, value: 22 },
+  { delta: 1846, value: 39 }, { delta: 1963, value: 26 },
+  { delta: 2080, value: 27 }, { delta: 2197, value: 35 },
+  { delta: 2312, value: 47 }, { delta: 2412, value: 53 },
+  { delta: 2514, value: 60 }, { delta: 2630, value: 37 },
+  { delta: 2730, value: 36 }, { delta: 2830, value: 37 },
+  { delta: 2946, value: 36 }, { delta: 3046, value: 40 },
+  { delta: 3163, value: 47 }, { delta: 3280, value: 41 },
+  { delta: 3380, value: 35 }, { delta: 3480, value: 27 },
+  { delta: 3580, value: 39 }, { delta: 3680, value: 42 },
+  { delta: 3780, value: 49 }, { delta: 3880, value: 55 },
+  { delta: 3980, value: 60 }, { delta: 4080, value: 60 },
+  { delta: 4180, value: 60 }
+];
 const TEST_REGIONS = [{ start: 320, end: 460 }, { start: 780, end: 860 }];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
   yield graph.once("ready");
 
   testGraph(graph);
 
   yield graph.destroy();
   host.destroy();
 }
--- a/devtools/client/shared/test/browser_graphs-06.js
+++ b/devtools/client/shared/test/browser_graphs-06.js
@@ -1,25 +1,48 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests if clicking on regions adds a selection spanning that region.
 
-const TEST_DATA = [{ delta: 112, value: 48 }, { delta: 213, value: 59 }, { delta: 313, value: 60 }, { delta: 413, value: 59 }, { delta: 530, value: 59 }, { delta: 646, value: 58 }, { delta: 747, value: 60 }, { delta: 863, value: 48 }, { delta: 980, value: 37 }, { delta: 1097, value: 30 }, { delta: 1213, value: 29 }, { delta: 1330, value: 23 }, { delta: 1430, value: 10 }, { delta: 1534, value: 17 }, { delta: 1645, value: 20 }, { delta: 1746, value: 22 }, { delta: 1846, value: 39 }, { delta: 1963, value: 26 }, { delta: 2080, value: 27 }, { delta: 2197, value: 35 }, { delta: 2312, value: 47 }, { delta: 2412, value: 53 }, { delta: 2514, value: 60 }, { delta: 2630, value: 37 }, { delta: 2730, value: 36 }, { delta: 2830, value: 37 }, { delta: 2946, value: 36 }, { delta: 3046, value: 40 }, { delta: 3163, value: 47 }, { delta: 3280, value: 41 }, { delta: 3380, value: 35 }, { delta: 3480, value: 27 }, { delta: 3580, value: 39 }, { delta: 3680, value: 42 }, { delta: 3780, value: 49 }, { delta: 3880, value: 55 }, { delta: 3980, value: 60 }, { delta: 4080, value: 60 }, { delta: 4180, value: 60 }];
+const TEST_DATA = [
+  { delta: 112, value: 48 }, { delta: 213, value: 59 },
+  { delta: 313, value: 60 }, { delta: 413, value: 59 },
+  { delta: 530, value: 59 }, { delta: 646, value: 58 },
+  { delta: 747, value: 60 }, { delta: 863, value: 48 },
+  { delta: 980, value: 37 }, { delta: 1097, value: 30 },
+  { delta: 1213, value: 29 }, { delta: 1330, value: 23 },
+  { delta: 1430, value: 10 }, { delta: 1534, value: 17 },
+  { delta: 1645, value: 20 }, { delta: 1746, value: 22 },
+  { delta: 1846, value: 39 }, { delta: 1963, value: 26 },
+  { delta: 2080, value: 27 }, { delta: 2197, value: 35 },
+  { delta: 2312, value: 47 }, { delta: 2412, value: 53 },
+  { delta: 2514, value: 60 }, { delta: 2630, value: 37 },
+  { delta: 2730, value: 36 }, { delta: 2830, value: 37 },
+  { delta: 2946, value: 36 }, { delta: 3046, value: 40 },
+  { delta: 3163, value: 47 }, { delta: 3280, value: 41 },
+  { delta: 3380, value: 35 }, { delta: 3480, value: 27 },
+  { delta: 3580, value: 39 }, { delta: 3680, value: 42 },
+  { delta: 3780, value: 49 }, { delta: 3880, value: 55 },
+  { delta: 3980, value: 60 }, { delta: 4080, value: 60 },
+  { delta: 4180, value: 60 }
+];
 const TEST_REGIONS = [{ start: 320, end: 460 }, { start: 780, end: 860 }];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
   yield graph.once("ready");
 
   testGraph(graph);
 
   yield graph.destroy();
   host.destroy();
 }
--- a/devtools/client/shared/test/browser_graphs-07a.js
+++ b/devtools/client/shared/test/browser_graphs-07a.js
@@ -1,24 +1,47 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests if selecting, resizing, moving selections and zooming in/out works.
 
-const TEST_DATA = [{ delta: 112, value: 48 }, { delta: 213, value: 59 }, { delta: 313, value: 60 }, { delta: 413, value: 59 }, { delta: 530, value: 59 }, { delta: 646, value: 58 }, { delta: 747, value: 60 }, { delta: 863, value: 48 }, { delta: 980, value: 37 }, { delta: 1097, value: 30 }, { delta: 1213, value: 29 }, { delta: 1330, value: 23 }, { delta: 1430, value: 10 }, { delta: 1534, value: 17 }, { delta: 1645, value: 20 }, { delta: 1746, value: 22 }, { delta: 1846, value: 39 }, { delta: 1963, value: 26 }, { delta: 2080, value: 27 }, { delta: 2197, value: 35 }, { delta: 2312, value: 47 }, { delta: 2412, value: 53 }, { delta: 2514, value: 60 }, { delta: 2630, value: 37 }, { delta: 2730, value: 36 }, { delta: 2830, value: 37 }, { delta: 2946, value: 36 }, { delta: 3046, value: 40 }, { delta: 3163, value: 47 }, { delta: 3280, value: 41 }, { delta: 3380, value: 35 }, { delta: 3480, value: 27 }, { delta: 3580, value: 39 }, { delta: 3680, value: 42 }, { delta: 3780, value: 49 }, { delta: 3880, value: 55 }, { delta: 3980, value: 60 }, { delta: 4080, value: 60 }, { delta: 4180, value: 60 }];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const TEST_DATA = [
+  { delta: 112, value: 48 }, { delta: 213, value: 59 },
+  { delta: 313, value: 60 }, { delta: 413, value: 59 },
+  { delta: 530, value: 59 }, { delta: 646, value: 58 },
+  { delta: 747, value: 60 }, { delta: 863, value: 48 },
+  { delta: 980, value: 37 }, { delta: 1097, value: 30 },
+  { delta: 1213, value: 29 }, { delta: 1330, value: 23 },
+  { delta: 1430, value: 10 }, { delta: 1534, value: 17 },
+  { delta: 1645, value: 20 }, { delta: 1746, value: 22 },
+  { delta: 1846, value: 39 }, { delta: 1963, value: 26 },
+  { delta: 2080, value: 27 }, { delta: 2197, value: 35 },
+  { delta: 2312, value: 47 }, { delta: 2412, value: 53 },
+  { delta: 2514, value: 60 }, { delta: 2630, value: 37 },
+  { delta: 2730, value: 36 }, { delta: 2830, value: 37 },
+  { delta: 2946, value: 36 }, { delta: 3046, value: 40 },
+  { delta: 3163, value: 47 }, { delta: 3280, value: 41 },
+  { delta: 3380, value: 35 }, { delta: 3480, value: 27 },
+  { delta: 3580, value: 39 }, { delta: 3680, value: 42 },
+  { delta: 3780, value: 49 }, { delta: 3880, value: 55 },
+  { delta: 3980, value: 60 }, { delta: 4080, value: 60 },
+  { delta: 4180, value: 60 }
+];
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
   yield graph.once("ready");
   testGraph(graph, normalDragStop);
   yield graph.destroy();
 
   let graph2 = new LineGraphWidget(doc.body, "fps");
   yield graph2.once("ready");
   testGraph(graph2, buggyDragStop);
@@ -169,24 +192,16 @@ function testGraph(graph, dragStop) {
 // EventUtils just doesn't work!
 
 function hover(graph, x, y = 1) {
   x /= window.devicePixelRatio;
   y /= window.devicePixelRatio;
   graph._onMouseMove({ testX: x, testY: y });
 }
 
-function click(graph, x, y = 1) {
-  x /= window.devicePixelRatio;
-  y /= window.devicePixelRatio;
-  graph._onMouseMove({ testX: x, testY: y });
-  graph._onMouseDown({ testX: x, testY: y });
-  graph._onMouseUp({ testX: x, testY: y });
-}
-
 function dragStart(graph, x, y = 1) {
   x /= window.devicePixelRatio;
   y /= window.devicePixelRatio;
   graph._onMouseMove({ testX: x, testY: y });
   graph._onMouseDown({ testX: x, testY: y });
 }
 
 function normalDragStop(graph, x, y = 1) {
--- a/devtools/client/shared/test/browser_graphs-07b.js
+++ b/devtools/client/shared/test/browser_graphs-07b.js
@@ -1,24 +1,47 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests if selections can't be added via clicking, while not allowed.
 
-const TEST_DATA = [{ delta: 112, value: 48 }, { delta: 213, value: 59 }, { delta: 313, value: 60 }, { delta: 413, value: 59 }, { delta: 530, value: 59 }, { delta: 646, value: 58 }, { delta: 747, value: 60 }, { delta: 863, value: 48 }, { delta: 980, value: 37 }, { delta: 1097, value: 30 }, { delta: 1213, value: 29 }, { delta: 1330, value: 23 }, { delta: 1430, value: 10 }, { delta: 1534, value: 17 }, { delta: 1645, value: 20 }, { delta: 1746, value: 22 }, { delta: 1846, value: 39 }, { delta: 1963, value: 26 }, { delta: 2080, value: 27 }, { delta: 2197, value: 35 }, { delta: 2312, value: 47 }, { delta: 2412, value: 53 }, { delta: 2514, value: 60 }, { delta: 2630, value: 37 }, { delta: 2730, value: 36 }, { delta: 2830, value: 37 }, { delta: 2946, value: 36 }, { delta: 3046, value: 40 }, { delta: 3163, value: 47 }, { delta: 3280, value: 41 }, { delta: 3380, value: 35 }, { delta: 3480, value: 27 }, { delta: 3580, value: 39 }, { delta: 3680, value: 42 }, { delta: 3780, value: 49 }, { delta: 3880, value: 55 }, { delta: 3980, value: 60 }, { delta: 4080, value: 60 }, { delta: 4180, value: 60 }];
+const TEST_DATA = [
+  { delta: 112, value: 48 }, { delta: 213, value: 59 },
+  { delta: 313, value: 60 }, { delta: 413, value: 59 },
+  { delta: 530, value: 59 }, { delta: 646, value: 58 },
+  { delta: 747, value: 60 }, { delta: 863, value: 48 },
+  { delta: 980, value: 37 }, { delta: 1097, value: 30 },
+  { delta: 1213, value: 29 }, { delta: 1330, value: 23 },
+  { delta: 1430, value: 10 }, { delta: 1534, value: 17 },
+  { delta: 1645, value: 20 }, { delta: 1746, value: 22 },
+  { delta: 1846, value: 39 }, { delta: 1963, value: 26 },
+  { delta: 2080, value: 27 }, { delta: 2197, value: 35 },
+  { delta: 2312, value: 47 }, { delta: 2412, value: 53 },
+  { delta: 2514, value: 60 }, { delta: 2630, value: 37 },
+  { delta: 2730, value: 36 }, { delta: 2830, value: 37 },
+  { delta: 2946, value: 36 }, { delta: 3046, value: 40 },
+  { delta: 3163, value: 47 }, { delta: 3280, value: 41 },
+  { delta: 3380, value: 35 }, { delta: 3480, value: 27 },
+  { delta: 3580, value: 39 }, { delta: 3680, value: 42 },
+  { delta: 3780, value: 49 }, { delta: 3880, value: 55 },
+  { delta: 3980, value: 60 }, { delta: 4080, value: 60 },
+  { delta: 4180, value: 60 }
+];
 var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
   yield graph.once("ready");
 
   testGraph(graph);
 
   yield graph.destroy();
   host.destroy();
 }
--- a/devtools/client/shared/test/browser_graphs-07c.js
+++ b/devtools/client/shared/test/browser_graphs-07c.js
@@ -1,26 +1,49 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests if movement via event dispatching using screenX / screenY
 // works.  All of the other tests directly use the graph's mouse event
 // callbacks with textX / testY for convenience.
 
-const TEST_DATA = [{ delta: 112, value: 48 }, { delta: 213, value: 59 }, { delta: 313, value: 60 }, { delta: 413, value: 59 }, { delta: 530, value: 59 }, { delta: 646, value: 58 }, { delta: 747, value: 60 }, { delta: 863, value: 48 }, { delta: 980, value: 37 }, { delta: 1097, value: 30 }, { delta: 1213, value: 29 }, { delta: 1330, value: 23 }, { delta: 1430, value: 10 }, { delta: 1534, value: 17 }, { delta: 1645, value: 20 }, { delta: 1746, value: 22 }, { delta: 1846, value: 39 }, { delta: 1963, value: 26 }, { delta: 2080, value: 27 }, { delta: 2197, value: 35 }, { delta: 2312, value: 47 }, { delta: 2412, value: 53 }, { delta: 2514, value: 60 }, { delta: 2630, value: 37 }, { delta: 2730, value: 36 }, { delta: 2830, value: 37 }, { delta: 2946, value: 36 }, { delta: 3046, value: 40 }, { delta: 3163, value: 47 }, { delta: 3280, value: 41 }, { delta: 3380, value: 35 }, { delta: 3480, value: 27 }, { delta: 3580, value: 39 }, { delta: 3680, value: 42 }, { delta: 3780, value: 49 }, { delta: 3880, value: 55 }, { delta: 3980, value: 60 }, { delta: 4080, value: 60 }, { delta: 4180, value: 60 }];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const TEST_DATA = [
+  { delta: 112, value: 48 }, { delta: 213, value: 59 },
+  { delta: 313, value: 60 }, { delta: 413, value: 59 },
+  { delta: 530, value: 59 }, { delta: 646, value: 58 },
+  { delta: 747, value: 60 }, { delta: 863, value: 48 },
+  { delta: 980, value: 37 }, { delta: 1097, value: 30 },
+  { delta: 1213, value: 29 }, { delta: 1330, value: 23 },
+  { delta: 1430, value: 10 }, { delta: 1534, value: 17 },
+  { delta: 1645, value: 20 }, { delta: 1746, value: 22 },
+  { delta: 1846, value: 39 }, { delta: 1963, value: 26 },
+  { delta: 2080, value: 27 }, { delta: 2197, value: 35 },
+  { delta: 2312, value: 47 }, { delta: 2412, value: 53 },
+  { delta: 2514, value: 60 }, { delta: 2630, value: 37 },
+  { delta: 2730, value: 36 }, { delta: 2830, value: 37 },
+  { delta: 2946, value: 36 }, { delta: 3046, value: 40 },
+  { delta: 3163, value: 47 }, { delta: 3280, value: 41 },
+  { delta: 3380, value: 35 }, { delta: 3480, value: 27 },
+  { delta: 3580, value: 39 }, { delta: 3680, value: 42 },
+  { delta: 3780, value: 49 }, { delta: 3880, value: 55 },
+  { delta: 3980, value: 60 }, { delta: 4080, value: 60 },
+  { delta: 4180, value: 60 }
+];
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
   yield graph.once("ready");
   testGraph(graph);
   yield graph.destroy();
   host.destroy();
 }
 
 function testGraph(graph) {
--- a/devtools/client/shared/test/browser_graphs-07d.js
+++ b/devtools/client/shared/test/browser_graphs-07d.js
@@ -1,25 +1,48 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that selections are drawn onto the canvas.
 
-const TEST_DATA = [{ delta: 112, value: 48 }, { delta: 213, value: 59 }, { delta: 313, value: 60 }, { delta: 413, value: 59 }, { delta: 530, value: 59 }, { delta: 646, value: 58 }, { delta: 747, value: 60 }, { delta: 863, value: 48 }, { delta: 980, value: 37 }, { delta: 1097, value: 30 }, { delta: 1213, value: 29 }, { delta: 1330, value: 23 }, { delta: 1430, value: 10 }, { delta: 1534, value: 17 }, { delta: 1645, value: 20 }, { delta: 1746, value: 22 }, { delta: 1846, value: 39 }, { delta: 1963, value: 26 }, { delta: 2080, value: 27 }, { delta: 2197, value: 35 }, { delta: 2312, value: 47 }, { delta: 2412, value: 53 }, { delta: 2514, value: 60 }, { delta: 2630, value: 37 }, { delta: 2730, value: 36 }, { delta: 2830, value: 37 }, { delta: 2946, value: 36 }, { delta: 3046, value: 40 }, { delta: 3163, value: 47 }, { delta: 3280, value: 41 }, { delta: 3380, value: 35 }, { delta: 3480, value: 27 }, { delta: 3580, value: 39 }, { delta: 3680, value: 42 }, { delta: 3780, value: 49 }, { delta: 3880, value: 55 }, { delta: 3980, value: 60 }, { delta: 4080, value: 60 }, { delta: 4180, value: 60 }];
+const TEST_DATA = [
+  { delta: 112, value: 48 }, { delta: 213, value: 59 },
+  { delta: 313, value: 60 }, { delta: 413, value: 59 },
+  { delta: 530, value: 59 }, { delta: 646, value: 58 },
+  { delta: 747, value: 60 }, { delta: 863, value: 48 },
+  { delta: 980, value: 37 }, { delta: 1097, value: 30 },
+  { delta: 1213, value: 29 }, { delta: 1330, value: 23 },
+  { delta: 1430, value: 10 }, { delta: 1534, value: 17 },
+  { delta: 1645, value: 20 }, { delta: 1746, value: 22 },
+  { delta: 1846, value: 39 }, { delta: 1963, value: 26 },
+  { delta: 2080, value: 27 }, { delta: 2197, value: 35 },
+  { delta: 2312, value: 47 }, { delta: 2412, value: 53 },
+  { delta: 2514, value: 60 }, { delta: 2630, value: 37 },
+  { delta: 2730, value: 36 }, { delta: 2830, value: 37 },
+  { delta: 2946, value: 36 }, { delta: 3046, value: 40 },
+  { delta: 3163, value: 47 }, { delta: 3280, value: 41 },
+  { delta: 3380, value: 35 }, { delta: 3480, value: 27 },
+  { delta: 3580, value: 39 }, { delta: 3680, value: 42 },
+  { delta: 3780, value: 49 }, { delta: 3880, value: 55 },
+  { delta: 3980, value: 60 }, { delta: 4080, value: 60 },
+  { delta: 4180, value: 60 }
+];
 const TEST_REGIONS = [{ start: 320, end: 460 }, { start: 780, end: 860 }];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
   yield graph.once("ready");
 
   testGraph(graph);
 
   yield graph.destroy();
   host.destroy();
 }
--- a/devtools/client/shared/test/browser_graphs-07e.js
+++ b/devtools/client/shared/test/browser_graphs-07e.js
@@ -1,25 +1,48 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that selections are drawn onto the canvas.
 
-const TEST_DATA = [{ delta: 112, value: 48 }, { delta: 213, value: 59 }, { delta: 313, value: 60 }, { delta: 413, value: 59 }, { delta: 530, value: 59 }, { delta: 646, value: 58 }, { delta: 747, value: 60 }, { delta: 863, value: 48 }, { delta: 980, value: 37 }, { delta: 1097, value: 30 }, { delta: 1213, value: 29 }, { delta: 1330, value: 23 }, { delta: 1430, value: 10 }, { delta: 1534, value: 17 }, { delta: 1645, value: 20 }, { delta: 1746, value: 22 }, { delta: 1846, value: 39 }, { delta: 1963, value: 26 }, { delta: 2080, value: 27 }, { delta: 2197, value: 35 }, { delta: 2312, value: 47 }, { delta: 2412, value: 53 }, { delta: 2514, value: 60 }, { delta: 2630, value: 37 }, { delta: 2730, value: 36 }, { delta: 2830, value: 37 }, { delta: 2946, value: 36 }, { delta: 3046, value: 40 }, { delta: 3163, value: 47 }, { delta: 3280, value: 41 }, { delta: 3380, value: 35 }, { delta: 3480, value: 27 }, { delta: 3580, value: 39 }, { delta: 3680, value: 42 }, { delta: 3780, value: 49 }, { delta: 3880, value: 55 }, { delta: 3980, value: 60 }, { delta: 4080, value: 60 }, { delta: 4180, value: 60 }];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
-var CURRENT_ZOOM = 1;
+const TEST_DATA = [
+  { delta: 112, value: 48 }, { delta: 213, value: 59 },
+  { delta: 313, value: 60 }, { delta: 413, value: 59 },
+  { delta: 530, value: 59 }, { delta: 646, value: 58 },
+  { delta: 747, value: 60 }, { delta: 863, value: 48 },
+  { delta: 980, value: 37 }, { delta: 1097, value: 30 },
+  { delta: 1213, value: 29 }, { delta: 1330, value: 23 },
+  { delta: 1430, value: 10 }, { delta: 1534, value: 17 },
+  { delta: 1645, value: 20 }, { delta: 1746, value: 22 },
+  { delta: 1846, value: 39 }, { delta: 1963, value: 26 },
+  { delta: 2080, value: 27 }, { delta: 2197, value: 35 },
+  { delta: 2312, value: 47 }, { delta: 2412, value: 53 },
+  { delta: 2514, value: 60 }, { delta: 2630, value: 37 },
+  { delta: 2730, value: 36 }, { delta: 2830, value: 37 },
+  { delta: 2946, value: 36 }, { delta: 3046, value: 40 },
+  { delta: 3163, value: 47 }, { delta: 3280, value: 41 },
+  { delta: 3380, value: 35 }, { delta: 3480, value: 27 },
+  { delta: 3580, value: 39 }, { delta: 3680, value: 42 },
+  { delta: 3780, value: 49 }, { delta: 3880, value: 55 },
+  { delta: 3980, value: 60 }, { delta: 4080, value: 60 },
+  { delta: 4180, value: 60 }
+];
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+let CURRENT_ZOOM = 1;
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
   yield graph.once("ready");
   graph.setData(TEST_DATA);
 
   info("Testing with normal zoom.");
   testGraph(graph);
 
   info("Testing while zoomed out.");
--- a/devtools/client/shared/test/browser_graphs-08.js
+++ b/devtools/client/shared/test/browser_graphs-08.js
@@ -1,24 +1,47 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests if a selection is dropped when clicking outside of it.
 
-const TEST_DATA = [{ delta: 112, value: 48 }, { delta: 213, value: 59 }, { delta: 313, value: 60 }, { delta: 413, value: 59 }, { delta: 530, value: 59 }, { delta: 646, value: 58 }, { delta: 747, value: 60 }, { delta: 863, value: 48 }, { delta: 980, value: 37 }, { delta: 1097, value: 30 }, { delta: 1213, value: 29 }, { delta: 1330, value: 23 }, { delta: 1430, value: 10 }, { delta: 1534, value: 17 }, { delta: 1645, value: 20 }, { delta: 1746, value: 22 }, { delta: 1846, value: 39 }, { delta: 1963, value: 26 }, { delta: 2080, value: 27 }, { delta: 2197, value: 35 }, { delta: 2312, value: 47 }, { delta: 2412, value: 53 }, { delta: 2514, value: 60 }, { delta: 2630, value: 37 }, { delta: 2730, value: 36 }, { delta: 2830, value: 37 }, { delta: 2946, value: 36 }, { delta: 3046, value: 40 }, { delta: 3163, value: 47 }, { delta: 3280, value: 41 }, { delta: 3380, value: 35 }, { delta: 3480, value: 27 }, { delta: 3580, value: 39 }, { delta: 3680, value: 42 }, { delta: 3780, value: 49 }, { delta: 3880, value: 55 }, { delta: 3980, value: 60 }, { delta: 4080, value: 60 }, { delta: 4180, value: 60 }];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const TEST_DATA = [
+  { delta: 112, value: 48 }, { delta: 213, value: 59 },
+  { delta: 313, value: 60 }, { delta: 413, value: 59 },
+  { delta: 530, value: 59 }, { delta: 646, value: 58 },
+  { delta: 747, value: 60 }, { delta: 863, value: 48 },
+  { delta: 980, value: 37 }, { delta: 1097, value: 30 },
+  { delta: 1213, value: 29 }, { delta: 1330, value: 23 },
+  { delta: 1430, value: 10 }, { delta: 1534, value: 17 },
+  { delta: 1645, value: 20 }, { delta: 1746, value: 22 },
+  { delta: 1846, value: 39 }, { delta: 1963, value: 26 },
+  { delta: 2080, value: 27 }, { delta: 2197, value: 35 },
+  { delta: 2312, value: 47 }, { delta: 2412, value: 53 },
+  { delta: 2514, value: 60 }, { delta: 2630, value: 37 },
+  { delta: 2730, value: 36 }, { delta: 2830, value: 37 },
+  { delta: 2946, value: 36 }, { delta: 3046, value: 40 },
+  { delta: 3163, value: 47 }, { delta: 3280, value: 41 },
+  { delta: 3380, value: 35 }, { delta: 3480, value: 27 },
+  { delta: 3580, value: 39 }, { delta: 3680, value: 42 },
+  { delta: 3780, value: 49 }, { delta: 3880, value: 55 },
+  { delta: 3980, value: 60 }, { delta: 4080, value: 60 },
+  { delta: 4180, value: 60 }
+];
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
   yield graph.once("ready");
 
   testGraph(graph);
 
   yield graph.destroy();
   host.destroy();
 }
--- a/devtools/client/shared/test/browser_graphs-09a.js
+++ b/devtools/client/shared/test/browser_graphs-09a.js
@@ -1,24 +1,47 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that line graphs properly create the gutter and tooltips.
 
-const TEST_DATA = [{ delta: 112, value: 48 }, { delta: 213, value: 59 }, { delta: 313, value: 60 }, { delta: 413, value: 59 }, { delta: 530, value: 59 }, { delta: 646, value: 58 }, { delta: 747, value: 60 }, { delta: 863, value: 48 }, { delta: 980, value: 37 }, { delta: 1097, value: 30 }, { delta: 1213, value: 29 }, { delta: 1330, value: 23 }, { delta: 1430, value: 10 }, { delta: 1534, value: 17 }, { delta: 1645, value: 20 }, { delta: 1746, value: 22 }, { delta: 1846, value: 39 }, { delta: 1963, value: 26 }, { delta: 2080, value: 27 }, { delta: 2197, value: 35 }, { delta: 2312, value: 47 }, { delta: 2412, value: 53 }, { delta: 2514, value: 60 }, { delta: 2630, value: 37 }, { delta: 2730, value: 36 }, { delta: 2830, value: 37 }, { delta: 2946, value: 36 }, { delta: 3046, value: 40 }, { delta: 3163, value: 47 }, { delta: 3280, value: 41 }, { delta: 3380, value: 35 }, { delta: 3480, value: 27 }, { delta: 3580, value: 39 }, { delta: 3680, value: 42 }, { delta: 3780, value: 49 }, { delta: 3880, value: 55 }, { delta: 3980, value: 60 }, { delta: 4080, value: 60 }, { delta: 4180, value: 60 }];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const TEST_DATA = [
+  { delta: 112, value: 48 }, { delta: 213, value: 59 },
+  { delta: 313, value: 60 }, { delta: 413, value: 59 },
+  { delta: 530, value: 59 }, { delta: 646, value: 58 },
+  { delta: 747, value: 60 }, { delta: 863, value: 48 },
+  { delta: 980, value: 37 }, { delta: 1097, value: 30 },
+  { delta: 1213, value: 29 }, { delta: 1330, value: 23 },
+  { delta: 1430, value: 10 }, { delta: 1534, value: 17 },
+  { delta: 1645, value: 20 }, { delta: 1746, value: 22 },
+  { delta: 1846, value: 39 }, { delta: 1963, value: 26 },
+  { delta: 2080, value: 27 }, { delta: 2197, value: 35 },
+  { delta: 2312, value: 47 }, { delta: 2412, value: 53 },
+  { delta: 2514, value: 60 }, { delta: 2630, value: 37 },
+  { delta: 2730, value: 36 }, { delta: 2830, value: 37 },
+  { delta: 2946, value: 36 }, { delta: 3046, value: 40 },
+  { delta: 3163, value: 47 }, { delta: 3280, value: 41 },
+  { delta: 3380, value: 35 }, { delta: 3480, value: 27 },
+  { delta: 3580, value: 39 }, { delta: 3680, value: 42 },
+  { delta: 3780, value: 49 }, { delta: 3880, value: 55 },
+  { delta: 3980, value: 60 }, { delta: 4080, value: 60 },
+  { delta: 4180, value: 60 }
+];
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, { metric: "fps" });
 
   yield testGraph(graph);
 
   yield graph.destroy();
   host.destroy();
 }
 
@@ -60,22 +83,22 @@ function* testGraph(graph) {
 
   is(graph._maxTooltip.querySelector("[text=metric]").textContent, "fps",
     "The maximum tooltip displays the correct metric.");
   is(graph._avgTooltip.querySelector("[text=metric]").textContent, "fps",
     "The average tooltip displays the correct metric.");
   is(graph._minTooltip.querySelector("[text=metric]").textContent, "fps",
     "The minimum tooltip displays the correct metric.");
 
-  is(parseInt(graph._maxTooltip.style.top), 22,
+  is(parseInt(graph._maxTooltip.style.top, 10), 22,
     "The maximum tooltip is positioned correctly.");
-  is(parseInt(graph._avgTooltip.style.top), 61,
+  is(parseInt(graph._avgTooltip.style.top, 10), 61,
     "The average tooltip is positioned correctly.");
-  is(parseInt(graph._minTooltip.style.top), 128,
+  is(parseInt(graph._minTooltip.style.top, 10), 128,
     "The minimum tooltip is positioned correctly.");
 
-  is(parseInt(graph._maxGutterLine.style.top), 22,
+  is(parseInt(graph._maxGutterLine.style.top, 10), 22,
     "The maximum gutter line is positioned correctly.");
-  is(parseInt(graph._avgGutterLine.style.top), 61,
+  is(parseInt(graph._avgGutterLine.style.top, 10), 61,
     "The average gutter line is positioned correctly.");
-  is(parseInt(graph._minGutterLine.style.top), 128,
+  is(parseInt(graph._minGutterLine.style.top, 10), 128,
     "The minimum gutter line is positioned correctly.");
 }
--- a/devtools/client/shared/test/browser_graphs-09b.js
+++ b/devtools/client/shared/test/browser_graphs-09b.js
@@ -1,24 +1,47 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that line graphs properly use the tooltips configuration properties.
 
-const TEST_DATA = [{ delta: 112, value: 48 }, { delta: 213, value: 59 }, { delta: 313, value: 60 }, { delta: 413, value: 59 }, { delta: 530, value: 59 }, { delta: 646, value: 58 }, { delta: 747, value: 60 }, { delta: 863, value: 48 }, { delta: 980, value: 37 }, { delta: 1097, value: 30 }, { delta: 1213, value: 29 }, { delta: 1330, value: 23 }, { delta: 1430, value: 10 }, { delta: 1534, value: 17 }, { delta: 1645, value: 20 }, { delta: 1746, value: 22 }, { delta: 1846, value: 39 }, { delta: 1963, value: 26 }, { delta: 2080, value: 27 }, { delta: 2197, value: 35 }, { delta: 2312, value: 47 }, { delta: 2412, value: 53 }, { delta: 2514, value: 60 }, { delta: 2630, value: 37 }, { delta: 2730, value: 36 }, { delta: 2830, value: 37 }, { delta: 2946, value: 36 }, { delta: 3046, value: 40 }, { delta: 3163, value: 47 }, { delta: 3280, value: 41 }, { delta: 3380, value: 35 }, { delta: 3480, value: 27 }, { delta: 3580, value: 39 }, { delta: 3680, value: 42 }, { delta: 3780, value: 49 }, { delta: 3880, value: 55 }, { delta: 3980, value: 60 }, { delta: 4080, value: 60 }, { delta: 4180, value: 60 }];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const TEST_DATA = [
+  { delta: 112, value: 48 }, { delta: 213, value: 59 },
+  { delta: 313, value: 60 }, { delta: 413, value: 59 },
+  { delta: 530, value: 59 }, { delta: 646, value: 58 },
+  { delta: 747, value: 60 }, { delta: 863, value: 48 },
+  { delta: 980, value: 37 }, { delta: 1097, value: 30 },
+  { delta: 1213, value: 29 }, { delta: 1330, value: 23 },
+  { delta: 1430, value: 10 }, { delta: 1534, value: 17 },
+  { delta: 1645, value: 20 }, { delta: 1746, value: 22 },
+  { delta: 1846, value: 39 }, { delta: 1963, value: 26 },
+  { delta: 2080, value: 27 }, { delta: 2197, value: 35 },
+  { delta: 2312, value: 47 }, { delta: 2412, value: 53 },
+  { delta: 2514, value: 60 }, { delta: 2630, value: 37 },
+  { delta: 2730, value: 36 }, { delta: 2830, value: 37 },
+  { delta: 2946, value: 36 }, { delta: 3046, value: 40 },
+  { delta: 3163, value: 47 }, { delta: 3280, value: 41 },
+  { delta: 3380, value: 35 }, { delta: 3480, value: 27 },
+  { delta: 3580, value: 39 }, { delta: 3680, value: 42 },
+  { delta: 3780, value: 49 }, { delta: 3880, value: 55 },
+  { delta: 3980, value: 60 }, { delta: 4080, value: 60 },
+  { delta: 4180, value: 60 }
+];
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
   graph.withTooltipArrows = false;
   graph.withFixedTooltipPositions = true;
 
   yield testGraph(graph);
 
   yield graph.destroy();
   host.destroy();
@@ -38,22 +61,22 @@ function* testGraph(graph) {
 
   is(graph._maxTooltip.getAttribute("with-arrows"), "false",
     "The maximum tooltip has the correct 'with-arrows' attribute.");
   is(graph._avgTooltip.getAttribute("with-arrows"), "false",
     "The average tooltip has the correct 'with-arrows' attribute.");
   is(graph._minTooltip.getAttribute("with-arrows"), "false",
     "The minimum tooltip has the correct 'with-arrows' attribute.");
 
-  is(parseInt(graph._maxTooltip.style.top), 8,
+  is(parseInt(graph._maxTooltip.style.top, 10), 8,
     "The maximum tooltip is positioned correctly.");
-  is(parseInt(graph._avgTooltip.style.top), 8,
+  is(parseInt(graph._avgTooltip.style.top, 10), 8,
     "The average tooltip is positioned correctly.");
-  is(parseInt(graph._minTooltip.style.top), 142,
+  is(parseInt(graph._minTooltip.style.top, 10), 142,
     "The minimum tooltip is positioned correctly.");
 
-  is(parseInt(graph._maxGutterLine.style.top), 22,
+  is(parseInt(graph._maxGutterLine.style.top, 10), 22,
     "The maximum gutter line is positioned correctly.");
-  is(parseInt(graph._avgGutterLine.style.top), 61,
+  is(parseInt(graph._avgGutterLine.style.top, 10), 61,
     "The average gutter line is positioned correctly.");
-  is(parseInt(graph._minGutterLine.style.top), 128,
+  is(parseInt(graph._minGutterLine.style.top, 10), 128,
     "The minimum gutter line is positioned correctly.");
 }
--- a/devtools/client/shared/test/browser_graphs-09c.js
+++ b/devtools/client/shared/test/browser_graphs-09c.js
@@ -1,24 +1,26 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that line graphs hide the tooltips when there's no data available.
 
 const TEST_DATA = [];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
 
   yield testGraph(graph);
 
   yield graph.destroy();
   host.destroy();
 }
 
--- a/devtools/client/shared/test/browser_graphs-09d.js
+++ b/devtools/client/shared/test/browser_graphs-09d.js
@@ -1,25 +1,27 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that line graphs hide the 'max' tooltip when the distance between
 // the 'min' and 'max' tooltip is too small.
 
 const TEST_DATA = [{ delta: 100, value: 60 }, { delta: 200, value: 59.9 }];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
 
   yield testGraph(graph);
 
   yield graph.destroy();
   host.destroy();
 }
 
--- a/devtools/client/shared/test/browser_graphs-09e.js
+++ b/devtools/client/shared/test/browser_graphs-09e.js
@@ -1,27 +1,50 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that line graphs hide the gutter and tooltips when there's no data,
 // but show them when there is.
 
 const NO_DATA = [];
-const TEST_DATA = [{ delta: 112, value: 48 }, { delta: 213, value: 59 }, { delta: 313, value: 60 }, { delta: 413, value: 59 }, { delta: 530, value: 59 }, { delta: 646, value: 58 }, { delta: 747, value: 60 }, { delta: 863, value: 48 }, { delta: 980, value: 37 }, { delta: 1097, value: 30 }, { delta: 1213, value: 29 }, { delta: 1330, value: 23 }, { delta: 1430, value: 10 }, { delta: 1534, value: 17 }, { delta: 1645, value: 20 }, { delta: 1746, value: 22 }, { delta: 1846, value: 39 }, { delta: 1963, value: 26 }, { delta: 2080, value: 27 }, { delta: 2197, value: 35 }, { delta: 2312, value: 47 }, { delta: 2412, value: 53 }, { delta: 2514, value: 60 }, { delta: 2630, value: 37 }, { delta: 2730, value: 36 }, { delta: 2830, value: 37 }, { delta: 2946, value: 36 }, { delta: 3046, value: 40 }, { delta: 3163, value: 47 }, { delta: 3280, value: 41 }, { delta: 3380, value: 35 }, { delta: 3480, value: 27 }, { delta: 3580, value: 39 }, { delta: 3680, value: 42 }, { delta: 3780, value: 49 }, { delta: 3880, value: 55 }, { delta: 3980, value: 60 }, { delta: 4080, value: 60 }, { delta: 4180, value: 60 }];
+const TEST_DATA = [
+  { delta: 112, value: 48 }, { delta: 213, value: 59 },
+  { delta: 313, value: 60 }, { delta: 413, value: 59 },
+  { delta: 530, value: 59 }, { delta: 646, value: 58 },
+  { delta: 747, value: 60 }, { delta: 863, value: 48 },
+  { delta: 980, value: 37 }, { delta: 1097, value: 30 },
+  { delta: 1213, value: 29 }, { delta: 1330, value: 23 },
+  { delta: 1430, value: 10 }, { delta: 1534, value: 17 },
+  { delta: 1645, value: 20 }, { delta: 1746, value: 22 },
+  { delta: 1846, value: 39 }, { delta: 1963, value: 26 },
+  { delta: 2080, value: 27 }, { delta: 2197, value: 35 },
+  { delta: 2312, value: 47 }, { delta: 2412, value: 53 },
+  { delta: 2514, value: 60 }, { delta: 2630, value: 37 },
+  { delta: 2730, value: 36 }, { delta: 2830, value: 37 },
+  { delta: 2946, value: 36 }, { delta: 3046, value: 40 },
+  { delta: 3163, value: 47 }, { delta: 3280, value: 41 },
+  { delta: 3380, value: 35 }, { delta: 3480, value: 27 },
+  { delta: 3580, value: 39 }, { delta: 3680, value: 42 },
+  { delta: 3780, value: 49 }, { delta: 3880, value: 55 },
+  { delta: 3980, value: 60 }, { delta: 4080, value: 60 },
+  { delta: 4180, value: 60 }
+];
 
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
 
   yield testGraph(graph);
 
   yield graph.destroy();
   host.destroy();
 }
 
--- a/devtools/client/shared/test/browser_graphs-09f.js
+++ b/devtools/client/shared/test/browser_graphs-09f.js
@@ -1,25 +1,27 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests the constructor options for `min`, `max` and `avg` on displaying the
 // gutter/tooltips and lines.
 
 const TEST_DATA = [{ delta: 100, value: 60 }, { delta: 200, value: 1 }];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
 
   yield testGraph(doc.body, { avg: false });
   yield testGraph(doc.body, { min: false });
   yield testGraph(doc.body, { max: false });
   yield testGraph(doc.body, { min: false, max: false, avg: false });
   yield testGraph(doc.body, {});
 
   host.destroy();
--- a/devtools/client/shared/test/browser_graphs-10a.js
+++ b/devtools/client/shared/test/browser_graphs-10a.js
@@ -1,25 +1,49 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that graphs properly handle resizing.
 
-const TEST_DATA = [{ delta: 112, value: 48 }, { delta: 213, value: 59 }, { delta: 313, value: 60 }, { delta: 413, value: 59 }, { delta: 530, value: 59 }, { delta: 646, value: 58 }, { delta: 747, value: 60 }, { delta: 863, value: 48 }, { delta: 980, value: 37 }, { delta: 1097, value: 30 }, { delta: 1213, value: 29 }, { delta: 1330, value: 23 }, { delta: 1430, value: 10 }, { delta: 1534, value: 17 }, { delta: 1645, value: 20 }, { delta: 1746, value: 22 }, { delta: 1846, value: 39 }, { delta: 1963, value: 26 }, { delta: 2080, value: 27 }, { delta: 2197, value: 35 }, { delta: 2312, value: 47 }, { delta: 2412, value: 53 }, { delta: 2514, value: 60 }, { delta: 2630, value: 37 }, { delta: 2730, value: 36 }, { delta: 2830, value: 37 }, { delta: 2946, value: 36 }, { delta: 3046, value: 40 }, { delta: 3163, value: 47 }, { delta: 3280, value: 41 }, { delta: 3380, value: 35 }, { delta: 3480, value: 27 }, { delta: 3580, value: 39 }, { delta: 3680, value: 42 }, { delta: 3780, value: 49 }, { delta: 3880, value: 55 }, { delta: 3980, value: 60 }, { delta: 4080, value: 60 }, { delta: 4180, value: 60 }];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const TEST_DATA = [
+  { delta: 112, value: 48 }, { delta: 213, value: 59 },
+  { delta: 313, value: 60 }, { delta: 413, value: 59 },
+  { delta: 530, value: 59 }, { delta: 646, value: 58 },
+  { delta: 747, value: 60 }, { delta: 863, value: 48 },
+  { delta: 980, value: 37 }, { delta: 1097, value: 30 },
+  { delta: 1213, value: 29 }, { delta: 1330, value: 23 },
+  { delta: 1430, value: 10 }, { delta: 1534, value: 17 },
+  { delta: 1645, value: 20 }, { delta: 1746, value: 22 },
+  { delta: 1846, value: 39 }, { delta: 1963, value: 26 },
+  { delta: 2080, value: 27 }, { delta: 2197, value: 35 },
+  { delta: 2312, value: 47 }, { delta: 2412, value: 53 },
+  { delta: 2514, value: 60 }, { delta: 2630, value: 37 },
+  { delta: 2730, value: 36 }, { delta: 2830, value: 37 },
+  { delta: 2946, value: 36 }, { delta: 3046, value: 40 },
+  { delta: 3163, value: 47 }, { delta: 3280, value: 41 },
+  { delta: 3380, value: 35 }, { delta: 3480, value: 27 },
+  { delta: 3580, value: 39 }, { delta: 3680, value: 42 },
+  { delta: 3780, value: 49 }, { delta: 3880, value: 55 },
+  { delta: 3980, value: 60 }, { delta: 4080, value: 60 },
+  { delta: 4180, value: 60 }
+];
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost("window");
-  doc.body.setAttribute("style", "position: fixed; width: 100%; height: 100%; margin: 0;");
+  let [host,, doc] = yield createHost("window");
+  doc.body.setAttribute("style",
+                        "position: fixed; width: 100%; height: 100%; margin: 0;");
 
   let graph = new LineGraphWidget(doc.body, "fps");
   yield graph.once("ready");
 
   let refreshCount = 0;
   graph.on("refresh", () => refreshCount++);
 
   yield testGraph(host, graph);
--- a/devtools/client/shared/test/browser_graphs-10b.js
+++ b/devtools/client/shared/test/browser_graphs-10b.js
@@ -1,26 +1,50 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that graphs aren't refreshed when the owner window resizes but
 // the graph dimensions stay the same.
 
-const TEST_DATA = [{ delta: 112, value: 48 }, { delta: 213, value: 59 }, { delta: 313, value: 60 }, { delta: 413, value: 59 }, { delta: 530, value: 59 }, { delta: 646, value: 58 }, { delta: 747, value: 60 }, { delta: 863, value: 48 }, { delta: 980, value: 37 }, { delta: 1097, value: 30 }, { delta: 1213, value: 29 }, { delta: 1330, value: 23 }, { delta: 1430, value: 10 }, { delta: 1534, value: 17 }, { delta: 1645, value: 20 }, { delta: 1746, value: 22 }, { delta: 1846, value: 39 }, { delta: 1963, value: 26 }, { delta: 2080, value: 27 }, { delta: 2197, value: 35 }, { delta: 2312, value: 47 }, { delta: 2412, value: 53 }, { delta: 2514, value: 60 }, { delta: 2630, value: 37 }, { delta: 2730, value: 36 }, { delta: 2830, value: 37 }, { delta: 2946, value: 36 }, { delta: 3046, value: 40 }, { delta: 3163, value: 47 }, { delta: 3280, value: 41 }, { delta: 3380, value: 35 }, { delta: 3480, value: 27 }, { delta: 3580, value: 39 }, { delta: 3680, value: 42 }, { delta: 3780, value: 49 }, { delta: 3880, value: 55 }, { delta: 3980, value: 60 }, { delta: 4080, value: 60 }, { delta: 4180, value: 60 }];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const TEST_DATA = [
+  { delta: 112, value: 48 }, { delta: 213, value: 59 },
+  { delta: 313, value: 60 }, { delta: 413, value: 59 },
+  { delta: 530, value: 59 }, { delta: 646, value: 58 },
+  { delta: 747, value: 60 }, { delta: 863, value: 48 },
+  { delta: 980, value: 37 }, { delta: 1097, value: 30 },
+  { delta: 1213, value: 29 }, { delta: 1330, value: 23 },
+  { delta: 1430, value: 10 }, { delta: 1534, value: 17 },
+  { delta: 1645, value: 20 }, { delta: 1746, value: 22 },
+  { delta: 1846, value: 39 }, { delta: 1963, value: 26 },
+  { delta: 2080, value: 27 }, { delta: 2197, value: 35 },
+  { delta: 2312, value: 47 }, { delta: 2412, value: 53 },
+  { delta: 2514, value: 60 }, { delta: 2630, value: 37 },
+  { delta: 2730, value: 36 }, { delta: 2830, value: 37 },
+  { delta: 2946, value: 36 }, { delta: 3046, value: 40 },
+  { delta: 3163, value: 47 }, { delta: 3280, value: 41 },
+  { delta: 3380, value: 35 }, { delta: 3480, value: 27 },
+  { delta: 3580, value: 39 }, { delta: 3680, value: 42 },
+  { delta: 3780, value: 49 }, { delta: 3880, value: 55 },
+  { delta: 3980, value: 60 }, { delta: 4080, value: 60 },
+  { delta: 4180, value: 60 }
+];
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost("window");
-  doc.body.setAttribute("style", "position: fixed; width: 100%; height: 100%; margin: 0;");
+  let [host,, doc] = yield createHost("window");
+  doc.body.setAttribute("style",
+                        "position: fixed; width: 100%; height: 100%; margin: 0;");
 
   let graph = new LineGraphWidget(doc.body, "fps");
   graph.fixedWidth = 200;
   graph.fixedHeight = 100;
   yield graph.once("ready");
 
   let refreshCount = 0;
   let refreshCancelledCount = 0;
--- a/devtools/client/shared/test/browser_graphs-10c.js
+++ b/devtools/client/shared/test/browser_graphs-10c.js
@@ -1,23 +1,47 @@
+
+"use strict";
 
 // Tests that graphs properly handle resizing.
 
-const TEST_DATA = [{ delta: 112, value: 48 }, { delta: 213, value: 59 }, { delta: 313, value: 60 }, { delta: 413, value: 59 }, { delta: 530, value: 59 }, { delta: 646, value: 58 }, { delta: 747, value: 60 }, { delta: 863, value: 48 }, { delta: 980, value: 37 }, { delta: 1097, value: 30 }, { delta: 1213, value: 29 }, { delta: 1330, value: 23 }, { delta: 1430, value: 10 }, { delta: 1534, value: 17 }, { delta: 1645, value: 20 }, { delta: 1746, value: 22 }, { delta: 1846, value: 39 }, { delta: 1963, value: 26 }, { delta: 2080, value: 27 }, { delta: 2197, value: 35 }, { delta: 2312, value: 47 }, { delta: 2412, value: 53 }, { delta: 2514, value: 60 }, { delta: 2630, value: 37 }, { delta: 2730, value: 36 }, { delta: 2830, value: 37 }, { delta: 2946, value: 36 }, { delta: 3046, value: 40 }, { delta: 3163, value: 47 }, { delta: 3280, value: 41 }, { delta: 3380, value: 35 }, { delta: 3480, value: 27 }, { delta: 3580, value: 39 }, { delta: 3680, value: 42 }, { delta: 3780, value: 49 }, { delta: 3880, value: 55 }, { delta: 3980, value: 60 }, { delta: 4080, value: 60 }, { delta: 4180, value: 60 }];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const TEST_DATA = [
+  { delta: 112, value: 48 }, { delta: 213, value: 59 },
+  { delta: 313, value: 60 }, { delta: 413, value: 59 },
+  { delta: 530, value: 59 }, { delta: 646, value: 58 },
+  { delta: 747, value: 60 }, { delta: 863, value: 48 },
+  { delta: 980, value: 37 }, { delta: 1097, value: 30 },
+  { delta: 1213, value: 29 }, { delta: 1330, value: 23 },
+  { delta: 1430, value: 10 }, { delta: 1534, value: 17 },
+  { delta: 1645, value: 20 }, { delta: 1746, value: 22 },
+  { delta: 1846, value: 39 }, { delta: 1963, value: 26 },
+  { delta: 2080, value: 27 }, { delta: 2197, value: 35 },
+  { delta: 2312, value: 47 }, { delta: 2412, value: 53 },
+  { delta: 2514, value: 60 }, { delta: 2630, value: 37 },
+  { delta: 2730, value: 36 }, { delta: 2830, value: 37 },
+  { delta: 2946, value: 36 }, { delta: 3046, value: 40 },
+  { delta: 3163, value: 47 }, { delta: 3280, value: 41 },
+  { delta: 3380, value: 35 }, { delta: 3480, value: 27 },
+  { delta: 3580, value: 39 }, { delta: 3680, value: 42 },
+  { delta: 3780, value: 49 }, { delta: 3880, value: 55 },
+  { delta: 3980, value: 60 }, { delta: 4080, value: 60 },
+  { delta: 4180, value: 60 }
+];
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost("window");
-  doc.body.setAttribute("style", "position: fixed; width: 100%; height: 100%; margin: 0;");
+  let [host,, doc] = yield createHost("window");
+  doc.body.setAttribute("style",
+                        "position: fixed; width: 100%; height: 100%; margin: 0;");
 
   let graph = new LineGraphWidget(doc.body, "fps");
   yield graph.once("ready");
 
   let refreshCount = 0;
   graph.on("refresh", () => refreshCount++);
 
   yield testGraph(host, graph);
--- a/devtools/client/shared/test/browser_graphs-11a.js
+++ b/devtools/client/shared/test/browser_graphs-11a.js
@@ -1,29 +1,31 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that bar graph create a legend as expected.
 
-var BarGraphWidget = require("devtools/client/shared/widgets/BarGraphWidget");
+const BarGraphWidget = require("devtools/client/shared/widgets/BarGraphWidget");
 
 const CATEGORIES = [
   { color: "#46afe3", label: "Foo" },
   { color: "#eb5368", label: "Bar" },
   { color: "#70bf53", label: "Baz" }
 ];
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new BarGraphWidget(doc.body);
   yield graph.once("ready");
 
   testGraph(graph);
 
   yield graph.destroy();
   host.destroy();
 }
@@ -37,22 +39,22 @@ function testGraph(graph) {
     "A legend container should be available.");
   is(legendContainer.childNodes.length, 3,
     "Three legend items should have been created.");
 
   let legendItems = graph._document.querySelectorAll(".bar-graph-widget-legend-item");
   is(legendItems.length, 3,
     "Three legend items should exist in the entire graph.");
 
-  is(legendItems[0].querySelector("[view=color]").style.backgroundColor, "rgb(70, 175, 227)",
-    "The first legend item has the correct color.");
-  is(legendItems[1].querySelector("[view=color]").style.backgroundColor, "rgb(235, 83, 104)",
-    "The second legend item has the correct color.");
-  is(legendItems[2].querySelector("[view=color]").style.backgroundColor, "rgb(112, 191, 83)",
-    "The third legend item has the correct color.");
+  is(legendItems[0].querySelector("[view=color]").style.backgroundColor,
+     "rgb(70, 175, 227)", "The first legend item has the correct color.");
+  is(legendItems[1].querySelector("[view=color]").style.backgroundColor,
+     "rgb(235, 83, 104)", "The second legend item has the correct color.");
+  is(legendItems[2].querySelector("[view=color]").style.backgroundColor,
+     "rgb(112, 191, 83)", "The third legend item has the correct color.");
 
   is(legendItems[0].querySelector("[view=label]").textContent, "Foo",
     "The first legend item has the correct label.");
   is(legendItems[1].querySelector("[view=label]").textContent, "Bar",
     "The second legend item has the correct label.");
   is(legendItems[2].querySelector("[view=label]").textContent, "Baz",
     "The third legend item has the correct label.");
 }
--- a/devtools/client/shared/test/browser_graphs-11b.js
+++ b/devtools/client/shared/test/browser_graphs-11b.js
@@ -1,30 +1,33 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that bar graph's legend items handle mouseover/mouseout.
 
-var BarGraphWidget = require("devtools/client/shared/widgets/BarGraphWidget");
+const BarGraphWidget = require("devtools/client/shared/widgets/BarGraphWidget");
 
 const CATEGORIES = [
   { color: "#46afe3", label: "Foo" },
   { color: "#eb5368", label: "Bar" },
   { color: "#70bf53", label: "Baz" }
 ];
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
-  doc.body.setAttribute("style", "position: fixed; width: 100%; height: 100%; margin: 0;");
+  let [host,, doc] = yield createHost();
+  doc.body.setAttribute("style",
+                        "position: fixed; width: 100%; height: 100%; margin: 0;");
 
   let graph = new BarGraphWidget(doc.body, 1);
   graph.fixedWidth = 200;
   graph.fixedHeight = 100;
 
   yield graph.once("ready");
   yield testGraph(graph);
 
@@ -44,16 +47,17 @@ function* testGraph(graph) {
   }, {
     delta: 1400, values: [0, 3, 1]
   }, {
     delta: 1500, values: [3, 0, 2]
   }, {
     delta: 1600, values: [3, 2, 0]
   }]);
 
+  /* eslint-disable max-len */
   is(graph._blocksBoundingRects.toSource(), "[{type:1, start:0, end:33.33333333333333, top:70, bottom:100}, {type:2, start:0, end:33.33333333333333, top:24, bottom:69}, {type:0, start:34.33333333333333, end:66.66666666666666, top:85, bottom:100}, {type:2, start:34.33333333333333, end:66.66666666666666, top:54, bottom:84}, {type:0, start:67.66666666666666, end:100, top:70, bottom:100}, {type:1, start:67.66666666666666, end:100, top:54, bottom:69}, {type:1, start:101, end:133.33333333333331, top:55, bottom:100}, {type:2, start:101, end:133.33333333333331, top:39, bottom:54}, {type:0, start:134.33333333333331, end:166.66666666666666, top:55, bottom:100}, {type:2, start:134.33333333333331, end:166.66666666666666, top:24, bottom:54}, {type:0, start:167.66666666666666, end:200, top:55, bottom:100}, {type:1, start:167.66666666666666, end:200, top:24, bottom:54}]",
     "The correct blocks bounding rects were calculated for the bar graph.");
 
   let legendItems = graph._document.querySelectorAll(".bar-graph-widget-legend-item");
   is(legendItems.length, 3,
     "Three legend items should exist in the entire graph.");
 
   yield testLegend(graph, 0, {
@@ -69,16 +73,17 @@ function* testGraph(graph) {
     rightmost: "({type:1, start:167.66666666666666, end:200, top:24, bottom:54})"
   });
   yield testLegend(graph, 2, {
     highlights: "[{type:2, start:0, end:33.33333333333333, top:24, bottom:69}, {type:2, start:34.33333333333333, end:66.66666666666666, top:54, bottom:84}, {type:2, start:101, end:133.33333333333331, top:39, bottom:54}, {type:2, start:134.33333333333331, end:166.66666666666666, top:24, bottom:54}]",
     selection: "({start:0, end:166.66666666666666})",
     leftmost: "({type:2, start:0, end:33.33333333333333, top:24, bottom:69})",
     rightmost: "({type:2, start:134.33333333333331, end:166.66666666666666, top:24, bottom:54})"
   });
+  /* eslint-enable max-len */
 }
 
 function* testLegend(graph, index, { highlights, selection, leftmost, rightmost }) {
   // Hover.
 
   let legendItems = graph._document.querySelectorAll(".bar-graph-widget-legend-item");
   let colorBlock = legendItems[index].querySelector("[view=color]");
 
--- a/devtools/client/shared/test/browser_graphs-12.js
+++ b/devtools/client/shared/test/browser_graphs-12.js
@@ -1,26 +1,29 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that canvas graphs can have their selection linked.
 
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
-var BarGraphWidget = require("devtools/client/shared/widgets/BarGraphWidget");
-var {CanvasGraphUtils} = require("devtools/client/shared/widgets/Graphs");
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const BarGraphWidget = require("devtools/client/shared/widgets/BarGraphWidget");
+const {CanvasGraphUtils} = require("devtools/client/shared/widgets/Graphs");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
-  doc.body.setAttribute("style", "position: fixed; width: 100%; height: 100%; margin: 0;");
+  let [host,, doc] = yield createHost();
+  doc.body.setAttribute("style",
+                        "position: fixed; width: 100%; height: 100%; margin: 0;");
 
   let first = document.createElement("div");
   first.setAttribute("style", "display: inline-block; width: 100%; height: 50%;");
   doc.body.appendChild(first);
 
   let second = document.createElement("div");
   second.setAttribute("style", "display: inline-block; width: 100%; height: 50%;");
   doc.body.appendChild(second);
--- a/devtools/client/shared/test/browser_graphs-13.js
+++ b/devtools/client/shared/test/browser_graphs-13.js
@@ -1,24 +1,27 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that graph widgets may have a fixed width or height.
 
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
-  doc.body.setAttribute("style", "position: fixed; width: 100%; height: 100%; margin: 0;");
+  let [host,, doc] = yield createHost();
+  doc.body.setAttribute("style",
+                        "position: fixed; width: 100%; height: 100%; margin: 0;");
 
   let graph = new LineGraphWidget(doc.body, "fps");
   graph.fixedWidth = 200;
   graph.fixedHeight = 100;
 
   yield graph.ready();
   testGraph(host, graph);
 
--- a/devtools/client/shared/test/browser_graphs-14.js
+++ b/devtools/client/shared/test/browser_graphs-14.js
@@ -1,24 +1,47 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that graph widgets correctly emit mouse input events.
 
-const TEST_DATA = [{ delta: 112, value: 48 }, { delta: 213, value: 59 }, { delta: 313, value: 60 }, { delta: 413, value: 59 }, { delta: 530, value: 59 }, { delta: 646, value: 58 }, { delta: 747, value: 60 }, { delta: 863, value: 48 }, { delta: 980, value: 37 }, { delta: 1097, value: 30 }, { delta: 1213, value: 29 }, { delta: 1330, value: 23 }, { delta: 1430, value: 10 }, { delta: 1534, value: 17 }, { delta: 1645, value: 20 }, { delta: 1746, value: 22 }, { delta: 1846, value: 39 }, { delta: 1963, value: 26 }, { delta: 2080, value: 27 }, { delta: 2197, value: 35 }, { delta: 2312, value: 47 }, { delta: 2412, value: 53 }, { delta: 2514, value: 60 }, { delta: 2630, value: 37 }, { delta: 2730, value: 36 }, { delta: 2830, value: 37 }, { delta: 2946, value: 36 }, { delta: 3046, value: 40 }, { delta: 3163, value: 47 }, { delta: 3280, value: 41 }, { delta: 3380, value: 35 }, { delta: 3480, value: 27 }, { delta: 3580, value: 39 }, { delta: 3680, value: 42 }, { delta: 3780, value: 49 }, { delta: 3880, value: 55 }, { delta: 3980, value: 60 }, { delta: 4080, value: 60 }, { delta: 4180, value: 60 }];
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const TEST_DATA = [
+  { delta: 112, value: 48 }, { delta: 213, value: 59 },
+  { delta: 313, value: 60 }, { delta: 413, value: 59 },
+  { delta: 530, value: 59 }, { delta: 646, value: 58 },
+  { delta: 747, value: 60 }, { delta: 863, value: 48 },
+  { delta: 980, value: 37 }, { delta: 1097, value: 30 },
+  { delta: 1213, value: 29 }, { delta: 1330, value: 23 },
+  { delta: 1430, value: 10 }, { delta: 1534, value: 17 },
+  { delta: 1645, value: 20 }, { delta: 1746, value: 22 },
+  { delta: 1846, value: 39 }, { delta: 1963, value: 26 },
+  { delta: 2080, value: 27 }, { delta: 2197, value: 35 },
+  { delta: 2312, value: 47 }, { delta: 2412, value: 53 },
+  { delta: 2514, value: 60 }, { delta: 2630, value: 37 },
+  { delta: 2730, value: 36 }, { delta: 2830, value: 37 },
+  { delta: 2946, value: 36 }, { delta: 3046, value: 40 },
+  { delta: 3163, value: 47 }, { delta: 3280, value: 41 },
+  { delta: 3380, value: 35 }, { delta: 3480, value: 27 },
+  { delta: 3580, value: 39 }, { delta: 3680, value: 42 },
+  { delta: 3780, value: 49 }, { delta: 3880, value: 55 },
+  { delta: 3980, value: 60 }, { delta: 4080, value: 60 },
+  { delta: 4180, value: 60 }
+];
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
 
   yield testGraph(graph);
 
   yield graph.destroy();
   host.destroy();
 }
 
--- a/devtools/client/shared/test/browser_graphs-15.js
+++ b/devtools/client/shared/test/browser_graphs-15.js
@@ -1,47 +1,49 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that graph widgets correctly emit mouse input events.
 
 const FAST_FPS = 60;
 const SLOW_FPS = 10;
 
 // Each element represents a second
 const FRAMES = [FAST_FPS, FAST_FPS, FAST_FPS, SLOW_FPS, FAST_FPS];
 const TEST_DATA = [];
 const INTERVAL = 100;
-const DURATION = 5000; // 5s
+const DURATION = 5000;
 var t = 0;
 for (let frameRate of FRAMES) {
   for (let i = 0; i < frameRate; i++) {
-    let delta = Math.floor(1000 / frameRate); // Duration between frames at this rate
+    // Duration between frames at this rate
+    let delta = Math.floor(1000 / frameRate);
     t += delta;
     TEST_DATA.push(t);
   }
 }
 
-var LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
+const LineGraphWidget = require("devtools/client/shared/widgets/LineGraphWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new LineGraphWidget(doc.body, "fps");
 
   yield testGraph(graph);
 
   yield graph.destroy();
   host.destroy();
 }
 
 function* testGraph(graph) {
-
   console.log("test data", TEST_DATA);
   yield graph.setDataFromTimestamps(TEST_DATA, INTERVAL, DURATION);
   is(graph._avgTooltip.querySelector("[text=value]").textContent, "50",
     "The average tooltip displays the correct value.");
 }
--- a/devtools/client/shared/test/browser_graphs-16.js
+++ b/devtools/client/shared/test/browser_graphs-16.js
@@ -1,14 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that mounta graphs work as expected.
 
-var MountainGraphWidget = require("devtools/client/shared/widgets/MountainGraphWidget");
+const MountainGraphWidget = require("devtools/client/shared/widgets/MountainGraphWidget");
 
 const TEST_DATA = [
   { delta: 0, values: [0.1, 0.5, 0.3] },
   { delta: 1, values: [0.25, 0, 0.5] },
   { delta: 2, values: [0.5, 0.25, 0.1] },
   { delta: 3, values: [0, 0.75, 0] },
   { delta: 4, values: [0.75, 0, 0.25] }
 ];
@@ -21,17 +23,17 @@ const SECTIONS = [
 
 add_task(function* () {
   yield addTab("about:blank");
   yield performTest();
   gBrowser.removeCurrentTab();
 });
 
 function* performTest() {
-  let [host, win, doc] = yield createHost();
+  let [host,, doc] = yield createHost();
   let graph = new MountainGraphWidget(doc.body);
   yield graph.once("ready");
 
   testGraph(graph);
 
   yield graph.destroy();
   host.destroy();
 }
--- a/devtools/client/shared/test/browser_layoutHelpers-getBoxQuads.js
+++ b/devtools/client/shared/test/browser_layoutHelpers-getBoxQuads.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Tests getAdjustedQuads works properly in a variety of use cases including
 // iframes, scroll and zoom
 
 "use strict";
 
-var {getAdjustedQuads} = require("devtools/shared/layout/utils");
+const {getAdjustedQuads} = require("devtools/shared/layout/utils");
 
 const TEST_URI = TEST_URI_ROOT + "browser_layoutHelpers-getBoxQuads.html";
 
 add_task(function* () {
   let tab = yield addTab(TEST_URI);
   let doc = tab.linkedBrowser.contentDocument;
 
   ok(typeof getAdjustedQuads === "function", "getAdjustedQuads is defined");
@@ -54,18 +54,18 @@ function returnsTheRightDataStructure(do
     }
   }
 }
 
 function isEmptyForMissingNode(doc) {
   info("Checks that null is returned for invalid nodes");
 
   for (let input of [null, undefined, "", 0]) {
-    is(getAdjustedQuads(doc.defaultView, input).length, 0, "A 0-length array is returned" +
-      "for input " + input);
+    is(getAdjustedQuads(doc.defaultView, input).length, 0,
+      "A 0-length array is returned for input " + input);
   }
 }
 
 function isEmptyForHiddenNodes(doc) {
   info("Checks that null is returned for nodes that aren't rendered");
 
   let style = doc.querySelector("#styles");
   is(getAdjustedQuads(doc.defaultView, style).length, 0,
@@ -201,17 +201,18 @@ function* takesZoomIntoAccount(doc) {
     "The zoomed out quad is smaller than the default one");
   ok(zoomedOutQuad.bounds.height < defaultQuad.bounds.height,
     "The zoomed out quad is smaller than the default one");
 
   yield window.FullZoom.reset();
 }
 
 function returnsMultipleItemsForWrappingInlineElements(doc) {
-  info("Checks that several quads are returned for inline elements that span line-breaks");
+  info("Checks that several quads are returned " +
+       "for inline elements that span line-breaks");
 
   let node = doc.querySelector("#inline");
   let quads = getAdjustedQuads(doc.defaultView, node, "content");
   // At least 3 because of the 2 <br />, maybe more depending on the window size.
   ok(quads.length >= 3, "Multiple quads were returned");
 
   is(quads.length, node.getBoxQuads().length,
     "The same number of boxes as getBoxQuads was returned");
--- a/devtools/client/shared/test/browser_layoutHelpers.js
+++ b/devtools/client/shared/test/browser_layoutHelpers.js
@@ -1,83 +1,93 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that scrollIntoViewIfNeeded works properly.
-var {scrollIntoViewIfNeeded} = require("devtools/client/shared/scroll");
+const {scrollIntoViewIfNeeded} = require("devtools/client/shared/scroll");
 
 const TEST_URI = TEST_URI_ROOT + "browser_layoutHelpers.html";
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [host, win] = yield createHost("bottom", TEST_URI);
   runTest(win);
   host.destroy();
 });
 
 function runTest(win) {
   let some = win.document.getElementById("some");
 
   some.style.top = win.innerHeight + "px";
   some.style.left = win.innerWidth + "px";
   // The tests start with a black 2x2 pixels square below bottom right.
   // Do not resize the window during the tests.
 
   let xPos = Math.floor(win.innerWidth / 2);
-  win.scroll(xPos, win.innerHeight + 2);  // Above the viewport.
+  // Above the viewport.
+  win.scroll(xPos, win.innerHeight + 2);
   scrollIntoViewIfNeeded(some);
   is(win.scrollY, Math.floor(win.innerHeight / 2) + 1,
      "Element completely hidden above should appear centered.");
   is(win.scrollX, xPos,
      "scrollX position has not changed.");
 
-  win.scroll(win.innerWidth / 2, win.innerHeight + 1);  // On the top edge.
+  // On the top edge.
+  win.scroll(win.innerWidth / 2, win.innerHeight + 1);
   scrollIntoViewIfNeeded(some);
   is(win.scrollY, win.innerHeight,
      "Element partially visible above should appear above.");
   is(win.scrollX, xPos,
      "scrollX position has not changed.");
 
-  win.scroll(win.innerWidth / 2, 0);  // Just below the viewport.
+  // Just below the viewport.
+  win.scroll(win.innerWidth / 2, 0);
   scrollIntoViewIfNeeded(some);
   is(win.scrollY, Math.floor(win.innerHeight / 2) + 1,
      "Element completely hidden below should appear centered.");
   is(win.scrollX, xPos,
      "scrollX position has not changed.");
 
-  win.scroll(win.innerWidth / 2, 1);  // On the bottom edge.
+  // On the bottom edge.
+  win.scroll(win.innerWidth / 2, 1);
   scrollIntoViewIfNeeded(some);
   is(win.scrollY, 2,
      "Element partially visible below should appear below.");
   is(win.scrollX, xPos,
      "scrollX position has not changed.");
 
-  win.scroll(win.innerWidth / 2, win.innerHeight + 2);  // Above the viewport.
+  // Above the viewport.
+  win.scroll(win.innerWidth / 2, win.innerHeight + 2);
   scrollIntoViewIfNeeded(some, false);
   is(win.scrollY, win.innerHeight,
      "Element completely hidden above should appear above " +
      "if parameter is false.");
   is(win.scrollX, xPos,
      "scrollX position has not changed.");
 
-  win.scroll(win.innerWidth / 2, win.innerHeight + 1);  // On the top edge.
+  // On the top edge.
+  win.scroll(win.innerWidth / 2, win.innerHeight + 1);
   scrollIntoViewIfNeeded(some, false);
   is(win.scrollY, win.innerHeight,
      "Element partially visible above should appear above " +
      "if parameter is false.");
   is(win.scrollX, xPos,
      "scrollX position has not changed.");
 
-  win.scroll(win.innerWidth / 2, 0);  // Below the viewport.
+  // Below the viewport.
+  win.scroll(win.innerWidth / 2, 0);
   scrollIntoViewIfNeeded(some, false);
   is(win.scrollY, 2,
      "Element completely hidden below should appear below " +
      "if parameter is false.");
   is(win.scrollX, xPos,
      "scrollX position has not changed.");
 
-  win.scroll(win.innerWidth / 2, 1);  // On the bottom edge.
+  // On the bottom edge.
+  win.scroll(win.innerWidth / 2, 1);
   scrollIntoViewIfNeeded(some, false);
   is(win.scrollY, 2,
      "Element partially visible below should appear below " +
      "if parameter is false.");
   is(win.scrollX, xPos,
      "scrollX position has not changed.");
 }
--- a/devtools/client/shared/test/browser_mdn-docs-01.js
+++ b/devtools/client/shared/test/browser_mdn-docs-01.js
@@ -122,48 +122,45 @@ function* testTheBasics(widget) {
   * in the orginal link.
   *
   * One complexity is that when you open a new tab,
   * "about:blank" is first loaded into the tab before the
   * actual page. So we ignore that first load event, and keep
   * listening until "load" is triggered for a different URI.
   */
 function checkLinkClick(link) {
-
   function loadListener(tab) {
-    var browser = getBrowser().getBrowserForTab(tab);
-    var uri = browser.currentURI.spec;
+    let browser = getBrowser().getBrowserForTab(tab);
+    let uri = browser.currentURI.spec;
 
     info("New browser tab has loaded");
     gBrowser.removeTab(tab);
     info("Resolve promise with new tab URI");
     deferred.resolve(uri);
   }
 
   function newTabListener(e) {
     gBrowser.tabContainer.removeEventListener("TabOpen", newTabListener);
-    var tab = e.target;
-    BrowserTestUtils.browserLoaded(tab.linkedBrowser, false,
-                                   url => { return url != "about:blank"; })
+    let tab = e.target;
+    BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, url => url != "about:blank")
       .then(url => loadListener(tab));
   }
 
   let deferred = defer();
   info("Check that clicking the link opens a new tab with the correct URI");
   gBrowser.tabContainer.addEventListener("TabOpen", newTabListener, false);
   info("Click the link to MDN");
   link.click();
   return deferred.promise;
 }
 
 /**
  * Utility function to check content of the tooltip.
  */
 function checkTooltipContents(doc, expected) {
-
   is(doc.heading.textContent,
      expected.propertyName,
      "Property name is correct");
 
   is(doc.summary.textContent,
      expected.summary,
      "Summary is correct");
 
--- a/devtools/client/shared/test/browser_num-l10n.js
+++ b/devtools/client/shared/test/browser_num-l10n.js
@@ -1,11 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that the localization utils work properly.
 
 const { LocalizationHelper } = require("devtools/shared/l10n");
 
 function test() {
   let l10n = new LocalizationHelper();
 
   is(l10n.numberWithDecimals(1234.56789, 2), "1,234.57",
--- a/devtools/client/shared/test/browser_options-view-01.js
+++ b/devtools/client/shared/test/browser_options-view-01.js
@@ -1,30 +1,32 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that options-view OptionsView responds to events correctly.
 
 const {OptionsView} = require("devtools/client/shared/options-view");
 
 const BRANCH = "devtools.debugger.";
 const BLACK_BOX_PREF = "auto-black-box";
 const PRETTY_PRINT_PREF = "auto-pretty-print";
 
-var originalBlackBox = Services.prefs.getBoolPref(BRANCH + BLACK_BOX_PREF);
-var originalPrettyPrint = Services.prefs.getBoolPref(BRANCH + PRETTY_PRINT_PREF);
+const originalBlackBox = Services.prefs.getBoolPref(BRANCH + BLACK_BOX_PREF);
+const originalPrettyPrint = Services.prefs.getBoolPref(BRANCH + PRETTY_PRINT_PREF);
 
 add_task(function* () {
   info("Setting a couple of preferences");
   Services.prefs.setBoolPref(BRANCH + BLACK_BOX_PREF, false);
   Services.prefs.setBoolPref(BRANCH + PRETTY_PRINT_PREF, true);
 
   info("Opening a test tab and a toolbox host to create the options view in");
   yield addTab("about:blank");
-  let [host, win, doc] = yield createHost("bottom", OPTIONS_VIEW_URL);
+  let [host, win] = yield createHost("bottom", OPTIONS_VIEW_URL);
 
   yield testOptionsView(win);
 
   info("Closing the host and current tab");
   host.destroy();
   gBrowser.removeCurrentTab();
 
   info("Resetting the preferences");
@@ -55,32 +57,38 @@ function* testOptionsView(win) {
   is(options.getPref(PRETTY_PRINT_PREF), false, "getPref returns correct value");
   is(options.getPref(BLACK_BOX_PREF), true, "getPref returns correct value");
 
   is(ppEl.getAttribute("checked"), "", "menuitems update when preferences change");
   is(bbEl.getAttribute("checked"), "true", "menuitems update when preferences change");
 
   // Tests events are fired when preferences update outside of the menu
   is(events.length, 2, "two 'pref-changed' events fired");
-  is(events[0], "auto-pretty-print", "correct pref passed in 'pref-changed' event (auto-pretty-print)");
-  is(events[1], "auto-black-box", "correct pref passed in 'pref-changed' event (auto-black-box)");
+  is(events[0], "auto-pretty-print",
+     "correct pref passed in 'pref-changed' event (auto-pretty-print)");
+  is(events[1], "auto-black-box",
+     "correct pref passed in 'pref-changed' event (auto-black-box)");
 
   // Test buttons update when clicked and preferences are updated
   yield click(options, win, ppEl);
   is(ppEl.getAttribute("checked"), "true", "menuitems update when clicked");
-  is(Services.prefs.getBoolPref(BRANCH + PRETTY_PRINT_PREF), true, "preference updated via click");
+  is(Services.prefs.getBoolPref(BRANCH + PRETTY_PRINT_PREF),
+     true, "preference updated via click");
 
   yield click(options, win, bbEl);
   is(bbEl.getAttribute("checked"), "", "menuitems update when clicked");
-  is(Services.prefs.getBoolPref(BRANCH + BLACK_BOX_PREF), false, "preference updated via click");
+  is(Services.prefs.getBoolPref(BRANCH + BLACK_BOX_PREF),
+     false, "preference updated via click");
 
   // Tests events are fired when preferences updated via click
   is(events.length, 4, "two 'pref-changed' events fired");
-  is(events[2], "auto-pretty-print", "correct pref passed in 'pref-changed' event (auto-pretty-print)");
-  is(events[3], "auto-black-box", "correct pref passed in 'pref-changed' event (auto-black-box)");
+  is(events[2], "auto-pretty-print",
+     "correct pref passed in 'pref-changed' event (auto-pretty-print)");
+  is(events[3], "auto-black-box",
+     "correct pref passed in 'pref-changed' event (auto-black-box)");
 
   yield options.destroy();
 }
 
 function createOptionsView(win) {
   return new OptionsView({
     branchName: BRANCH,
     menupopup: win.document.querySelector("#options-menupopup")
--- a/devtools/client/shared/test/browser_outputparser.js
+++ b/devtools/client/shared/test/browser_outputparser.js
@@ -101,17 +101,19 @@ function testParseCssProperty(doc, parse
                    "blur(1px) drop-shadow(0 0 0 ",
                    {name: "blue"},
                    ") url(red.svg#blue)</span></span>"]),
 
     makeColorTest("color", "currentColor", ["currentColor"]),
 
     // Test a very long property.
     makeColorTest("background-image",
+                  /* eslint-disable max-len */
                   "linear-gradient(to left, transparent 0, transparent 5%,#F00 0, #F00 10%,#FF0 0, #FF0 15%,#0F0 0, #0F0 20%,#0FF 0, #0FF 25%,#00F 0, #00F 30%,#800 0, #800 35%,#880 0, #880 40%,#080 0, #080 45%,#088 0, #088 50%,#008 0, #008 55%,#FFF 0, #FFF 60%,#EEE 0, #EEE 65%,#CCC 0, #CCC 70%,#999 0, #999 75%,#666 0, #666 80%,#333 0, #333 85%,#111 0, #111 90%,#000 0, #000 95%,transparent 0, transparent 100%)",
+                  /* eslint-enable max-len */
                   ["linear-gradient(to left, ", {name: "transparent"},
                    " 0, ", {name: "transparent"},
                    " 5%,", {name: "#F00"},
                    " 0, ", {name: "#F00"},
                    " 10%,", {name: "#FF0"},
                    " 0, ", {name: "#FF0"},
                    " 15%,", {name: "#0F0"},
                    " 0, ", {name: "#0F0"},
--- a/devtools/client/shared/test/browser_poller.js
+++ b/devtools/client/shared/test/browser_poller.js
@@ -1,11 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests the Poller class.
 
 const { Poller } = require("devtools/client/shared/poller");
 
 add_task(function* () {
   let count1 = 0, count2 = 0, count3 = 0;
 
   let poller1 = new Poller(function () {
@@ -26,18 +28,19 @@ add_task(function* () {
   yield waitUntil(() => count2 > 10);
 
   ok(count2 > 10, "poller that was turned on polled several times");
   ok(count1 === 0, "poller that was never turned on never polled");
 
   yield poller2.off();
   let currentCount2 = count2;
 
-  poller1.on(); // Really high poll time!
-  poller3.on(); // Really high poll time!
+  // Really high poll time!
+  poller1.on();
+  poller3.on();
 
   yield waitUntil(() => count1 === 1);
   ok(true, "Poller calls fn immediately when `immediate` is true");
   ok(count3 === 0, "Poller does not call fn immediately when `immediate` is not set");
 
   ok(count2 === currentCount2, "a turned off poller does not continue to poll");
   yield poller2.off();
   yield poller2.off();
@@ -91,17 +94,18 @@ add_task(function* () {
         inflightFinished = true;
         resolve();
       }, 1000);
     });
   }, 1, true);
   asyncPoller.on();
 
   yield asyncPoller.off();
-  ok(inflightFinished, "off() method does not resolve until remaining inflight poll calls finish");
+  ok(inflightFinished,
+     "off() method does not resolve until remaining inflight poll calls finish");
   is(pollCalls, 1, "should only be one poll call to occur before turning off polling");
 });
 
 add_task(function* () {
   // Create a poller that returns a promise. This poll call
   // is called immediately, and then subsequently turned off.
   // The call to `off` should not resolve until the inflight call
   // finishes.
@@ -114,17 +118,18 @@ add_task(function* () {
         inflightFinished = true;
         resolve();
       }, 1000);
     });
   }, 1, true);
   asyncPoller.on();
 
   yield asyncPoller.destroy();
-  ok(inflightFinished, "destroy() method does not resolve until remaining inflight poll calls finish");
+  ok(inflightFinished,
+     "destroy() method does not resolve until remaining inflight poll calls finish");
   is(pollCalls, 1, "should only be one poll call to occur before destroying polling");
 
   try {
     asyncPoller.on();
     ok(false, "Calling on() after destruction should throw");
   } catch (e) {
     ok(true, "Calling on() after destruction should throw");
   }
--- a/devtools/client/shared/test/browser_prefs-01.js
+++ b/devtools/client/shared/test/browser_prefs-01.js
@@ -1,14 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that the preference helpers work properly.
 
-var { PrefsHelper } = require("devtools/client/shared/prefs");
+const { PrefsHelper } = require("devtools/client/shared/prefs");
 
 function test() {
   let Prefs = new PrefsHelper("devtools.debugger", {
     "foo": ["Bool", "enabled"]
   });
 
   let originalPrefValue = Services.prefs.getBoolPref("devtools.debugger.enabled");
   is(Prefs.foo, originalPrefValue, "The pref value was correctly fetched.");
--- a/devtools/client/shared/test/browser_prefs-02.js
+++ b/devtools/client/shared/test/browser_prefs-02.js
@@ -1,18 +1,22 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that preference helpers work properly with custom types of Float and Json.
 
-var { PrefsHelper } = require("devtools/client/shared/prefs");
+const { PrefsHelper } = require("devtools/client/shared/prefs");
 
 function test() {
-  let originalJson = Services.prefs.getCharPref("devtools.performance.timeline.hidden-markers");
-  let originalFloat = Services.prefs.getCharPref("devtools.performance.memory.sample-probability");
+  let originalJson = Services.prefs.getCharPref(
+    "devtools.performance.timeline.hidden-markers");
+  let originalFloat = Services.prefs.getCharPref(
+    "devtools.performance.memory.sample-probability");
 
   let Prefs = new PrefsHelper("devtools.performance", {
     "float": ["Float", "memory.sample-probability"],
     "json": ["Json", "timeline.hidden-markers"]
   });
 
   Prefs.registerObserver();
 
@@ -28,12 +32,14 @@ function test() {
   Services.prefs.setCharPref("devtools.performance.memory.sample-probability", "3.14");
   is(Prefs.float, 3.14, "The float pref value is correctly casted on get.");
 
   Prefs.float = 6.28;
   is(Prefs.float, 6.28, "The float pref value is correctly casted on set.");
 
   Prefs.unregisterObserver();
 
-  Services.prefs.setCharPref("devtools.performance.timeline.hidden-markers", originalJson);
-  Services.prefs.setCharPref("devtools.performance.memory.sample-probability", originalFloat);
+  Services.prefs.setCharPref("devtools.performance.timeline.hidden-markers",
+                             originalJson);
+  Services.prefs.setCharPref("devtools.performance.memory.sample-probability",
+                             originalFloat);
   finish();
 }
--- a/devtools/client/shared/test/browser_spectrum.js
+++ b/devtools/client/shared/test/browser_spectrum.js
@@ -1,22 +1,24 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that the spectrum color picker works correctly
 
 const {Spectrum} = require("devtools/client/shared/widgets/Spectrum");
 
 const TEST_URI = `data:text/html,
   <link rel="stylesheet" href="chrome://devtools/content/shared/widgets/spectrum.css" type="text/css"/>
   <div id="spectrum-container" />`;
 
 add_task(function* () {
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [host,, doc] = yield createHost("bottom", TEST_URI);
 
   let container = doc.getElementById("spectrum-container");
 
   yield testCreateAndDestroyShouldAppendAndRemoveElements(container);
   yield testPassingAColorAtInitShouldSetThatColor(container);
   yield testSettingAndGettingANewColor(container);
   yield testChangingColorShouldEmitEvents(container);
   yield testSettingColorShoudUpdateTheUI(container);
@@ -74,17 +76,17 @@ function testChangingColorShouldEmitEven
     s.show();
 
     s.once("changed", (event, rgba, color) => {
       ok(true, "Changed event was emitted on color change");
       is(rgba[0], 128, "New color is correct");
       is(rgba[1], 64, "New color is correct");
       is(rgba[2], 64, "New color is correct");
       is(rgba[3], 1, "New color is correct");
-      is("rgba(" + rgba[0] + ", " + rgba[1] + ", " + rgba[2] + ", " + rgba[3] + ")", color, "RGBA and css color correspond");
+      is(`rgba(${rgba.join(", ")})`, color, "RGBA and css color correspond");
 
       s.destroy();
       resolve();
     });
 
     // Simulate a drag move event by calling the handler directly.
     s.onDraggerMove(s.dragger.offsetWidth / 2, s.dragger.offsetHeight / 2);
   });
--- a/devtools/client/shared/test/browser_telemetry_button_eyedropper.js
+++ b/devtools/client/shared/test/browser_telemetry_button_eyedropper.js
@@ -1,52 +1,52 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-"use strict";
-
-const TEST_URI = "data:text/html;charset=utf-8," +
-  "<p>browser_telemetry_button_eyedropper.js</p><div>test</div>";
-
-add_task(function* () {
-  yield addTab(TEST_URI);
-  let Telemetry = loadTelemetryAndRecordLogs();
-
-  let target = TargetFactory.forTab(gBrowser.selectedTab);
-  let toolbox = yield gDevTools.showToolbox(target, "inspector");
-  info("inspector opened");
-
-  info("testing the eyedropper button");
-  yield testButton(toolbox, Telemetry);
-
-  stopRecordingTelemetryLogs(Telemetry);
-  yield gDevTools.closeToolbox(target);
-  gBrowser.removeCurrentTab();
-});
-
-function* testButton(toolbox, Telemetry) {
-  info("Calling the eyedropper button's callback");
-  // We call the button callback directly because we don't need to test the UI here, we're
-  // only concerned about testing the telemetry probe.
-  yield toolbox.getPanel("inspector").showEyeDropper();
-
-  checkResults("_EYEDROPPER_", Telemetry);
-}
-
-function checkResults(histIdFocus, Telemetry) {
-  let result = Telemetry.prototype.telemetryInfo;
-
-  for (let [histId, value] of Object.entries(result)) {
-    if (histId.startsWith("DEVTOOLS_INSPECTOR_") ||
-        !histId.includes(histIdFocus)) {
-      // Inspector stats are tested in
-      // browser_telemetry_toolboxtabs_{toolname}.js so we skip them here
-      // because we only open the inspector once for this test.
-      continue;
-    }
-
-    if (histId.endsWith("OPENED_COUNT")) {
-      is(value.length, 1, histId + " has one entry");
-
-      let okay = value.every(element => element === true);
-      ok(okay, "All " + histId + " entries are === true");
-    }
-  }
-}
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+const TEST_URI = "data:text/html;charset=utf-8," +
+  "<p>browser_telemetry_button_eyedropper.js</p><div>test</div>";
+
+add_task(function* () {
+  yield addTab(TEST_URI);
+  let Telemetry = loadTelemetryAndRecordLogs();
+
+  let target = TargetFactory.forTab(gBrowser.selectedTab);
+  let toolbox = yield gDevTools.showToolbox(target, "inspector");
+  info("inspector opened");
+
+  info("testing the eyedropper button");
+  yield testButton(toolbox, Telemetry);
+
+  stopRecordingTelemetryLogs(Telemetry);
+  yield gDevTools.closeToolbox(target);
+  gBrowser.removeCurrentTab();
+});
+
+function* testButton(toolbox, Telemetry) {
+  info("Calling the eyedropper button's callback");
+  // We call the button callback directly because we don't need to test the UI here, we're
+  // only concerned about testing the telemetry probe.
+  yield toolbox.getPanel("inspector").showEyeDropper();
+
+  checkResults("_EYEDROPPER_", Telemetry);
+}
+
+function checkResults(histIdFocus, Telemetry) {
+  let result = Telemetry.prototype.telemetryInfo;
+
+  for (let [histId, value] of Object.entries(result)) {
+    if (histId.startsWith("DEVTOOLS_INSPECTOR_") ||
+        !histId.includes(histIdFocus)) {
+      // Inspector stats are tested in
+      // browser_telemetry_toolboxtabs_{toolname}.js so we skip them here
+      // because we only open the inspector once for this test.
+      continue;
+    }
+
+    if (histId.endsWith("OPENED_COUNT")) {
+      is(value.length, 1, histId + " has one entry");
+
+      let okay = value.every(element => element === true);
+      ok(okay, "All " + histId + " entries are === true");
+    }
+  }
+}
--- a/devtools/client/shared/test/browser_telemetry_button_responsive.js
+++ b/devtools/client/shared/test/browser_telemetry_button_responsive.js
@@ -1,11 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 const TEST_URI = "data:text/html;charset=utf-8," +
   "<p>browser_telemetry_button_responsive.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
 const { ResponsiveUIManager } = Cu.import("resource://devtools/client/responsivedesign/responsivedesign.jsm", {});
--- a/devtools/client/shared/test/browser_telemetry_button_scratchpad.js
+++ b/devtools/client/shared/test/browser_telemetry_button_scratchpad.js
@@ -1,11 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 const TEST_URI = "data:text/html;charset=utf-8," +
   "<p>browser_telemetry_button_scratchpad.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
 add_task(function* () {
@@ -43,17 +45,18 @@ function trackScratchpadWindows() {
 
           if (win.Scratchpad) {
             win.Scratchpad.addObserver({
               onReady: function () {
                 win.Scratchpad.removeObserver(this);
                 numScratchpads++;
                 win.close();
 
-                info("another scratchpad was opened and closed, count is now " + numScratchpads);
+                info("another scratchpad was opened and closed, " +
+                     `count is now ${numScratchpads}`);
 
                 if (numScratchpads === 4) {
                   Services.ww.unregisterNotification(observer);
                   info("4 scratchpads have been opened and closed, checking results");
                   resolve();
                 }
               },
             });
--- a/devtools/client/shared/test/browser_telemetry_sidebar.js
+++ b/devtools/client/shared/test/browser_telemetry_sidebar.js
@@ -1,11 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_sidebar.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
 add_task(function* () {
   yield addTab(TEST_URI);
--- a/devtools/client/shared/test/browser_telemetry_toolbox.js
+++ b/devtools/client/shared/test/browser_telemetry_toolbox.js
@@ -1,11 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 const TEST_URI = "data:text/html;charset=utf-8," +
   "<p>browser_telemetry_toolbox.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
 add_task(function* () {
--- a/devtools/client/shared/test/browser_telemetry_toolboxtabs_canvasdebugger.js
+++ b/devtools/client/shared/test/browser_telemetry_toolboxtabs_canvasdebugger.js
@@ -1,11 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 const TEST_URI = "data:text/html;charset=utf-8," +
   "<p>browser_telemetry_toolboxtabs_canvasdebugger.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
 add_task(function* () {
--- a/devtools/client/shared/test/browser_telemetry_toolboxtabs_inspector.js
+++ b/devtools/client/shared/test/browser_telemetry_toolboxtabs_inspector.js
@@ -1,11 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 const TEST_URI = "data:text/html;charset=utf-8," +
   "<p>browser_telemetry_toolboxtabs_inspector.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
 add_task(function* () {
--- a/devtools/client/shared/test/browser_telemetry_toolboxtabs_jsdebugger.js
+++ b/devtools/client/shared/test/browser_telemetry_toolboxtabs_jsdebugger.js
@@ -1,11 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 const TEST_URI = "data:text/html;charset=utf-8," +
   "<p>browser_telemetry_toolboxtabs_jsdebugger.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
 add_task(function* () {
--- a/devtools/client/shared/test/browser_telemetry_toolboxtabs_jsprofiler.js
+++ b/devtools/client/shared/test/browser_telemetry_toolboxtabs_jsprofiler.js
@@ -1,12 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_jsprofiler.js</p>";
+"use strict";
+
+const TEST_URI = "data:text/html;charset=utf-8," +
+  "<p>browser_telemetry_toolboxtabs_jsprofiler.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
 add_task(function* () {
   yield addTab(TEST_URI);
   let Telemetry = loadTelemetryAndRecordLogs();
--- a/devtools/client/shared/test/browser_telemetry_toolboxtabs_netmonitor.js
+++ b/devtools/client/shared/test/browser_telemetry_toolboxtabs_netmonitor.js
@@ -1,12 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_netmonitor.js</p>";
+"use strict";
+
+const TEST_URI = "data:text/html;charset=utf-8," +
+  "<p>browser_telemetry_toolboxtabs_netmonitor.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
 add_task(function* () {
   yield addTab(TEST_URI);
   let Telemetry = loadTelemetryAndRecordLogs();
--- a/devtools/client/shared/test/browser_telemetry_toolboxtabs_options.js
+++ b/devtools/client/shared/test/browser_telemetry_toolboxtabs_options.js
@@ -1,12 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_options.js</p>";
+"use strict";
+
+const TEST_URI = "data:text/html;charset=utf-8," +
+  "<p>browser_telemetry_toolboxtabs_options.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
 add_task(function* () {
   yield addTab(TEST_URI);
   let Telemetry = loadTelemetryAndRecordLogs();
--- a/devtools/client/shared/test/browser_telemetry_toolboxtabs_shadereditor.js
+++ b/devtools/client/shared/test/browser_telemetry_toolboxtabs_shadereditor.js
@@ -1,32 +1,37 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 //
 // Whitelisting this test.
 // As part of bug 1077403, the leaking uncaught rejection should be fixed.
 //
-thisTestLeaksUncaughtRejectionsAndShouldBeFixed("Error: Shader Editor is still waiting for a WebGL context to be created.");
+thisTestLeaksUncaughtRejectionsAndShouldBeFixed(
+  "Error: Shader Editor is still waiting for a WebGL context to be created.");
 
-const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_shadereditor.js</p>";
+const TEST_URI = "data:text/html;charset=utf-8," +
+  "<p>browser_telemetry_toolboxtabs_shadereditor.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
+const TOOL_PREF = "devtools.shadereditor.enabled";
 
 add_task(function* () {
   info("Active the sharer editor");
-  let originalPref = Services.prefs.getBoolPref("devtools.shadereditor.enabled");
-  Services.prefs.setBoolPref("devtools.shadereditor.enabled", true);
+  let originalPref = Services.prefs.getBoolPref(TOOL_PREF);
+  Services.prefs.setBoolPref(TOOL_PREF, true);
 
   yield addTab(TEST_URI);
   let Telemetry = loadTelemetryAndRecordLogs();
 
   yield openAndCloseToolbox(2, TOOL_DELAY, "shadereditor");
   checkTelemetryResults(Telemetry);
 
   stopRecordingTelemetryLogs(Telemetry);
   gBrowser.removeCurrentTab();
 
   info("De-activate the sharer editor");
-  Services.prefs.setBoolPref("devtools.shadereditor.enabled", originalPref);
+  Services.prefs.setBoolPref(TOOL_PREF, originalPref);
 });
--- a/devtools/client/shared/test/browser_telemetry_toolboxtabs_storage.js
+++ b/devtools/client/shared/test/browser_telemetry_toolboxtabs_storage.js
@@ -1,12 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_storage.js</p>";
+"use strict";
+
+const TEST_URI = "data:text/html;charset=utf-8," +
+  "<p>browser_telemetry_toolboxtabs_storage.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 1000;
 
 add_task(function* () {
   info("Activating the storage inspector");
   Services.prefs.setBoolPref("devtools.storage.enabled", true);
--- a/devtools/client/shared/test/browser_telemetry_toolboxtabs_styleeditor.js
+++ b/devtools/client/shared/test/browser_telemetry_toolboxtabs_styleeditor.js
@@ -1,12 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_styleeditor.js</p>";
+"use strict";
+
+const TEST_URI = "data:text/html;charset=utf-8," +
+  "<p>browser_telemetry_toolboxtabs_styleeditor.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
 add_task(function* () {
   yield addTab(TEST_URI);
   let Telemetry = loadTelemetryAndRecordLogs();
--- a/devtools/client/shared/test/browser_telemetry_toolboxtabs_webaudioeditor.js
+++ b/devtools/client/shared/test/browser_telemetry_toolboxtabs_webaudioeditor.js
@@ -1,12 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_webaudioeditor.js</p>";
+"use strict";
+
+const TEST_URI = "data:text/html;charset=utf-8," +
+  "<p>browser_telemetry_toolboxtabs_webaudioeditor.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
 add_task(function* () {
   info("Activating the webaudioeditor");
   let originalPref = Services.prefs.getBoolPref("devtools.webaudioeditor.enabled");
--- a/devtools/client/shared/test/browser_telemetry_toolboxtabs_webconsole.js
+++ b/devtools/client/shared/test/browser_telemetry_toolboxtabs_webconsole.js
@@ -1,12 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_styleeditor_webconsole.js</p>";
+"use strict";
+
+const TEST_URI = "data:text/html;charset=utf-8," +
+  "<p>browser_telemetry_toolboxtabs_styleeditor_webconsole.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
 add_task(function* () {
   yield addTab(TEST_URI);
   let Telemetry = loadTelemetryAndRecordLogs();
--- a/devtools/client/shared/test/browser_templater_basic.js
+++ b/devtools/client/shared/test/browser_templater_basic.js
@@ -1,77 +1,76 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that the DOM Template engine works properly
 
 /*
  * These tests run both in Mozilla/Mochitest and plain browsers (as does
  * domtemplate)
  * We should endevour to keep the source in sync.
  */
 
 const {template} = require("devtools/shared/gcli/templater");
 
 const TEST_URI = TEST_URI_ROOT + "browser_templater_basic.html";
 
 var test = Task.async(function* () {
   yield addTab("about:blank");
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [host,, doc] = yield createHost("bottom", TEST_URI);
 
   info("Starting DOM Templater Tests");
   runTest(0, host, doc);
 });
 
 function runTest(index, host, doc) {
-  var options = tests[index] = tests[index]();
-  var holder = doc.createElement("div");
+  let options = tests[index] = tests[index]();
+  let holder = doc.createElement("div");
   holder.id = options.name;
-  var body = doc.body;
+  let body = doc.body;
   body.appendChild(holder);
   holder.innerHTML = options.template;
 
   info("Running " + options.name);
   template(holder, options.data, options.options);
 
   if (typeof options.result == "string") {
     is(holder.innerHTML, options.result, options.name);
-  }
-  else {
+  } else {
     ok(holder.innerHTML.match(options.result) != null,
        options.name + " result='" + holder.innerHTML + "'");
   }
 
   if (options.also) {
     options.also(options);
   }
 
   function runNextTest() {
     index++;
     if (index < tests.length) {
       runTest(index, host, doc);
-    }
-    else {
+    } else {
       finished(host);
     }
   }
 
   if (options.later) {
-    var ais = is.bind(this);
+    let ais = is.bind(this);
 
-    function createTester(holder, options) {
+    function createTester(testHolder, testOptions) {
       return () => {
-        ais(holder.innerHTML, options.later, options.name + " later");
+        ais(testHolder.innerHTML, testOptions.later, testOptions.name + " later");
         runNextTest();
       };
     }
 
     executeSoon(createTester(holder, options));
-  }
-  else {
+  } else {
     runNextTest();
   }
 }
 
 function finished(host) {
   host.destroy();
   gBrowser.removeCurrentTab();
   info("Finishing DOM Templater Tests");
@@ -83,203 +82,205 @@ function finished(host) {
  * Why have an array of functions that return data rather than just an array
  * of the data itself? Some of these tests contain calls to delayReply() which
  * sets up async processing using executeSoon(). Since the execution of these
  * tests is asynchronous, the delayed reply will probably arrive before the
  * test is executed, making the test be synchronous. So we wrap the data in a
  * function so we only set it up just before we use it.
  */
 var tests = [
-  function () { return {
+  () => ({
     name: "simpleNesting",
     template: '<div id="ex1">${nested.value}</div>',
-    data: { nested:{ value:"pass 1" } },
+    data: { nested: { value: "pass 1" } },
     result: '<div id="ex1">pass 1</div>'
-  };},
+  }),
 
-  function () { return {
+  () => ({
     name: "returnDom",
     template: '<div id="ex2">${__element.ownerDocument.createTextNode(\'pass 2\')}</div>',
     options: { allowEval: true },
     data: {},
     result: '<div id="ex2">pass 2</div>'
-  };},
+  }),
 
-  function () { return {
+  () => ({
     name: "srcChange",
     template: '<img _src="${fred}" id="ex3">',
-    data: { fred:"green.png" },
+    data: { fred: "green.png" },
     result: /<img( id="ex3")? src="green.png"( id="ex3")?>/
-  };},
+  }),
 
-  function () { return {
+  () => ({
     name: "ifTrue",
     template: '<p if="${name !== \'jim\'}">hello ${name}</p>',
     options: { allowEval: true },
     data: { name: "fred" },
     result: "<p>hello fred</p>"
-  };},
+  }),
 
-  function () { return {
+  () => ({
     name: "ifFalse",
     template: '<p if="${name !== \'jim\'}">hello ${name}</p>',
     options: { allowEval: true },
     data: { name: "jim" },
     result: ""
-  };},
+  }),
 
-  function () { return {
+  () => ({
     name: "simpleLoop",
     template: '<p foreach="index in ${[ 1, 2, 3 ]}">${index}</p>',
     options: { allowEval: true },
     data: {},
     result: "<p>1</p><p>2</p><p>3</p>"
-  };},
+  }),
 
-  function () { return {
+  () => ({
     name: "loopElement",
     template: '<loop foreach="i in ${array}">${i}</loop>',
     data: { array: [ 1, 2, 3 ] },
     result: "123"
-  };},
+  }),
 
   // Bug 692028: DOMTemplate memory leak with asynchronous arrays
   // Bug 692031: DOMTemplate async loops do not drop the loop element
-  function () { return {
+  () => ({
     name: "asyncLoopElement",
     template: '<loop foreach="i in ${array}">${i}</loop>',
     data: { array: delayReply([1, 2, 3]) },
     result: "<span></span>",
     later: "123"
-  };},
+  }),
 
-  function () { return {
+  () => ({
     name: "saveElement",
     template: '<p save="${element}">${name}</p>',
     data: { name: "pass 8" },
     result: "<p>pass 8</p>",
     also: function (options) {
       ok(options.data.element.innerHTML, "pass 9", "saveElement saved");
       delete options.data.element;
     }
-  };},
+  }),
 
-  function () { return {
+  () => ({
     name: "useElement",
     template: '<p id="pass9">${adjust(__element)}</p>',
     options: { allowEval: true },
     data: {
       adjust: function (element) {
         is("pass9", element.id, "useElement adjust");
         return "pass 9b";
       }
     },
     result: '<p id="pass9">pass 9b</p>'
-  };},
+  }),
 
-  function () { return {
+  () => ({
     name: "asyncInline",
     template: "${delayed}",
     data: { delayed: delayReply("inline") },
     result: "<span></span>",
     later: "inline"
-  };},
+  }),
 
   // Bug 692028: DOMTemplate memory leak with asynchronous arrays
-  function () { return {
+  () => ({
     name: "asyncArray",
     template: '<p foreach="i in ${delayed}">${i}</p>',
     data: { delayed: delayReply([1, 2, 3]) },
     result: "<span></span>",
     later: "<p>1</p><p>2</p><p>3</p>"
-  };},
+  }),
 
-  function () { return {
+  () => ({
     name: "asyncMember",
     template: '<p foreach="i in ${delayed}">${i}</p>',
     data: { delayed: [delayReply(4), delayReply(5), delayReply(6)] },
     result: "<span></span><span></span><span></span>",
     later: "<p>4</p><p>5</p><p>6</p>"
-  };},
+  }),
 
   // Bug 692028: DOMTemplate memory leak with asynchronous arrays
-  function () { return {
+  () => ({
     name: "asyncBoth",
     template: '<p foreach="i in ${delayed}">${i}</p>',
     data: {
       delayed: delayReply([
         delayReply(4),
         delayReply(5),
         delayReply(6)
       ])
     },
     result: "<span></span>",
     later: "<p>4</p><p>5</p><p>6</p>"
-  };},
+  }),
 
   // Bug 701762: DOMTemplate fails when ${foo()} returns undefined
-  function () { return {
+  () => ({
     name: "functionReturningUndefiend",
     template: "<p>${foo()}</p>",
     options: { allowEval: true },
     data: {
       foo: function () {}
     },
     result: "<p>undefined</p>"
-  };},
+  }),
 
   // Bug 702642: DOMTemplate is relatively slow when evaluating JS ${}
-  function () { return {
+  () => ({
     name: "propertySimple",
     template: "<p>${a.b.c}</p>",
     data: { a: { b: { c: "hello" } } },
     result: "<p>hello</p>"
-  };},
+  }),
 
-  function () { return {
+  () => ({
     name: "propertyPass",
     template: "<p>${Math.max(1, 2)}</p>",
     options: { allowEval: true },
     result: "<p>2</p>"
-  };},
+  }),
 
-  function () { return {
+  () => ({
     name: "propertyFail",
     template: "<p>${Math.max(1, 2)}</p>",
     result: "<p>${Math.max(1, 2)}</p>"
-  };},
+  }),
 
   // Bug 723431: DOMTemplate should allow customisation of display of
   // null/undefined values
-  function () { return {
+  () => ({
     name: "propertyUndefAttrFull",
     template: "<p>${nullvar}|${undefinedvar1}|${undefinedvar2}</p>",
     data: { nullvar: null, undefinedvar1: undefined },
     result: "<p>null|undefined|undefined</p>"
-  };},
+  }),
 
-  function () { return {
+  () => ({
     name: "propertyUndefAttrBlank",
     template: "<p>${nullvar}|${undefinedvar1}|${undefinedvar2}</p>",
     data: { nullvar: null, undefinedvar1: undefined },
     options: { blankNullUndefined: true },
     result: "<p>||</p>"
-  };},
+  }),
 
-  function () { return {
+  /* eslint-disable max-len */
+  () => ({
     name: "propertyUndefAttrFull",
     template: '<div><p value="${nullvar}"></p><p value="${undefinedvar1}"></p><p value="${undefinedvar2}"></p></div>',
     data: { nullvar: null, undefinedvar1: undefined },
     result: '<div><p value="null"></p><p value="undefined"></p><p value="undefined"></p></div>'
-  };},
+  }),
 
-  function () { return {
+  () => ({
     name: "propertyUndefAttrBlank",
     template: '<div><p value="${nullvar}"></p><p value="${undefinedvar1}"></p><p value="${undefinedvar2}"></p></div>',
     data: { nullvar: null, undefinedvar1: undefined },
     options: { blankNullUndefined: true },
     result: '<div><p value=""></p><p value=""></p><p value=""></p></div>'
-  };}
+  })
+  /* eslint-enable max-len */
 ];
 
 function delayReply(data) {
   return new Promise(resolve => resolve(data));
 }
--- a/devtools/client/shared/test/browser_theme.js
+++ b/devtools/client/shared/test/browser_theme.js
@@ -1,15 +1,17 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that theme utilities work
 
-var {getColor, getTheme, setTheme} = require("devtools/client/shared/theme");
+const {getColor, getTheme, setTheme} = require("devtools/client/shared/theme");
 
 add_task(function* () {
   testGetTheme();
   testSetTheme();
   testGetColor();
   testColorExistence();
 });
 
@@ -33,66 +35,64 @@ function testSetTheme() {
     is(pref, "devtools.theme",
       "The 'pref-changed' event triggered by setTheme has correct pref.");
     is(oldValue, originalTheme,
       "The 'pref-changed' event triggered by setTheme has correct oldValue.");
     is(newValue, "dark",
       "The 'pref-changed' event triggered by setTheme has correct newValue.");
   });
   setTheme("dark");
-  is(Services.prefs.getCharPref("devtools.theme"), "dark", "setTheme() correctly sets dark theme.");
+  is(Services.prefs.getCharPref("devtools.theme"), "dark",
+     "setTheme() correctly sets dark theme.");
   setTheme("light");
-  is(Services.prefs.getCharPref("devtools.theme"), "light", "setTheme() correctly sets light theme.");
+  is(Services.prefs.getCharPref("devtools.theme"), "light",
+     "setTheme() correctly sets light theme.");
   setTheme("firebug");
-  is(Services.prefs.getCharPref("devtools.theme"), "firebug", "setTheme() correctly sets firebug theme.");
+  is(Services.prefs.getCharPref("devtools.theme"), "firebug",
+     "setTheme() correctly sets firebug theme.");
   setTheme("unknown");
-  is(Services.prefs.getCharPref("devtools.theme"), "unknown", "setTheme() correctly sets an unknown theme.");
+  is(Services.prefs.getCharPref("devtools.theme"), "unknown",
+     "setTheme() correctly sets an unknown theme.");
   Services.prefs.setCharPref("devtools.theme", originalTheme);
 }
 
 function testGetColor() {
   let BLUE_DARK = "#46afe3";
   let BLUE_LIGHT = "#0088cc";
   let BLUE_FIREBUG = "#3455db";
   let originalTheme = getTheme();
 
   setTheme("dark");
   is(getColor("highlight-blue"), BLUE_DARK, "correctly gets color for enabled theme.");
   setTheme("light");
   is(getColor("highlight-blue"), BLUE_LIGHT, "correctly gets color for enabled theme.");
   setTheme("firebug");
   is(getColor("highlight-blue"), BLUE_FIREBUG, "correctly gets color for enabled theme.");
   setTheme("metal");
-  is(getColor("highlight-blue"), BLUE_LIGHT, "correctly uses light for default theme if enabled theme not found");
+  is(getColor("highlight-blue"), BLUE_LIGHT,
+     "correctly uses light for default theme if enabled theme not found");
 
-  is(getColor("highlight-blue", "dark"), BLUE_DARK, "if provided and found, uses the provided theme.");
-  is(getColor("highlight-blue", "firebug"), BLUE_FIREBUG, "if provided and found, uses the provided theme.");
-  is(getColor("highlight-blue", "metal"), BLUE_LIGHT, "if provided and not found, defaults to light theme.");
+  is(getColor("highlight-blue", "dark"), BLUE_DARK,
+     "if provided and found, uses the provided theme.");
+  is(getColor("highlight-blue", "firebug"), BLUE_FIREBUG,
+     "if provided and found, uses the provided theme.");
+  is(getColor("highlight-blue", "metal"), BLUE_LIGHT,
+     "if provided and not found, defaults to light theme.");
   is(getColor("somecomponents"), null, "if a type cannot be found, should return null.");
 
   setTheme(originalTheme);
 }
 
 function testColorExistence() {
-  var vars = ["body-background", "sidebar-background", "contrast-background", "tab-toolbar-background",
-   "toolbar-background", "selection-background", "selection-color",
-   "selection-background-semitransparent", "splitter-color", "comment", "body-color",
-   "body-color-alt", "content-color1", "content-color2", "content-color3",
+  const vars = ["body-background", "sidebar-background", "contrast-background",
+   "tab-toolbar-background", "toolbar-background", "selection-background",
+   "selection-color", "selection-background-semitransparent", "splitter-color", "comment",
+   "body-color", "body-color-alt", "content-color1", "content-color2", "content-color3",
    "highlight-green", "highlight-blue", "highlight-bluegrey", "highlight-purple",
    "highlight-lightorange", "highlight-orange", "highlight-red", "highlight-pink"
   ];
 
   for (let type of vars) {
     ok(getColor(type, "light"), `${type} is a valid color in light theme`);
     ok(getColor(type, "dark"), `${type} is a valid color in light theme`);
     ok(getColor(type, "firebug"), `${type} is a valid color in light theme`);
   }
 }
-
-function isColor(s) {
-  // Regexes from Heather Arthur's `color-string`
-  // https://github.com/harthur/color-string
-  // MIT License
-  return /^#([a-fA-F0-9]{3})$/.test(s) ||
-         /^#([a-fA-F0-9]{6})$/.test(s) ||
-         /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d\.]+)\s*)?\)$/.test(s) ||
-         /^rgba?\(\s*([\d\.]+)\%\s*,\s*([\d\.]+)\%\s*,\s*([\d\.]+)\%\s*(?:,\s*([\d\.]+)\s*)?\)$/.test(s);
-}
--- a/devtools/client/shared/test/browser_theme_switching.js
+++ b/devtools/client/shared/test/browser_theme_switching.js
@@ -1,13 +1,13 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-var toolbox;
+"use strict";
 
 add_task(function* () {
   let target = TargetFactory.forTab(gBrowser.selectedTab);
   let toolbox = yield gDevTools.showToolbox(target);
   let doc = toolbox.doc;
   let root = doc.documentElement;
 
   let platform = root.getAttribute("platform");
@@ -19,32 +19,35 @@ add_task(function* () {
   ok(root.classList.contains(className),
      ":root has " + className + " class (current theme)");
 
   // Convert the xpath result into an array of strings
   // like `href="{URL}" type="text/css"`
   let sheetsIterator = doc.evaluate("processing-instruction('xml-stylesheet')",
                        doc, null, XPathResult.ANY_TYPE, null);
   let sheetsInDOM = [];
+
+  /* eslint-disable no-cond-assign */
   let sheet;
   while (sheet = sheetsIterator.iterateNext()) {
     sheetsInDOM.push(sheet.data);
   }
+  /* eslint-enable no-cond-assign */
 
   let sheetsFromTheme = gDevTools.getThemeDefinition(theme).stylesheets;
   info("Checking for existence of " + sheetsInDOM.length + " sheets");
-  for (let sheet of sheetsFromTheme) {
-    ok(sheetsInDOM.some(s=>s.includes(sheet)), "There is a stylesheet for " + sheet);
+  for (let themeSheet of sheetsFromTheme) {
+    ok(sheetsInDOM.some(s => s.includes(themeSheet)),
+       "There is a stylesheet for " + themeSheet);
   }
 
   yield toolbox.destroy();
 });
 
 function getPlatform() {
   let {OS} = Services.appinfo;
   if (OS == "WINNT") {
     return "win";
   } else if (OS == "Darwin") {
     return "mac";
-  } else {
-    return "linux";
   }
+  return "linux";
 }
--- a/devtools/client/shared/test/browser_toolbar_basic.html
+++ b/devtools/client/shared/test/browser_toolbar_basic.html
@@ -4,17 +4,20 @@
 
 <html>
 <head>
   <meta charset="UTF-8">
   <title>Developer Toolbar Tests</title>
   <style type="text/css">
   #single { color: red; }
   </style>
-  <script type="text/javascript">var a=1;</script>
+  <script type="text/javascript">
+  /* eslint-disable */
+  var a = 1;
+  </script>
 </head>
 <body>
 
 <p id=single>
 1
 </p>
 
 <p class=twin>
@@ -23,13 +26,15 @@ 2a
 
 <p class=twin>
 2b
 </p>
 
 <style>
 .twin { color: blue; }
 </style>
-<script>var b=2;</script>
+<script>
+/* eslint-disable */
+var b = 2;
+</script>
 
 </body>
 </html>
-
--- a/devtools/client/shared/test/browser_toolbar_basic.js
+++ b/devtools/client/shared/test/browser_toolbar_basic.js
@@ -1,11 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that the developer toolbar works properly
 
 const TEST_URI = TEST_URI_ROOT + "browser_toolbar_basic.html";
 
 add_task(function* () {
   info("Starting browser_toolbar_basic.js");
   yield addTab(TEST_URI);
 
@@ -19,17 +21,17 @@ add_task(function* () {
   let close = document.getElementById("developer-toolbar-closebutton");
   ok(close, "Close button exists");
 
   let toggleToolbox =
     document.getElementById("menu_devToolbox");
   ok(!isChecked(toggleToolbox), "toggle toolbox button is not checked");
 
   let target = TargetFactory.forTab(gBrowser.selectedTab);
-  let toolbox = yield gDevTools.showToolbox(target, "inspector");
+  yield gDevTools.showToolbox(target, "inspector");
   ok(isChecked(toggleToolbox), "toggle toolbox button is checked");
 
   yield addTab("about:blank");
   info("Opened a new tab");
 
   ok(!isChecked(toggleToolbox), "toggle toolbox button is not checked");
 
   gBrowser.removeCurrentTab();
--- a/devtools/client/shared/test/browser_toolbar_tooltip.js
+++ b/devtools/client/shared/test/browser_toolbar_tooltip.js
@@ -1,18 +1,22 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that the developer toolbar works properly
 
 //
 // Whitelisting this test.
 // As part of bug 1077403, the leaking uncaught rejection should be fixed.
 //
-thisTestLeaksUncaughtRejectionsAndShouldBeFixed("Protocol error (unknownError): Error: Got an invalid root window in DocumentWalker");
+thisTestLeaksUncaughtRejectionsAndShouldBeFixed(
+  "Protocol error (unknownError): Error: Got an invalid root window in DocumentWalker"
+);
 
 const TEST_URI = "data:text/html;charset=utf-8,<p>Tooltip Tests</p>";
 const PREF_DEVTOOLS_THEME = "devtools.theme";
 
 registerCleanupFunction(() => {
   // Set preferences back to their original values
   Services.prefs.clearUserPref(PREF_DEVTOOLS_THEME);
 });
@@ -70,17 +74,16 @@ add_task(function* testThemes() {
   Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "light");
 
   yield DeveloperToolbar.inputter.setInput("");
   yield DeveloperToolbar.inputter.setInput("help help");
   is(tooltipPanel.document.documentElement.getAttribute("devtoolstheme"),
      "light", "Tooltip panel has correct theme");
 });
 
-
 add_task(function* hideToolbar() {
   info("Ending browser_toolbar_tooltip.js");
   yield DeveloperToolbar.inputter.setInput("");
 
   ok(DeveloperToolbar.visible, "DeveloperToolbar is visible in hideToolbar");
 
   info("Hide toolbar");
   let hidePromise = observeOnce(DeveloperToolbar.NOTIFICATIONS.HIDE);
@@ -99,10 +102,10 @@ function getLeftMargin() {
 
 function observeOnce(topic, ownsWeak = false) {
   return new Promise(function (resolve, reject) {
     let resolver = function (subject) {
       Services.obs.removeObserver(resolver, topic);
       resolve(subject);
     };
     Services.obs.addObserver(resolver, topic, ownsWeak);
-  }.bind(this));
+  });
 }
--- a/devtools/client/shared/test/browser_toolbar_webconsole_errors_count.html
+++ b/devtools/client/shared/test/browser_toolbar_webconsole_errors_count.html
@@ -1,18 +1,19 @@
 <!DOCTYPE HTML>
 <!-- Any copyright is dedicated to the Public Domain.
      http://creativecommons.org/publicdomain/zero/1.0/ -->
 <html>
 <head>
   <meta charset="UTF-8">
   <title>Developer Toolbar Tests - errors count in the Web Console button</title>
   <script type="text/javascript">
+    "use strict";
     console.log("foobarBug762996consoleLog");
-    window.onload = function() {
+    window.onload = function () {
       window.foobarBug762996load();
     };
     window.foobarBug762996a();
   </script>
   <script type="text/javascript">
     window.foobarBug762996b();
   </script>
 </head>
--- a/devtools/client/shared/test/browser_toolbar_webconsole_errors_count.js
+++ b/devtools/client/shared/test/browser_toolbar_webconsole_errors_count.js
@@ -1,25 +1,28 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+/* eslint-disable mozilla/no-cpows-in-tests */
+
+"use strict";
+
 // Tests that the developer toolbar errors count works properly.
 
 // Use the old webconsole since this is directly accessing old DOM, and
 // the error count isn't reset when pressing the clear button in new one
 // See Bug 1304794.
 Services.prefs.setBoolPref("devtools.webconsole.new-frontend-enabled", false);
 registerCleanupFunction(function* () {
   Services.prefs.clearUserPref("devtools.webconsole.new-frontend-enabled");
 });
 
 function test() {
   const TEST_URI = TEST_URI_ROOT + "browser_toolbar_webconsole_errors_count.html";
 
-
   let tab1, tab2, webconsole;
 
   Services.prefs.setBoolPref("javascript.options.strict", true);
 
   registerCleanupFunction(() => {
     Services.prefs.clearUserPref("javascript.options.strict");
   });
 
@@ -29,18 +32,17 @@ function test() {
   function openToolbar(tab) {
     tab1 = tab;
     ignoreAllUncaughtExceptions(false);
 
     expectUncaughtException();
 
     if (!DeveloperToolbar.visible) {
       DeveloperToolbar.show(true).then(onOpenToolbar);
-    }
-    else {
+    } else {
       onOpenToolbar();
     }
   }
 
   function onOpenToolbar() {
     ok(DeveloperToolbar.visible, "DeveloperToolbar is visible");
     webconsole = document.getElementById("developer-toolbar-toolbox-button");
 
@@ -97,17 +99,18 @@ function test() {
     });
   }
 
   function onWebConsoleOpen(hud) {
     dump("lolz!!\n");
     waitForValue({
       name: "web console shows the page errors",
       validator: function () {
-        return hud.outputNode.querySelectorAll(".message[category=exception][severity=error]").length;
+        let selector = ".message[category=exception][severity=error]";
+        return hud.outputNode.querySelectorAll(selector).length;
       },
       value: 4,
       success: checkConsoleOutput.bind(null, hud),
       failure: () => {
         finish();
       },
     });
   }
@@ -128,17 +131,18 @@ function test() {
 
     expectUncaughtException();
     let button = content.document.querySelector("button");
     EventUtils.synthesizeMouse(button, 2, 2, {}, content);
 
     waitForButtonUpdate({
       name: "button shows one more error after another click in page",
       errors: 5,
-      warnings: 1, // warnings are not repeated by the js engine
+      // warnings are not repeated by the js engine
+      warnings: 1,
       callback: () => waitForValue(waitForNewError),
     });
 
     let waitForNewError = {
       name: "the Web Console displays the new error",
       validator: function () {
         return hud.outputNode.textContent.indexOf("foobarBug762996click") > -1;
       },
@@ -178,17 +182,18 @@ function test() {
         warnings: 0,
         callback: waitForValue.bind(null, waitForConsoleOutputAfterReload),
       });
     }
 
     let waitForConsoleOutputAfterReload = {
       name: "the Web Console displays the correct number of errors after reload",
       validator: function () {
-        return hud.outputNode.querySelectorAll(".message[category=exception][severity=error]").length;
+        let selector = ".message[category=exception][severity=error]";
+        return hud.outputNode.querySelectorAll(selector).length;
       },
       value: 3,
       success: function () {
         isnot(hud.outputNode.textContent.indexOf("foobarBug762996load"), -1,
               "foobarBug762996load found in console output after page reload");
         testEnd();
       },
       failure: testEnd,
@@ -238,15 +243,14 @@ function test() {
       DeveloperToolbar.on("errors-counter-updated", function onUpdate(event) {
         if (check()) {
           DeveloperToolbar.off(event, onUpdate);
         }
       });
     }
   }
 
-  function openWebConsole(tab, callback)
-  {
+  function openWebConsole(tab, callback) {
     let target = TargetFactory.forTab(tab);
     gDevTools.showToolbox(target, "webconsole").then((toolbox) =>
       callback(toolbox.getCurrentPanel().hud));
   }
 }
--- a/devtools/client/shared/test/browser_treeWidget_keyboard_interaction.js
+++ b/devtools/client/shared/test/browser_treeWidget_keyboard_interaction.js
@@ -1,12 +1,14 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that keyboard interaction works fine with the tree widget
 
 const TEST_URI = "data:text/html;charset=utf-8,<head>" +
   "<link rel='stylesheet' type='text/css' href='chrome://devtools/skin/widg" +
   "ets.css'></head><body><div></div><span></span></body>";
 const {TreeWidget} = require("devtools/client/shared/widgets/TreeWidget");
 
 add_task(function* () {
--- a/devtools/client/shared/test/browser_treeWidget_mouse_interaction.js
+++ b/devtools/client/shared/test/browser_treeWidget_mouse_interaction.js
@@ -1,22 +1,24 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Tests that mouse interaction works fine with tree widget
 
 const TEST_URI = "data:text/html;charset=utf-8,<head>" +
   "<link rel='stylesheet' type='text/css' href='chrome://devtools/skin/widg" +
   "ets.css'></head><body><div></div><span></span></body>";
 const {TreeWidget} = require("devtools/client/shared/widgets/TreeWidget");
 
 add_task(function* () {
   yield addTab("about:blank");
-  let [host, win, doc] = yield createHost("bottom", TEST_URI);
+  let [host,, doc] = yield createHost("bottom", TEST_URI);
 
   let tree = new TreeWidget(doc.querySelector("div"), {
     defaultType: "store"
   });
 
   populateTree(tree, doc);
   yield testMouseInteraction(tree);
 
@@ -90,46 +92,44 @@ function* testMouseInteraction(tree) {
 
   tree.once("select", pass);
   let node = tree.root.children.firstChild.firstChild;
   info("clicking on first top level item");
   event = defer();
   ok(!node.classList.contains("theme-selected"),
      "Node should not have selected class before clicking");
   click(node);
-  let [name, data, attachment] = yield event.promise;
+  let [, data, attachment] = yield event.promise;
   ok(node.classList.contains("theme-selected"),
      "Node has selected class after click");
   is(data[0], "level1.2", "Correct tree path is emitted");
   ok(attachment && attachment.foo, "Correct attachment is emitted");
   is(attachment.foo, "bar", "Correct attachment value is emitted");
 
   info("clicking second top level item with children to check if it expands");
   let node2 = tree.root.children.firstChild.nextSibling.firstChild;
   event = defer();
   // node should not have selected class
   ok(!node2.classList.contains("theme-selected"),
      "New node should not have selected class before clicking");
   ok(!node2.hasAttribute("expanded"), "New node is not expanded before clicking");
   tree.once("select", pass);
   click(node2);
-  [name, data, attachment] = yield event.promise;
+  [, data, attachment] = yield event.promise;
   ok(node2.classList.contains("theme-selected"),
      "New node has selected class after clicking");
   is(data[0], "level1", "Correct tree path is emitted for new node");
   ok(!attachment, "null attachment should be emitted for new node");
   ok(node2.hasAttribute("expanded"), "New node expanded after click");
 
   ok(!node.classList.contains("theme-selected"),
      "Old node should not have selected class after the click on new node");
 
-
   // clicking again should just collapse
   // this will not emit "select" event
   event = defer();
-  node2.addEventListener("click", function onClick() {
-    node2.removeEventListener("click", onClick);
+  node2.addEventListener("click", () => {
     executeSoon(() => event.resolve(null));
-  });
+  }, { once: true });
   click(node2);
   yield event.promise;
   ok(!node2.hasAttribute("expanded"), "New node collapsed after click again");
 }
--- a/devtools/client/shared/test/helper_color_data.js
+++ b/devtools/client/shared/test/helper_color_data.js
@@ -1,8 +1,11 @@
+"use strict";
+
+/* eslint-disable max-len */
 function getFixtureColorData() {
   return [
     {authored: "aliceblue", name: "aliceblue", hex: "#f0f8ff", hsl: "hsl(208, 100%, 97.1%)", rgb: "rgb(240, 248, 255)", cycle: 4},
     {authored: "antiquewhite", name: "antiquewhite", hex: "#faebd7", hsl: "hsl(34.3, 77.8%, 91.2%)", rgb: "rgb(250, 235, 215)", cycle: 4},
     {authored: "aqua", name: "aqua", hex: "#0ff", hsl: "hsl(180, 100%, 50%)", rgb: "rgb(0, 255, 255)", cycle: 4},
     {authored: "aquamarine", name: "aquamarine", hex: "#7fffd4", hsl: "hsl(159.8, 100%, 74.9%)", rgb: "rgb(127, 255, 212)", cycle: 4},
     {authored: "azure", name: "azure", hex: "#f0ffff", hsl: "hsl(180, 100%, 97.1%)", rgb: "rgb(240, 255, 255)", cycle: 4},
     {authored: "beige", name: "beige", hex: "#f5f5dc", hsl: "hsl(60, 55.6%, 91.2%)", rgb: "rgb(245, 245, 220)", cycle: 4},
@@ -159,13 +162,14 @@ function getFixtureColorData() {
     {authored: "currentcolor", name: "currentcolor", hex: "currentcolor", hsl: "currentcolor", rgb: "currentcolor", cycle: false},
     {authored: "inherit", name: "inherit", hex: "inherit", hsl: "inherit", rgb: "inherit", cycle: false},
     {authored: "initial", name: "initial", hex: "initial", hsl: "initial", rgb: "initial", cycle: false},
     {authored: "invalidColor", name: "", hex: "", hsl: "", rgb: "", cycle: false},
     {authored: "transparent", name: "transparent", hex: "transparent", hsl: "transparent", rgb: "transparent", cycle: false},
     {authored: "unset", name: "unset", hex: "unset", hsl: "unset", rgb: "unset", cycle: false},
   ];
 }
+/* eslint-enable max-len */
 
 // Allow this function to be shared on mochitests and xpcshell tests.
 if (typeof module === "object") {
   module.exports = getFixtureColorData;
 }
--- a/devtools/client/shared/test/leakhunt.js
+++ b/devtools/client/shared/test/leakhunt.js
@@ -1,68 +1,68 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+"use strict";
+
 /**
  * Memory leak hunter. Walks a tree of objects looking for DOM nodes.
  * Usage:
  * leakHunt({
  *   thing: thing,
  *   otherthing: otherthing
  * });
  */
 function leakHunt(root) {
-  var path = [];
-  var seen = [];
+  let path = [];
+  let seen = [];
 
   try {
-    var output = leakHunt.inner(root, path, seen);
+    let output = leakHunt.inner(root, path, seen);
     output.forEach(function (line) {
       dump(line + "\n");
     });
-  }
-  catch (ex) {
+  } catch (ex) {
     dump(ex + "\n");
   }
 }
 
-leakHunt.inner = function LH_inner(root, path, seen) {
-  var prefix = new Array(path.length).join("  ");
+leakHunt.inner = function (root, path, seen) {
+  let prefix = new Array(path.length).join("  ");
 
-  var reply = [];
+  let reply = [];
   function log(msg) {
     reply.push(msg);
   }
 
-  var direct;
+  let direct;
   try {
     direct = Object.keys(root);
-  }
-  catch (ex) {
+  } catch (ex) {
     log(prefix + "  Error enumerating: " + ex);
     return reply;
   }
 
   try {
-    var index = 0;
-    for (var data of root) {
-      var prop = "" + index;
+    let index = 0;
+    for (let data of root) {
+      let prop = "" + index;
       leakHunt.digProperty(prop, data, path, seen, direct, log);
       index++;
     }
+  } catch (ex) {
+    /* Ignore things that are not enumerable */
   }
-  catch (ex) { /* Ignore things that are not enumerable */ }
 
-  for (var prop in root) {
-    var data;
+  for (let prop in root) {
+    let data;
     try {
       data = root[prop];
-    }
-    catch (ex) {
+    } catch (ex) {
       log(prefix + "  " + prop + " = Error: " + ex.toString().substring(0, 30));
       continue;
     }
 
     leakHunt.digProperty(prop, data, path, seen, direct, log);
   }
 
   return reply;
@@ -72,99 +72,94 @@ leakHunt.hide = [ /^string$/, /^number$/
 
 leakHunt.noRecurse = [
   /^string$/, /^number$/, /^boolean$/, /^null/, /^undefined/,
   /^Window$/, /^Document$/,
   /^XULDocument$/, /^XULElement$/,
   /^DOMWindow$/, /^HTMLDocument$/, /^HTML.*Element$/, /^ChromeWindow$/
 ];
 
-leakHunt.digProperty = function LH_digProperty(prop, data, path, seen, direct, log) {
-  var newPath = path.slice();
+leakHunt.digProperty = function (prop, data, path, seen, direct, log) {
+  let newPath = path.slice();
   newPath.push(prop);
-  var prefix = new Array(newPath.length).join("  ");
+  let prefix = new Array(newPath.length).join("  ");
 
-  var recurse = true;
-  var message = leakHunt.getType(data);
+  let recurse = true;
+  let message = leakHunt.getType(data);
 
   if (leakHunt.matchesAnyPattern(message, leakHunt.hide)) {
     return;
   }
 
   if (message === "function" && direct.indexOf(prop) == -1) {
     return;
   }
 
   if (message === "string") {
-    var extra = data.length > 10 ? data.substring(0, 9) + "_" : data;
+    let extra = data.length > 10 ? data.substring(0, 9) + "_" : data;
     message += ' "' + extra.replace(/\n/g, "|") + '"';
     recurse = false;
-  }
-  else if (leakHunt.matchesAnyPattern(message, leakHunt.noRecurse)) {
+  } else if (leakHunt.matchesAnyPattern(message, leakHunt.noRecurse)) {
     message += " (no recurse)";
     recurse = false;
-  }
-  else if (seen.indexOf(data) !== -1) {
+  } else if (seen.indexOf(data) !== -1) {
     message += " (already seen)";
     recurse = false;
   }
 
   if (recurse) {
     seen.push(data);
-    var lines = leakHunt.inner(data, newPath, seen);
+    let lines = leakHunt.inner(data, newPath, seen);
     if (lines.length == 0) {
       if (message !== "function") {
         log(prefix + prop + " = " + message + " { }");
       }
-    }
-    else {
+    } else {
       log(prefix + prop + " = " + message + " {");
       lines.forEach(function (line) {
         log(line);
       });
       log(prefix + "}");
     }
-  }
-  else {
+  } else {
     log(prefix + prop + " = " + message);
   }
 };
 
-leakHunt.matchesAnyPattern = function LH_matchesAnyPattern(str, patterns) {
-  var match = false;
+leakHunt.matchesAnyPattern = function (str, patterns) {
+  let match = false;
   patterns.forEach(function (pattern) {
     if (str.match(pattern)) {
       match = true;
     }
   });
   return match;
 };
 
-leakHunt.getType = function LH_getType(data) {
+leakHunt.getType = function (data) {
   if (data === null) {
     return "null";
   }
   if (data === undefined) {
     return "undefined";
   }
 
-  var type = typeof data;
+  let type = typeof data;
   if (type === "object" || type === "Object") {
     type = leakHunt.getCtorName(data);
   }
 
   return type;
 };
 
-leakHunt.getCtorName = function LH_getCtorName(aObj) {
+leakHunt.getCtorName = function (obj) {
   try {
-    if (aObj.constructor && aObj.constructor.name) {
-      return aObj.constructor.name;
+    if (obj.constructor && obj.constructor.name) {
+      return obj.constructor.name;
     }
-  }
-  catch (ex) {
+  } catch (ex) {
     return "UnknownObject";
   }
 
   // If that fails, use Objects toString which sometimes gives something
   // better than 'Object', and at least defaults to Object if nothing better
-  return Object.prototype.toString.call(aObj).slice(8, -1);
+  return Object.prototype.toString.call(obj).slice(8, -1);
 };
--- a/devtools/client/shared/test/test-actor.js
+++ b/devtools/client/shared/test/test-actor.js
@@ -1,55 +1,60 @@
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  http://creativecommons.org/publicdomain/zero/1.0/ */
 
+/* exported TestActor, TestActorFront */
+
 "use strict";
 
 // A helper actor for inspector and markupview tests.
 
-var { Cc, Ci, Cu, Cr } = require("chrome");
+const { Cc, Ci, Cu } = require("chrome");
 const {getRect, getElementFromPoint, getAdjustedQuads} = require("devtools/shared/layout/utils");
 const defer = require("devtools/shared/defer");
 const {Task} = require("devtools/shared/task");
 const {isContentStylesheet} = require("devtools/shared/inspector/css-logic");
-var DOMUtils = Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
-var loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
-            .getService(Ci.mozIJSSubScriptLoader);
+const DOMUtils = Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
+const loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
+                 .getService(Ci.mozIJSSubScriptLoader);
 
 // Set up a dummy environment so that EventUtils works. We need to be careful to
 // pass a window object into each EventUtils method we call rather than having
 // it rely on the |window| global.
 let EventUtils = {};
 EventUtils.window = {};
 EventUtils.parent = {};
+/* eslint-disable camelcase */
 EventUtils._EU_Ci = Components.interfaces;
 EventUtils._EU_Cc = Components.classes;
+/* eslint-disable camelcase */
 loader.loadSubScript("chrome://mochikit/content/tests/SimpleTest/EventUtils.js", EventUtils);
 
 const protocol = require("devtools/shared/protocol");
-const {Arg, Option, method, RetVal, types} = protocol;
+const {Arg, RetVal} = protocol;
 
-var dumpn = msg => {
+const dumpn = msg => {
   dump(msg + "\n");
 };
 
 /**
  * Get the instance of CanvasFrameAnonymousContentHelper used by a given
  * highlighter actor.
  * The instance provides methods to get/set attributes/text/style on nodes of
  * the highlighter, inserted into the nsCanvasFrame.
  * @see /devtools/server/actors/highlighters.js
  * @param {String} actorID
  */
 function getHighlighterCanvasFrameHelper(conn, actorID) {
   let actor = conn.getActor(actorID);
   if (actor && actor._highlighter) {
     return actor._highlighter.markup;
   }
+  return null;
 }
 
 var testSpec = protocol.generateActorSpec({
   typeName: "testActor",
 
   methods: {
     getNumberOfElementMatches: {
       request: {
@@ -347,16 +352,17 @@ var TestActor = exports.TestActor = prot
    * - {String} actorID The highlighter actor ID
    * @return {String} The value, if found, null otherwise
    */
   getHighlighterAttribute: function (nodeID, name, actorID) {
     let helper = getHighlighterCanvasFrameHelper(this.conn, actorID);
     if (helper) {
       return helper.getAttributeForElement(nodeID, name);
     }
+    return null;
   },
 
   /**
    * Get the textcontent of one of the elements of the box model highlighter,
    * given its ID.
    * @param {String} nodeID The full ID of the element to get the attribute for
    * @param {String} actorID The highlighter actor ID
    * @return {String} The textcontent value
@@ -376,42 +382,37 @@ var TestActor = exports.TestActor = prot
    * @return {Number} The number of box-model highlighters created, or null if the
    * SelectorHighlighter was not found.
    */
   getSelectorHighlighterBoxNb: function (actorID) {
     let highlighter = this.conn.getActor(actorID);
     let {_highlighter: h} = highlighter;
     if (!h || !h._highlighters) {
       return null;
-    } else {
-      return h._highlighters.length;
     }
+    return h._highlighters.length;
   },
 
   /**
    * Subscribe to the box-model highlighter's update event, modify an attribute of
    * the currently highlighted node and send a message when the highlighter has
    * updated.
    * @param {String} the name of the attribute to be changed
    * @param {String} the new value for the attribute
    * @param {String} actorID The highlighter actor ID
    */
   changeHighlightedNodeWaitForUpdate: function (name, value, actorID) {
-    let deferred = defer();
-
-    let highlighter = this.conn.getActor(actorID);
-    let {_highlighter: h} = highlighter;
+    return new Promise(resolve => {
+      let highlighter = this.conn.getActor(actorID);
+      let {_highlighter: h} = highlighter;
 
-    h.once("updated", () => {
-      deferred.resolve();
-    });
+      h.once("updated", resolve);
 
-    h.currentNode.setAttribute(name, value);
-
-    return deferred.promise;
+      h.currentNode.setAttribute(name, value);
+    });
   },
 
   /**
    * Subscribe to a given highlighter event and respond when the event is received.
    * @param {String} event The name of the highlighter event to listen to
    * @param {String} actorID The highlighter actor ID
    */
   waitForHighlighterEvent: function (event, actorID) {
@@ -441,34 +442,30 @@ var TestActor = exports.TestActor = prot
    * Change the zoom level of the page.
    * Optionally subscribe to the box-model highlighter's update event and waiting
    * for it to refresh before responding.
    * @param {Number} level The new zoom level
    * @param {String} actorID Optional. The highlighter actor ID
    */
   changeZoomLevel: function (level, actorID) {
     dumpn("Zooming page to " + level);
-    let deferred = defer();
+    return new Promise(resolve => {
+      if (actorID) {
+        let actor = this.conn.getActor(actorID);
+        let {_highlighter: h} = actor;
+        h.once("updated", resolve);
+      } else {
+        resolve();
+      }
 
-    if (actorID) {
-      let actor = this.conn.getActor(actorID);
-      let {_highlighter: h} = actor;
-      h.once("updated", () => {
-        deferred.resolve();
-      });
-    } else {
-      deferred.resolve();
-    }
-
-    let docShell = this.content.QueryInterface(Ci.nsIInterfaceRequestor)
-                               .getInterface(Ci.nsIWebNavigation)
-                               .QueryInterface(Ci.nsIDocShell);
-    docShell.contentViewer.fullZoom = level;
-
-    return deferred.promise;
+      let docShell = this.content.QueryInterface(Ci.nsIInterfaceRequestor)
+                                 .getInterface(Ci.nsIWebNavigation)
+                                 .QueryInterface(Ci.nsIDocShell);
+      docShell.contentViewer.fullZoom = level;
+    });
   },
 
   assertElementAtPoint: function (x, y, selector) {
     let elementAtPoint = getElementFromPoint(this.content.document, x, y);
     if (!elementAtPoint) {
       throw new Error("Unable to find element at (" + x + ", " + y + ")");
     }
     let node = this._querySelector(selector);
@@ -538,30 +535,27 @@ var TestActor = exports.TestActor = prot
    * @return {Boolean}
    */
   hasPseudoClassLock: function (selector, pseudo) {
     let node = this._querySelector(selector);
     return DOMUtils.hasPseudoClassLock(node, pseudo);
   },
 
   loadAndWaitForCustomEvent: function (url) {
-    let deferred = defer();
-    let self = this;
-    // Wait for DOMWindowCreated first, as listening on the current outerwindow
-    // doesn't allow receiving test-page-processing-done.
-    this.tabActor.chromeEventHandler.addEventListener("DOMWindowCreated", function onWindowCreated() {
-      self.tabActor.chromeEventHandler.removeEventListener("DOMWindowCreated", onWindowCreated);
-      self.content.addEventListener("test-page-processing-done", function onEvent() {
-        self.content.removeEventListener("test-page-processing-done", onEvent);
-        deferred.resolve();
-      });
+    return new Promise(resolve => {
+      // Wait for DOMWindowCreated first, as listening on the current outerwindow
+      // doesn't allow receiving test-page-processing-done.
+      this.tabActor.chromeEventHandler.addEventListener("DOMWindowCreated", () => {
+        this.content.addEventListener(
+          "test-page-processing-done", resolve, { once: true }
+        );
+      }, { once: true });
+
+      this.content.location = url;
     });
-
-    this.content.location = url;
-    return deferred.promise;
   },
 
   hasNode: function (selector) {
     try {
       // _querySelector throws if the node doesn't exists
       this._querySelector(selector);
       return true;
     } catch (e) {
@@ -806,35 +800,43 @@ var TestActorFront = exports.TestActorFr
    * @param {Number} level The new zoom level.
    * @return {Promise} The returned promise will only resolve when the
    * highlighter has updated to the new zoom level.
    */
   zoomPageTo: function (level) {
     return this.changeZoomLevel(level, this.toolbox.highlighter.actorID);
   },
 
+  /* eslint-disable max-len */
   changeHighlightedNodeWaitForUpdate: protocol.custom(function (name, value, highlighter) {
-    return this._changeHighlightedNodeWaitForUpdate(name, value, (highlighter || this.toolbox.highlighter).actorID);
+    /* eslint-enable max-len */
+    return this._changeHighlightedNodeWaitForUpdate(
+      name, value, (highlighter || this.toolbox.highlighter).actorID
+    );
   }, {
     impl: "_changeHighlightedNodeWaitForUpdate"
   }),
 
   /**
    * Get the value of an attribute on one of the highlighter's node.
    * @param {String} nodeID The Id of the node in the highlighter.
    * @param {String} name The name of the attribute.
    * @param {Object} highlighter Optional custom highlither to target
    * @return {String} value
    */
   getHighlighterNodeAttribute: function (nodeID, name, highlighter) {
-    return this.getHighlighterAttribute(nodeID, name, (highlighter || this.toolbox.highlighter).actorID);
+    return this.getHighlighterAttribute(
+      nodeID, name, (highlighter || this.toolbox.highlighter).actorID
+    );
   },
 
   getHighlighterNodeTextContent: protocol.custom(function (nodeID, highlighter) {
-    return this._getHighlighterNodeTextContent(nodeID, (highlighter || this.toolbox.highlighter).actorID);
+    return this._getHighlighterNodeTextContent(
+      nodeID, (highlighter || this.toolbox.highlighter).actorID
+    );
   }, {
     impl: "_getHighlighterNodeTextContent"
   }),
 
   /**
    * Is the highlighter currently visible on the page?
    */
   isHighlighting: function () {
@@ -867,17 +869,17 @@ var TestActorFront = exports.TestActorFr
     }
   }),
 
   /**
    * Get the current rect of the border region of the box-model highlighter
    */
   getSimpleBorderRect: Task.async(function* (toolbox) {
     let {border} = yield this._getBoxModelStatus(toolbox);
-    let {p1, p2, p3, p4} = border.points;
+    let {p1, p2, p4} = border.points;
 
     return {
       top: p1.y,
       left: p1.x,
       width: p2.x - p1.x,
       height: p4.y - p1.y
     };
   }),
@@ -1061,17 +1063,19 @@ var TestActorFront = exports.TestActorFr
    * @param {String} region The box model region name.
    * @param {Front} highlighter The front of the highlighter.
    * @return {Object} The object returned has the following form:
    * - d {String} the d attribute value
    * - points {Array} an array of all the polygons defined by the path. Each box
    *   is itself an Array of points, themselves being [x,y] coordinates arrays.
    */
   getHighlighterRegionPath: Task.async(function* (region, highlighter) {
-    let d = yield this.getHighlighterNodeAttribute("box-model-" + region, "d", highlighter);
+    let d = yield this.getHighlighterNodeAttribute(
+      `box-model-${region}`, "d", highlighter
+    );
     if (!d) {
       return {d: null};
     }
 
     let polygons = d.match(/M[^M]+/g);
     if (!polygons) {
       return {d};
     }
--- a/devtools/client/shared/test/unit/test_VariablesView_filtering-without-controller.js
+++ b/devtools/client/shared/test/unit/test_VariablesView_filtering-without-controller.js
@@ -1,13 +1,15 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Test that VariablesView._doSearch() works even without an attached
 // VariablesViewController (bug 1196341).
 
 var Cu = Components.utils;
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 const DOMParser = Cc["@mozilla.org/xmlextras/domparser;1"]
                     .createInstance(Ci.nsIDOMParser);
--- a/devtools/client/shared/test/unit/test_VariablesView_getString_promise.js
+++ b/devtools/client/shared/test/unit/test_VariablesView_getString_promise.js
@@ -1,15 +1,16 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-var Cu = Components.utils;
-const { VariablesView } = Cu.import("resource://devtools/client/shared/widgets/VariablesView.jsm", {});
+"use strict";
+
+const { VariablesView } = Components.utils.import("resource://devtools/client/shared/widgets/VariablesView.jsm", {});
 
 const PENDING = {
   "type": "object",
   "class": "Promise",
   "actor": "conn0.pausedobj35",
   "extensible": true,
   "frozen": false,
   "sealed": false,
@@ -62,13 +63,14 @@ const REJECTED = {
   }
 };
 
 function run_test() {
   equal(VariablesView.getString(PENDING, { concise: true }), "Promise");
   equal(VariablesView.getString(PENDING), 'Promise {<state>: "pending"}');
 
   equal(VariablesView.getString(FULFILLED, { concise: true }), "Promise");
-  equal(VariablesView.getString(FULFILLED), 'Promise {<state>: "fulfilled", <value>: 10}');
+  equal(VariablesView.getString(FULFILLED),
+        'Promise {<state>: "fulfilled", <value>: 10}');
 
   equal(VariablesView.getString(REJECTED, { concise: true }), "Promise");
   equal(VariablesView.getString(REJECTED), 'Promise {<state>: "rejected", <reason>: 10}');
 }
--- a/devtools/client/shared/test/unit/test_advanceValidate.js
+++ b/devtools/client/shared/test/unit/test_advanceValidate.js
@@ -2,24 +2,23 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Tests the advanceValidate function from rule-view.js.
 
-var Cu = Components.utils;
-var Ci = Components.interfaces;
-var {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
-var {advanceValidate} = require("devtools/client/inspector/shared/utils");
+const {utils: Cu, interfaces: Ci} = Components;
+const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
+const {advanceValidate} = require("devtools/client/inspector/shared/utils");
 
 //                            1         2         3
 //                  0123456789012345678901234567890
-var sampleInput = '\\symbol "string" url(somewhere)';
+const sampleInput = '\\symbol "string" url(somewhere)';
 
 function testInsertion(where, result, testName) {
   do_print(testName);
   equal(advanceValidate(Ci.nsIDOMKeyEvent.DOM_VK_SEMICOLON, sampleInput, where),
         result, "testing advanceValidate at " + where);
 }
 
 function run_test() {
--- a/devtools/client/shared/test/unit/test_attribute-parsing-01.js
+++ b/devtools/client/shared/test/unit/test_attribute-parsing-01.js
@@ -1,15 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Test splitBy from node-attribute-parser.js
 
-var Cu = Components.utils;
-var {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
+const {require} = Components.utils.import("resource://devtools/shared/Loader.jsm", {});
 const {splitBy} = require("devtools/client/shared/node-attribute-parser");
 
 const TEST_DATA = [{
   value: "this is a test",
   splitChar: " ",
   expected: [
     {value: "this"},
     {value: " ", type: "string"},
--- a/devtools/client/shared/test/unit/test_attribute-parsing-02.js
+++ b/devtools/client/shared/test/unit/test_attribute-parsing-02.js
@@ -1,15 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 // Test parseAttribute from node-attribute-parser.js
 
-var Cu = Components.utils;
-var {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
+const {require} = Components.utils.import("resource://devtools/shared/Loader.jsm", {});
 const {parseAttribute} = require("devtools/client/shared/node-attribute-parser");
 
 const TEST_DATA = [{
   tagName: "body",
   namespaceURI: "http://www.w3.org/1999/xhtml",
   attributeName: "class",
   attributeValue: "some css class names",
   expected: [
@@ -106,17 +107,20 @@ const TEST_DATA = [{
   ]
 }];
 
 function run_test() {
   for (let {tagName, namespaceURI, attributeName,
             otherAttributes, attributeValue, expected} of TEST_DATA) {
     do_print("Testing <" + tagName + " " + attributeName + "='" + attributeValue + "'>");
 
-    let attributes = [...otherAttributes || [], {name: attributeName, value: attributeValue}];
+    let attributes = [
+      ...otherAttributes || [],
+      { name: attributeName, value: attributeValue }
+    ];
     let tokens = parseAttribute(namespaceURI, tagName, attributes, attributeName);
     if (!expected) {
       do_check_true(!tokens);
       continue;
     }
 
     do_print("Checking that the number of parsed tokens is correct");
     do_check_eq(tokens.length, expected.length);
--- a/devtools/client/shared/test/unit/test_bezierCanvas.js
+++ b/devtools/client/shared/test/unit/test_bezierCanvas.js
@@ -74,17 +74,19 @@ function convertsOffsetsToCoordinates() 
   do_check_eq(coordinates[1], 1);
 }
 
 function plotsCanvas() {
   do_print("Plots the curve to the canvas");
 
   let hasDrawnCurve = false;
   let b = new BezierCanvas(getCanvasMock(), getCubicBezier(), [.25, 0]);
-  b.ctx.bezierCurveTo = () => hasDrawnCurve = true;
+  b.ctx.bezierCurveTo = () => {
+    hasDrawnCurve = true;
+  };
   b.plot();
 
   do_check_true(hasDrawnCurve);
 }
 
 function getCubicBezier() {
   return new CubicBezier([0, 0, 1, 1]);
 }
--- a/devtools/client/shared/test/unit/test_cssColor-03.js
+++ b/devtools/client/shared/test/unit/test_cssColor-03.js
@@ -50,12 +50,12 @@ function run_test() {
 
   for (let test of CSS_COLOR_4_TESTS) {
     let oursOld = colorUtils.colorToRGBA(test, true);
     let oursNew = colorUtils.colorToRGBA(test, false);
     let platform = DOMUtils.colorToRGBA(test);
     notEqual(oursOld, platform, "old style parser for color " + test +
              " should not match DOMUtils");
     ok(oursOld === null, "'" + test + "' is not a color with old parser");
-    deepEqual(oursNew, platform, "css-color-4 parser for color " + test + " matches DOMUtils");
+    deepEqual(oursNew, platform, `css-color-4 parser for color ${test} matches DOMUtils`);
     ok(oursNew !== null, "'" + test + "' is a color with css-color-4 parser");
   }
 }
--- a/devtools/client/shared/test/unit/test_parseDeclarations.js
+++ b/devtools/client/shared/test/unit/test_parseDeclarations.js
@@ -1,17 +1,16 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-var Cu = Components.utils;
-const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
+const {require} = Components.utils.import("resource://devtools/shared/Loader.jsm", {});
 const {parseDeclarations, _parseCommentDeclarations} = require("devtools/shared/css/parsing-utils");
 const {isCssPropertyKnown} = require("devtools/server/actors/css-properties");
 
 const TEST_DATA = [
   // Simple test
   {
     input: "p:v;",
     expected: [{name: "p", value: "v", priority: "", offsets: [0, 4]}]
@@ -234,22 +233,23 @@ const TEST_DATA = [
     expected: [{
       name: "content",
       value: "'this \\' is a \" really strange string'",
       priority: "",
       offsets: [0, 47]
     }]
   },
   {
-    input: "content: \"a not s\\\
-          o very long title\"",
-    expected: [
-      {name: "content", value: '"a not s\\\
-          o very long title"', priority: "", offsets: [0, 46]}
-    ]
+    input: "content: \"a not s\\          o very long title\"",
+    expected: [{
+      name: "content",
+      value: '"a not s\\          o very long title"',
+      priority: "",
+      offsets: [0, 46]
+    }]
   },
   // Test calc with nested parentheses
   {
     input: "width: calc((100% - 3em) / 2)",
     expected: [{name: "width", value: "calc((100% - 3em) / 2)", priority: "",
                 offsets: [0, 29]}]
   },
 
--- a/devtools/client/shared/test/unit/test_rewriteDeclarations.js
+++ b/devtools/client/shared/test/unit/test_rewriteDeclarations.js
@@ -508,19 +508,17 @@ function rewriteDeclarations(inputString
     default:
       throw new Error("unrecognized instruction");
   }
 
   return rewriter.getResult();
 }
 
 function run_test() {
-  let i = 0;
   for (let test of TEST_DATA) {
-    ++i;
     let {changed, text} = rewriteDeclarations(test.input, test.instruction,
                                               "\t");
     equal(text, test.expected, "output for " + test.desc);
 
     let expectChanged;
     if ("changed" in test) {
       expectChanged = test.changed;
     } else {
--- a/devtools/client/shared/test/unit/test_source-utils.js
+++ b/devtools/client/shared/test/unit/test_source-utils.js
@@ -1,17 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
+"use strict";
+
 /**
  * Tests utility functions contained in `source-utils.js`
  */
 
-const Cu = Components.utils;
-const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
+const { require } = Components.utils.import("resource://devtools/shared/Loader.jsm", {});
 const sourceUtils = require("devtools/client/shared/source-utils");
 
 function run_test() {
   run_next_test();
 }
 
 const CHROME_URLS = [
   "chrome://foo", "resource://baz", "jar:file:///Users/root"
@@ -29,36 +30,39 @@ add_task(function* () {
   equal(parsed.hostname, "foo.com", "parseURL parsed valid hostname");
   equal(parsed.port, "8888", "parseURL parsed valid port");
   equal(parsed.href, "https://foo.com:8888/boo/bar.js?q=query", "parseURL parsed valid href");
 
   parsed = sourceUtils.parseURL("https://foo.com");
   equal(parsed.host, "foo.com", "parseURL parsed valid host when no port given");
   equal(parsed.hostname, "foo.com", "parseURL parsed valid hostname when no port given");
 
-  equal(sourceUtils.parseURL("self-hosted"), null, "parseURL returns `null` for invalid URLs");
+  equal(sourceUtils.parseURL("self-hosted"), null,
+        "parseURL returns `null` for invalid URLs");
 });
 
 // Test `sourceUtils.isContentScheme`.
 add_task(function* () {
   for (let url of CHROME_URLS) {
-    ok(!sourceUtils.isContentScheme(url), `${url} correctly identified as not content scheme`);
+    ok(!sourceUtils.isContentScheme(url),
+       `${url} correctly identified as not content scheme`);
   }
   for (let url of CONTENT_URLS) {
     ok(sourceUtils.isContentScheme(url), `${url} correctly identified as content scheme`);
   }
 });
 
 // Test `sourceUtils.isChromeScheme`.
 add_task(function* () {
   for (let url of CHROME_URLS) {
     ok(sourceUtils.isChromeScheme(url), `${url} correctly identified as chrome scheme`);
   }
   for (let url of CONTENT_URLS) {
-    ok(!sourceUtils.isChromeScheme(url), `${url} correctly identified as not chrome scheme`);
+    ok(!sourceUtils.isChromeScheme(url),
+       `${url} correctly identified as not chrome scheme`);
   }
 });
 
 // Test `sourceUtils.isDataScheme`.
 add_task(function* () {
   let dataURI = "data:text/html;charset=utf-8,<!DOCTYPE html></html>";
   ok(sourceUtils.isDataScheme(dataURI), `${dataURI} correctly identified as data scheme`);
 
@@ -75,24 +79,25 @@ add_task(function* () {
   testAbbreviation("http://example.com/foo/bar/baz/boo.js",
                    "boo.js",
                    "http://example.com/foo/bar/baz/boo.js",
                    "example.com");
 });
 
 // Test `sourceUtils.isScratchpadTheme`
 add_task(function* () {
-  ok(sourceUtils.isScratchpadScheme("Scratchpad/1"), "Scratchpad/1 identified as scratchpad");
-  ok(sourceUtils.isScratchpadScheme("Scratchpad/20"), "Scratchpad/20 identified as scratchpad");
+  ok(sourceUtils.isScratchpadScheme("Scratchpad/1"),
+     "Scratchpad/1 identified as scratchpad");
+  ok(sourceUtils.isScratchpadScheme("Scratchpad/20"),
+     "Scratchpad/20 identified as scratchpad");
   ok(!sourceUtils.isScratchpadScheme("http://www.mozilla.org"), "http://www.mozilla.org not identified as scratchpad");
 });
 
 // Test `sourceUtils.getSourceNames`.
 add_task(function* () {
-
   // Check length
   let longMalformedURL = `example.com${new Array(100).fill("/a").join("")}/file.js`;
   ok(sourceUtils.getSourceNames(longMalformedURL).short.length <= 100,
     "`short` names are capped at 100 characters");
 
   testAbbreviation("self-hosted", "self-hosted", "self-hosted");
   testAbbreviation("", "(unknown)", "(unknown)");
 
--- a/devtools/client/shared/test/unit/test_undoStack.js
+++ b/devtools/client/shared/test/unit/test_undoStack.js
@@ -1,31 +1,31 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-var Cu = Components.utils;
-var {Loader} = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {});
+"use strict";
 
-var loader = new Loader.Loader({
+const {Loader} = Components.utils.import("resource://gre/modules/commonjs/toolkit/loader.js", {});
+
+const loader = new Loader.Loader({
   paths: {
     "": "resource://gre/modules/commonjs/",
     "devtools": "resource://devtools",
   },
   globals: {},
 });
-var require = Loader.Require(loader, { id: "undo-test" });
+const require = Loader.Require(loader, { id: "undo-test" });
 
-var {UndoStack} = require("devtools/client/shared/undo");
+const {UndoStack} = require("devtools/client/shared/undo");
 
 const MAX_SIZE = 5;
 
-function run_test()
-{
+function run_test() {
   let str = "";
   let stack = new UndoStack(MAX_SIZE);
 
   function add(ch) {
     stack.do(function () {
       str += ch;
     }, function () {
       str = str.slice(0, -1);
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -35,17 +35,16 @@
 #ifdef MOZ_GAMEPAD
 #include "mozilla/dom/GamepadServiceTest.h"
 #endif
 #include "mozilla/dom/PowerManager.h"
 #include "mozilla/dom/WakeLock.h"
 #include "mozilla/dom/power/PowerManagerService.h"
 #include "mozilla/dom/FlyWebPublishedServer.h"
 #include "mozilla/dom/FlyWebService.h"
-#include "mozilla/dom/InputPortManager.h"
 #include "mozilla/dom/Permissions.h"
 #include "mozilla/dom/Presentation.h"
 #include "mozilla/dom/ServiceWorkerContainer.h"
 #include "mozilla/dom/StorageManager.h"
 #include "mozilla/dom/TCPSocket.h"
 #include "mozilla/dom/VRDisplay.h"
 #include "mozilla/dom/workers/RuntimeService.h"
 #include "mozilla/Hal.h"
@@ -202,17 +201,16 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMimeTypes)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPlugins)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPermissions)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGeolocation)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNotification)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBatteryManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBatteryPromise)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPowerManager)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mInputPortManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mConnection)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStorageManager)
 #ifdef MOZ_AUDIO_CHANNEL_MANAGER
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAudioChannelManager)
 #endif
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMediaDevices)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTimeManager)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mServiceWorkerContainer)
@@ -265,20 +263,16 @@ Navigator::Invalidate()
 
   mBatteryPromise = nullptr;
 
   if (mPowerManager) {
     mPowerManager->Shutdown();
     mPowerManager = nullptr;
   }
 
-  if (mInputPortManager) {
-    mInputPortManager = nullptr;
-  }
-
   if (mConnection) {
     mConnection->Shutdown();
     mConnection = nullptr;
   }
 
   mMediaDevices = nullptr;
 
 #ifdef MOZ_AUDIO_CHANNEL_MANAGER
@@ -1578,33 +1572,16 @@ Navigator::RequestWakeLock(const nsAStri
   if (!pmService) {
     aRv.Throw(NS_ERROR_UNEXPECTED);
     return nullptr;
   }
 
   return pmService->NewWakeLock(aTopic, mWindow, aRv);
 }
 
-InputPortManager*
-Navigator::GetInputPortManager(ErrorResult& aRv)
-{
-  if (!mInputPortManager) {
-    if (!mWindow) {
-      aRv.Throw(NS_ERROR_FAILURE);
-      return nullptr;
-    }
-    mInputPortManager = InputPortManager::Create(mWindow, aRv);
-    if (NS_WARN_IF(aRv.Failed())) {
-      return nullptr;
-    }
-  }
-
-  return mInputPortManager;
-}
-
 already_AddRefed<LegacyMozTCPSocket>
 Navigator::MozTCPSocket()
 {
   RefPtr<LegacyMozTCPSocket> socket = new LegacyMozTCPSocket(GetWindow());
   return socket.forget();
 }
 
 #ifdef MOZ_GAMEPAD
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -68,17 +68,16 @@ class NavigatorUserMediaSuccessCallback;
 class NavigatorUserMediaErrorCallback;
 class MozGetUserMediaDevicesSuccessCallback;
 
 namespace network {
 class Connection;
 } // namespace network
 
 class PowerManager;
-class InputPortManager;
 class DeviceStorageAreaListener;
 class Presentation;
 class LegacyMozTCPSocket;
 class VRDisplay;
 class StorageManager;
 
 namespace time {
 class TimeManager;
@@ -204,17 +203,16 @@ public:
                          nsTArray<RefPtr<nsDOMDeviceStorage> >& aStores,
                          ErrorResult& aRv);
 
   already_AddRefed<nsDOMDeviceStorage>
   GetDeviceStorageByNameAndType(const nsAString& aName, const nsAString& aType,
                                 ErrorResult& aRv);
 
   DesktopNotificationCenter* GetMozNotification(ErrorResult& aRv);
-  InputPortManager* GetInputPortManager(ErrorResult& aRv);
   already_AddRefed<LegacyMozTCPSocket> MozTCPSocket();
   network::Connection* GetConnection(ErrorResult& aRv);
   MediaDevices* GetMediaDevices(ErrorResult& aRv);
 
 #ifdef MOZ_GAMEPAD
   void GetGamepads(nsTArray<RefPtr<Gamepad> >& aGamepads, ErrorResult& aRv);
   GamepadServiceTest* RequestGamepadServiceTest();
 #endif // MOZ_GAMEPAD
@@ -297,17 +295,16 @@ private:
   RefPtr<nsMimeTypeArray> mMimeTypes;
   RefPtr<nsPluginArray> mPlugins;
   RefPtr<Permissions> mPermissions;
   RefPtr<Geolocation> mGeolocation;
   RefPtr<DesktopNotificationCenter> mNotification;
   RefPtr<battery::BatteryManager> mBatteryManager;
   RefPtr<Promise> mBatteryPromise;
   RefPtr<PowerManager> mPowerManager;
-  RefPtr<InputPortManager> mInputPortManager;
   RefPtr<network::Connection> mConnection;
 #ifdef MOZ_AUDIO_CHANNEL_MANAGER
   RefPtr<system::AudioChannelManager> mAudioChannelManager;
 #endif
   RefPtr<MediaDevices> mMediaDevices;
   nsTArray<nsWeakPtr> mDeviceStorageStores;
   RefPtr<time::TimeManager> mTimeManager;
   RefPtr<ServiceWorkerContainer> mServiceWorkerContainer;
deleted file mode 100644
--- a/dom/inputport/AVInputPort.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#include "mozilla/dom/AVInputPort.h"
-#include "mozilla/dom/AVInputPortBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-AVInputPort::AVInputPort(nsPIDOMWindowInner* aWindow)
-  : InputPort(aWindow)
-{
-}
-
-AVInputPort::~AVInputPort()
-{
-}
-
-/* static */ already_AddRefed<AVInputPort>
-AVInputPort::Create(nsPIDOMWindowInner* aWindow,
-                    nsIInputPortListener* aListener,
-                    nsIInputPortData* aData,
-                    ErrorResult& aRv)
-{
-  RefPtr<AVInputPort> inputport = new AVInputPort(aWindow);
-  inputport->Init(aData, aListener, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-  return inputport.forget();
-}
-
-JSObject*
-AVInputPort::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return AVInputPortBinding::Wrap(aCx, this, aGivenProto);
-}
-
-} // namespace dom
-} //namespace mozilla
deleted file mode 100644
--- a/dom/inputport/AVInputPort.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef mozilla_dom_AVInputPort_h
-#define mozilla_dom_AVInputPort_h
-
-#include "mozilla/dom/InputPort.h"
-
-namespace mozilla {
-namespace dom {
-
-class AVInputPort final : public InputPort
-{
-public:
-  static already_AddRefed<AVInputPort> Create(nsPIDOMWindowInner* aWindow,
-                                              nsIInputPortListener* aListener,
-                                              nsIInputPortData* aData,
-                                              ErrorResult& aRv);
-
-  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-private:
-  explicit AVInputPort(nsPIDOMWindowInner* aWindow);
-
-  ~AVInputPort();
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_AVInputPort_h
deleted file mode 100644
--- a/dom/inputport/DisplayPortInputPort.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#include "mozilla/dom/DisplayPortInputPort.h"
-#include "mozilla/dom/DisplayPortInputPortBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-DisplayPortInputPort::DisplayPortInputPort(nsPIDOMWindowInner* aWindow)
-  : InputPort(aWindow)
-{
-}
-
-DisplayPortInputPort::~DisplayPortInputPort()
-{
-}
-
-/* static */ already_AddRefed<DisplayPortInputPort>
-DisplayPortInputPort::Create(nsPIDOMWindowInner* aWindow,
-                             nsIInputPortListener* aListener,
-                             nsIInputPortData* aData,
-                             ErrorResult& aRv)
-{
-  RefPtr<DisplayPortInputPort> inputport = new DisplayPortInputPort(aWindow);
-  inputport->Init(aData, aListener, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-  return inputport.forget();
-}
-
-JSObject*
-DisplayPortInputPort::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return DisplayPortInputPortBinding::Wrap(aCx, this, aGivenProto);
-}
-
-} // namespace dom
-} //namespace mozilla
deleted file mode 100644
--- a/dom/inputport/DisplayPortInputPort.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef mozilla_dom_DisplayPortInputPort_h
-#define mozilla_dom_DisplayPortInputPort_h
-
-#include "mozilla/dom/InputPort.h"
-
-namespace mozilla {
-namespace dom {
-
-class DisplayPortInputPort final : public InputPort
-{
-public:
-  static already_AddRefed<DisplayPortInputPort>
-  Create(nsPIDOMWindowInner* aWindow,
-         nsIInputPortListener* aListener,
-         nsIInputPortData* aData,
-         ErrorResult& aRv);
-
-  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-private:
-  explicit DisplayPortInputPort(nsPIDOMWindowInner* aWindow);
-
-  ~DisplayPortInputPort();
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_DisplayPortInputPort_h
deleted file mode 100644
--- a/dom/inputport/FakeInputPortService.cpp
+++ /dev/null
@@ -1,208 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#include "FakeInputPortService.h"
-#include "InputPortData.h"
-#include "mozilla/dom/InputPort.h"
-#include "nsIMutableArray.h"
-#include "nsITimer.h"
-#include "nsServiceManagerUtils.h"
-#include "nsThreadUtils.h"
-
-namespace mozilla {
-namespace dom {
-
-namespace {
-class InputPortServiceNotifyRunnable final : public Runnable
-{
-public:
-  InputPortServiceNotifyRunnable(
-      nsIInputPortServiceCallback* aCallback,
-      nsIArray* aDataList,
-      uint16_t aErrorCode = nsIInputPortServiceCallback::INPUTPORT_ERROR_OK)
-    : mCallback(aCallback)
-    , mDataList(aDataList)
-    , mErrorCode(aErrorCode)
-  {
-    MOZ_ASSERT(aCallback);
-    MOZ_ASSERT(aDataList);
-  }
-
-  NS_IMETHOD Run() override
-  {
-    if (mErrorCode == nsIInputPortServiceCallback::INPUTPORT_ERROR_OK) {
-      return mCallback->NotifySuccess(mDataList);
-    } else {
-      return mCallback->NotifyError(mErrorCode);
-    }
-  }
-
-private:
-  nsCOMPtr<nsIInputPortServiceCallback> mCallback;
-  nsCOMPtr<nsIArray> mDataList;
-  uint16_t mErrorCode;
-};
-
-class PortConnectionChangedCallback final : public nsITimerCallback
-{
-public:
-  NS_DECL_ISUPPORTS
-
-  PortConnectionChangedCallback(nsIInputPortData* aInputPortData,
-                                nsIInputPortListener* aInputPortListener,
-                                const bool aIsConnected)
-    : mInputPortData(aInputPortData)
-    , mInputPortListener(aInputPortListener)
-    , mIsConnected(aIsConnected)
-  {}
-
-  NS_IMETHOD
-  Notify(nsITimer* aTimer) override
-  {
-    InputPortData* portData = static_cast<InputPortData*>(mInputPortData.get());
-    portData->SetConnected(mIsConnected);
-    nsresult rv = mInputPortListener->NotifyConnectionChanged(
-      portData->GetId(), mIsConnected);
-    return rv;
-  }
-
-private:
-  ~PortConnectionChangedCallback() {}
-
-  nsCOMPtr<nsIInputPortData> mInputPortData;
-  nsCOMPtr<nsIInputPortListener> mInputPortListener;
-  bool mIsConnected;
-};
-
-} // namespace
-
-NS_IMPL_ISUPPORTS(PortConnectionChangedCallback, nsITimerCallback)
-
-NS_IMPL_CYCLE_COLLECTION_CLASS(FakeInputPortService)
-
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(FakeInputPortService)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mInputPortListener)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPortConnectionChangedTimer)
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPortDatas)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FakeInputPortService)
-  tmp->Shutdown();
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mInputPortListener)
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mPortConnectionChangedTimer)
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mPortDatas)
-NS_IMPL_CYCLE_COLLECTION_UNLINK_END
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(FakeInputPortService)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(FakeInputPortService)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FakeInputPortService)
-  NS_INTERFACE_MAP_ENTRY(nsIInputPortService)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-FakeInputPortService::FakeInputPortService()
-{
-  Init();
-}
-
-FakeInputPortService::~FakeInputPortService()
-{
-  Shutdown();
-}
-
-void
-FakeInputPortService::Init()
-{
-  nsCOMPtr<nsIInputPortData> portData1 =
-      MockInputPort(NS_LITERAL_STRING("1"), NS_LITERAL_STRING("av"), true);
-  mPortDatas.AppendElement(portData1);
-
-  nsCOMPtr<nsIInputPortData> portData2 =
-      MockInputPort(NS_LITERAL_STRING("2"), NS_LITERAL_STRING("displayport"), false);
-  mPortDatas.AppendElement(portData2);
-
-  nsCOMPtr<nsIInputPortData> portData3 =
-      MockInputPort(NS_LITERAL_STRING("3"), NS_LITERAL_STRING("hdmi"), true);
-  mPortDatas.AppendElement(portData3);
-}
-
-void
-FakeInputPortService::Shutdown()
-{
-  if (mPortConnectionChangedTimer) {
-    mPortConnectionChangedTimer->Cancel();
-  }
-}
-
-NS_IMETHODIMP
-FakeInputPortService::GetInputPortListener(nsIInputPortListener** aInputPortListener)
-{
-  if (!mInputPortListener) {
-    *aInputPortListener = nullptr;
-    return NS_OK;
-  }
-
-  *aInputPortListener = mInputPortListener;
-  NS_ADDREF(*aInputPortListener);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-FakeInputPortService::SetInputPortListener(nsIInputPortListener* aInputPortListener)
-{
-  mInputPortListener = aInputPortListener;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-FakeInputPortService::GetInputPorts(nsIInputPortServiceCallback* aCallback)
-{
-  if (!aCallback) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  nsCOMPtr<nsIMutableArray> portDataList = do_CreateInstance(NS_ARRAY_CONTRACTID);
-  if (!portDataList) {
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-
-  for (uint32_t i = 0; i < mPortDatas.Length(); i++) {
-    portDataList->AppendElement(mPortDatas[i], false);
-  }
-
-  mPortConnectionChangedTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
-  NS_ENSURE_TRUE(mPortConnectionChangedTimer, NS_ERROR_OUT_OF_MEMORY);
-  bool isConnected = false;
-  mPortDatas[0]->GetConnected(&isConnected);
-  //simulate the connection change event.
-  RefPtr<PortConnectionChangedCallback> connectionChangedCb =
-    new PortConnectionChangedCallback(mPortDatas[0], mInputPortListener, !isConnected);
-  nsresult rv = mPortConnectionChangedTimer->InitWithCallback(
-    connectionChangedCb, 100, nsITimer::TYPE_ONE_SHOT);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  nsCOMPtr<nsIRunnable> runnable =
-    new InputPortServiceNotifyRunnable(aCallback, portDataList);
-  return NS_DispatchToCurrentThread(runnable);
-}
-
-already_AddRefed<nsIInputPortData>
-FakeInputPortService::MockInputPort(const nsAString& aId,
-                                    const nsAString& aType,
-                                    bool aIsConnected)
-{
-  nsCOMPtr<nsIInputPortData> portData = new InputPortData();
-  portData->SetId(aId);
-  portData->SetType(aType);
-  portData->SetConnected(aIsConnected);
-  return portData.forget();
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/inputport/FakeInputPortService.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef mozilla_dom_FakeInputPortService_h
-#define mozilla_dom_FakeInputPortService_h
-
-#include "nsCOMPtr.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsIInputPortService.h"
-#include "nsTArray.h"
-
-#define FAKE_INPUTPORT_SERVICE_CONTRACTID \
-  "@mozilla.org/inputport/fakeinputportservice;1"
-#define FAKE_INPUTPORT_SERVICE_CID \
-  { 0xea6b01c5, 0xad04, 0x4f2a, \
-    { 0x8a, 0xbe, 0x64, 0xdb, 0xa2, 0x22, 0xe3, 0x3d } }
-
-class nsITimer;
-class nsIInputPortData;
-
-namespace mozilla {
-namespace dom {
-
-class FakeInputPortService final : public nsIInputPortService
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS(FakeInputPortService)
-  NS_DECL_NSIINPUTPORTSERVICE
-
-  FakeInputPortService();
-
-private:
-  ~FakeInputPortService();
-
-  void Init();
-
-  void Shutdown();
-
-  already_AddRefed<nsIInputPortData> MockInputPort(const nsAString& aId,
-                                                   const nsAString& aType,
-                                                   bool aIsConnected);
-
-  nsCOMPtr<nsIInputPortListener> mInputPortListener;
-  nsCOMPtr<nsITimer> mPortConnectionChangedTimer;
-  nsTArray<nsCOMPtr<nsIInputPortData>> mPortDatas;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_FakeInputPortService_h
deleted file mode 100644
--- a/dom/inputport/HDMIInputPort.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#include "mozilla/dom/HDMIInputPort.h"
-#include "mozilla/dom/HDMIInputPortBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-HDMIInputPort::HDMIInputPort(nsPIDOMWindowInner* aWindow)
-  : InputPort(aWindow)
-{
-}
-
-HDMIInputPort::~HDMIInputPort()
-{
-}
-
-/* static */ already_AddRefed<HDMIInputPort>
-HDMIInputPort::Create(nsPIDOMWindowInner* aWindow,
-                      nsIInputPortListener* aListener,
-                      nsIInputPortData* aData,
-                      ErrorResult& aRv)
-{
-  RefPtr<HDMIInputPort> inputport = new HDMIInputPort(aWindow);
-  inputport->Init(aData, aListener, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-  return inputport.forget();
-}
-
-
-JSObject*
-HDMIInputPort::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return HDMIInputPortBinding::Wrap(aCx, this, aGivenProto);
-}
-
-} // namespace dom
-} //namespace mozilla
deleted file mode 100644
--- a/dom/inputport/HDMIInputPort.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef mozilla_dom_HDMIInputPort_h
-#define mozilla_dom_HDMIInputPort_h
-
-#include "mozilla/dom/InputPort.h"
-
-namespace mozilla {
-namespace dom {
-
-class HDMIInputPort final : public InputPort
-{
-public:
-  static already_AddRefed<HDMIInputPort>
-  Create(nsPIDOMWindowInner* aWindow,
-         nsIInputPortListener* aListener,
-         nsIInputPortData* aData,
-         ErrorResult& aRv);
-
-  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-private:
-  explicit HDMIInputPort(nsPIDOMWindowInner* aWindow);
-
-  ~HDMIInputPort();
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_HDMIInputPort_h
deleted file mode 100644
--- a/dom/inputport/InputPort.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#include "MediaStreamGraph.h"
-#include "DOMMediaStream.h"
-#include "InputPortData.h"
-#include "InputPortListeners.h"
-#include "mozilla/AsyncEventDispatcher.h"
-#include "mozilla/dom/InputPort.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION_INHERITED(InputPort, DOMEventTargetHelper,
-                                   mStream,
-                                   mInputPortListener)
-
-NS_IMPL_ADDREF_INHERITED(InputPort, DOMEventTargetHelper)
-NS_IMPL_RELEASE_INHERITED(InputPort, DOMEventTargetHelper)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(InputPort)
-NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
-
-InputPort::InputPort(nsPIDOMWindowInner* aWindow)
-  : DOMEventTargetHelper(aWindow)
-  , mIsConnected(false)
-{
-}
-
-InputPort::~InputPort()
-{
-}
-
-void
-InputPort::Init(nsIInputPortData* aData, nsIInputPortListener* aListener, ErrorResult& aRv)
-{
-  MOZ_ASSERT(aData);
-  MOZ_ASSERT(aListener);
-
-  aRv = aData->GetId(mId);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return;
-  }
-
-  if (NS_WARN_IF(mId.IsEmpty())) {
-    aRv.Throw(NS_ERROR_FAILURE);
-    return;
-  }
-
-  InputPortType type = static_cast<InputPortData*>(aData)->GetType();
-  if (NS_WARN_IF(type == InputPortType::EndGuard_)) {
-    aRv.Throw(NS_ERROR_FAILURE);
-    return;
-  }
-
-  aData->GetConnected(&mIsConnected);
-
-  mInputPortListener = static_cast<InputPortListener*>(aListener);
-  mInputPortListener->RegisterInputPort(this);
-
-  MediaStreamGraph* graph =
-    MediaStreamGraph::GetInstance(MediaStreamGraph::SYSTEM_THREAD_DRIVER,
-                                  AudioChannel::Normal);
-  mStream = DOMMediaStream::CreateSourceStreamAsInput(GetOwner(), graph);
-}
-
-void
-InputPort::Shutdown()
-{
-  MOZ_ASSERT(mInputPortListener);
-  if (mInputPortListener) {
-    mInputPortListener->UnregisterInputPort(this);
-    mInputPortListener = nullptr;
-  }
-}
-
-/* virtual */ JSObject*
-InputPort::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return InputPortBinding::Wrap(aCx, this, aGivenProto);
-}
-
-void
-InputPort::NotifyConnectionChanged(bool aIsConnected)
-{
-  MOZ_ASSERT(mIsConnected != aIsConnected);
-  mIsConnected = aIsConnected;
-
-  RefPtr<AsyncEventDispatcher> asyncDispatcher =
-    new AsyncEventDispatcher(this,
-                             aIsConnected ? NS_LITERAL_STRING("connect") :
-                                            NS_LITERAL_STRING("disconnect"),
-                             false);
-  asyncDispatcher->PostDOMEvent();
-}
-
-void
-InputPort::GetId(nsAString& aId) const
-{
-  aId = mId;
-}
-
-DOMMediaStream*
-InputPort::Stream() const
-{
-  return mStream;
-}
-
-bool
-InputPort::Connected() const
-{
-  return mIsConnected;
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/inputport/InputPort.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef mozilla_dom_InputPort_h
-#define mozilla_dom_InputPort_h
-
-#include "InputPortListeners.h"
-#include "mozilla/DOMEventTargetHelper.h"
-#include "mozilla/dom/InputPortBinding.h"
-#include "nsIInputPortService.h"
-
-namespace mozilla {
-
-class DOMMediaStream;
-
-namespace dom {
-
-class InputPort : public DOMEventTargetHelper
-{
-public:
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(InputPort, DOMEventTargetHelper)
-
-  // WebIDL (internal functions)
-  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-  void NotifyConnectionChanged(bool aIsConnected);
-
-  // WebIDL (public APIs)
-  void GetId(nsAString& aId) const;
-
-  DOMMediaStream* Stream() const;
-
-  bool Connected() const;
-
-  IMPL_EVENT_HANDLER(connect);
-  IMPL_EVENT_HANDLER(disconnect);
-
-protected:
-  explicit InputPort(nsPIDOMWindowInner* aWindow);
-
-  virtual ~InputPort();
-
-  void Init(nsIInputPortData* aData, nsIInputPortListener* aListener, ErrorResult& aRv);
-  void Shutdown();
-
-  nsString mId;
-  RefPtr<DOMMediaStream> mStream;
-  RefPtr<InputPortListener> mInputPortListener;
-  bool mIsConnected;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_InputPort_h
deleted file mode 100644
--- a/dom/inputport/InputPortData.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#include "InputPortData.h"
-#include "nsString.h"
-
-namespace mozilla {
-namespace dom {
-
-namespace {
-
-InputPortType
-ToInputPortType(const nsAString& aStr)
-{
-  if (aStr.EqualsLiteral("av")) {
-    return InputPortType::Av;
-  }
-
-  if (aStr.EqualsLiteral("displayport")) {
-    return InputPortType::Displayport;
-  }
-
-  if (aStr.EqualsLiteral("hdmi")) {
-    return InputPortType::Hdmi;
-  }
-
-  return InputPortType::EndGuard_;
-}
-
-} // namespace
-
-NS_IMPL_ISUPPORTS(InputPortData, nsIInputPortData)
-
-InputPortData::InputPortData()
-  : mIsConnected(false)
-{
-}
-
-InputPortData::~InputPortData()
-{
-}
-
-NS_IMETHODIMP
-InputPortData::GetId(nsAString& aId)
-{
-  aId = mId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-InputPortData::SetId(const nsAString& aId)
-{
-  if (aId.IsEmpty()) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  mId = aId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-InputPortData::GetType(nsAString& aType)
-{
-  aType = mType;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-InputPortData::SetType(const nsAString& aType)
-{
-  if (aType.IsEmpty()) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  if (InputPortType::EndGuard_ == ToInputPortType(aType)) {
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  mType = aType;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-InputPortData::GetConnected(bool* aIsConnected)
-{
-  *aIsConnected = mIsConnected;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-InputPortData::SetConnected(const bool aIsConnected)
-{
-  mIsConnected = aIsConnected;
-  return NS_OK;
-}
-
-const nsString&
-InputPortData::GetId() const
-{
-  return mId;
-}
-
-InputPortType
-InputPortData::GetType() const
-{
-  return ToInputPortType(mType);
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/inputport/InputPortData.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef mozilla_dom_InputPortData_h
-#define mozilla_dom_InputPortData_h
-
-#include "mozilla/dom/InputPortBinding.h"
-#include "nsIInputPortService.h"
-
-class nsString;
-
-namespace mozilla {
-namespace dom {
-
-enum class InputPortType : uint32_t
-{
-  Av,
-  Displayport,
-  Hdmi,
-  EndGuard_
-};
-
-class InputPortData final : public nsIInputPortData
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIINPUTPORTDATA
-
-  InputPortData();
-
-  const nsString& GetId() const;
-
-  InputPortType GetType() const;
-
-private:
-  ~InputPortData();
-
-  nsString mId;
-  nsString mType;
-  bool mIsConnected;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_InputPortData_h
deleted file mode 100644
--- a/dom/inputport/InputPortListeners.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#include "InputPortListeners.h"
-#include "mozilla/dom/InputPort.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION(InputPortListener, mInputPorts)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(InputPortListener)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(InputPortListener)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(InputPortListener)
-  NS_INTERFACE_MAP_ENTRY(nsIInputPortListener)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-void
-InputPortListener::RegisterInputPort(InputPort* aPort)
-{
-  MOZ_ASSERT(!mInputPorts.Contains(aPort));
-  mInputPorts.AppendElement(aPort);
-}
-
-void
-InputPortListener::UnregisterInputPort(InputPort* aPort)
-{
-  MOZ_ASSERT(mInputPorts.Contains(aPort));
-  mInputPorts.RemoveElement(aPort);
-}
-
-NS_IMETHODIMP
-InputPortListener::NotifyConnectionChanged(const nsAString& aPortId,
-                                           bool aIsConnected)
-{
-  for (uint32_t i = 0; i < mInputPorts.Length(); ++i) {
-    nsString id;
-    mInputPorts[i]->GetId(id);
-    if (aPortId.Equals(id)) {
-      mInputPorts[i]->NotifyConnectionChanged(aIsConnected);
-      break;
-    }
-  }
-
-  return NS_OK;
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/inputport/InputPortListeners.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef mozilla_dom_InputPortListeners_h
-#define mozilla_dom_InputPortListeners_h
-
-#include "nsCycleCollectionParticipant.h"
-#include "nsIInputPortService.h"
-#include "nsTArray.h"
-
-namespace mozilla {
-namespace dom {
-
-class InputPort;
-
-class InputPortListener final : public nsIInputPortListener
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS(InputPortListener)
-  NS_DECL_NSIINPUTPORTLISTENER
-
-  void RegisterInputPort(InputPort* aPort);
-
-  void UnregisterInputPort(InputPort* aPort);
-
-private:
-  ~InputPortListener() {}
-
-  nsTArray<RefPtr<InputPort>> mInputPorts;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_InputPortListeners_h
deleted file mode 100644
--- a/dom/inputport/InputPortManager.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#include "InputPortServiceFactory.h"
-#include "mozilla/dom/InputPort.h"
-#include "mozilla/dom/InputPortManager.h"
-#include "mozilla/dom/InputPortManagerBinding.h"
-#include "mozilla/dom/Promise.h"
-#include "nsArrayUtils.h"
-#include "nsIInputPortService.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(InputPortManager,
-                                      mParent,
-                                      mInputPortService,
-                                      mPendingGetInputPortsPromises,
-                                      mInputPorts)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(InputPortManager)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(InputPortManager)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(InputPortManager)
-  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_INTERFACE_MAP_ENTRY(nsIInputPortServiceCallback)
-NS_INTERFACE_MAP_END
-
-InputPortManager::InputPortManager(nsPIDOMWindowInner* aWindow)
-  : mParent(aWindow)
-  , mIsReady(false)
-{
-}
-
-InputPortManager::~InputPortManager()
-{
-}
-
-/* static */ already_AddRefed<InputPortManager>
-InputPortManager::Create(nsPIDOMWindowInner* aWindow, ErrorResult& aRv)
-{
-  RefPtr<InputPortManager> manager = new InputPortManager(aWindow);
-  manager->Init(aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-  return manager.forget();
-}
-
-void
-InputPortManager::Init(ErrorResult& aRv)
-{
-  mInputPortService = InputPortServiceFactory::AutoCreateInputPortService();
-  if (NS_WARN_IF(!mInputPortService)) {
-    aRv.Throw(NS_ERROR_FAILURE);
-    return;
-  }
-
-  aRv = mInputPortService->GetInputPorts(this);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return;
-  }
-}
-
-nsPIDOMWindowInner*
-InputPortManager::GetParentObject() const
-{
-  return mParent;
-}
-
-JSObject*
-InputPortManager::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
-  return InputPortManagerBinding::Wrap(aCx, this, aGivenProto);
-}
-
-void
-InputPortManager::RejectPendingGetInputPortsPromises(nsresult aRv)
-{
-  // Reject pending promises.
-  uint32_t length = mPendingGetInputPortsPromises.Length();
-  for(uint32_t i = 0; i < length; i++) {
-    mPendingGetInputPortsPromises[i]->MaybeReject(aRv);
-  }
-  mPendingGetInputPortsPromises.Clear();
-}
-
-nsresult
-InputPortManager::SetInputPorts(const nsTArray<RefPtr<InputPort>>& aPorts)
-{
-  MOZ_ASSERT(!mIsReady);
-  // Should be called only when InputPortManager hasn't been ready yet.
-  if (mIsReady) {
-    return NS_ERROR_DOM_INVALID_STATE_ERR;
-  }
-
-  mInputPorts = aPorts;
-  mIsReady = true;
-
-  // Resolve pending promises.
-  uint32_t length = mPendingGetInputPortsPromises.Length();
-  for(uint32_t i = 0; i < length; i++) {
-    mPendingGetInputPortsPromises[i]->MaybeResolve(mInputPorts);
-  }
-  mPendingGetInputPortsPromises.Clear();
-  return NS_OK;
-}
-
-already_AddRefed<Promise>
-InputPortManager::GetInputPorts(ErrorResult& aRv)
-{
-  nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetParentObject());
-  MOZ_ASSERT(global);
-
-  RefPtr<Promise> promise = Promise::Create(global, aRv);
-  if (NS_WARN_IF(aRv.Failed())) {
-    return nullptr;
-  }
-
-  if (mIsReady) {
-    promise->MaybeResolve(mInputPorts);
-  } else {
-    mPendingGetInputPortsPromises.AppendElement(promise);
-  }
-
-  return promise.forget();
-}
-
-NS_IMETHODIMP
-InputPortManager::NotifySuccess(nsIArray* aDataList)
-{
-  MOZ_ASSERT(aDataList);
-
-  if (!aDataList) {
-    RejectPendingGetInputPortsPromises(NS_ERROR_DOM_ABORT_ERR);
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  uint32_t length;
-  nsresult rv = aDataList->GetLength(&length);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  nsCOMPtr<nsIInputPortListener> portListener;
-  rv = mInputPortService->GetInputPortListener(
-    getter_AddRefs(portListener));
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  ErrorResult erv;
-  nsTArray<RefPtr<InputPort>> ports(length);
-  for (uint32_t i = 0; i < length; i++) {
-    nsCOMPtr<nsIInputPortData> portData = do_QueryElementAt(aDataList, i);
-    if (NS_WARN_IF(!portData)) {
-      continue;
-    }
-
-    InputPortData* data = static_cast<InputPortData*>(portData.get());
-    RefPtr<InputPort> port;
-    switch (data->GetType()) {
-    case InputPortType::Av:
-      port = AVInputPort::Create(GetParentObject(), portListener,
-                                 portData, erv);
-      break;
-    case InputPortType::Displayport:
-      port = DisplayPortInputPort::Create(GetParentObject(),
-                                          portListener, portData, erv);
-      break;
-    case InputPortType::Hdmi:
-      port = HDMIInputPort::Create(GetParentObject(), portListener,
-                                   portData, erv);
-      break;
-    default:
-      MOZ_ASSERT_UNREACHABLE("Unknown InputPort type");
-      break;
-    }
-    MOZ_ASSERT(port);
-
-    ports.AppendElement(port);
-  }
-
-  if (NS_WARN_IF(erv.Failed())) {
-    return erv.StealNSResult();
-  }
-
-  erv = SetInputPorts(ports);
-
-  return erv.StealNSResult();
-}
-
-NS_IMETHODIMP
-InputPortManager::NotifyError(uint16_t aErrorCode)
-{
-  switch (aErrorCode) {
-  case nsIInputPortServiceCallback::INPUTPORT_ERROR_FAILURE:
-  case nsIInputPortServiceCallback::INPUTPORT_ERROR_INVALID_ARG:
-    RejectPendingGetInputPortsPromises(NS_ERROR_DOM_ABORT_ERR);
-    return NS_OK;
-  case nsIInputPortServiceCallback::INPUTPORT_ERROR_NOT_SUPPORTED:
-    RejectPendingGetInputPortsPromises(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
-    return NS_OK;
-  }
-
-  RejectPendingGetInputPortsPromises(NS_ERROR_DOM_ABORT_ERR);
-  return NS_ERROR_ILLEGAL_VALUE;
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/inputport/InputPortManager.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef mozilla_dom_InputPortManager_h
-#define mozilla_dom_InputPortManager_h
-
-#include "nsIInputPortService.h"
-#include "nsISupports.h"
-#include "nsWrapperCache.h"
-
-class nsIInputPortService;
-class nsPIDOMWindowInner;
-
-namespace mozilla {
-namespace dom {
-
-class Promise;
-class InputPort;
-
-class InputPortManager final : public nsIInputPortServiceCallback,
-                               public nsWrapperCache
-{
-public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(InputPortManager)
-  NS_DECL_NSIINPUTPORTSERVICECALLBACK
-
-  static already_AddRefed<InputPortManager>
-  Create(nsPIDOMWindowInner* aWindow, ErrorResult& aRv);
-
-  // WebIDL (internal functions)
-  nsPIDOMWindowInner* GetParentObject() const;
-
-  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
-
-  // WebIDL (public APIs)
-  already_AddRefed<Promise> GetInputPorts(ErrorResult& aRv);
-
-private:
-  explicit InputPortManager(nsPIDOMWindowInner* aWindow);
-
-  ~InputPortManager();
-
-  void Init(ErrorResult& aRv);
-
-  void RejectPendingGetInputPortsPromises(nsresult aRv);
-
-  nsresult SetInputPorts(const nsTArray<RefPtr<InputPort>>& aPorts);
-
-  nsTArray<RefPtr<Promise>> mPendingGetInputPortsPromises;
-  nsTArray<RefPtr<InputPort>> mInputPorts;
-  nsCOMPtr<nsPIDOMWindowInner> mParent;
-  nsCOMPtr<nsIInputPortService> mInputPortService;
-  bool mIsReady;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_InputPortManager_h__
deleted file mode 100644
--- a/dom/inputport/InputPortServiceFactory.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#include "FakeInputPortService.h"
-#include "InputPortListeners.h"
-#include "InputPortServiceFactory.h"
-#include "mozilla/Preferences.h"
-#include "nsIInputPortService.h"
-#include "nsServiceManagerUtils.h"
-
-namespace mozilla {
-namespace dom {
-
-/* static */ already_AddRefed<FakeInputPortService>
-InputPortServiceFactory::CreateFakeInputPortService()
-{
-  RefPtr<FakeInputPortService> service = new FakeInputPortService();
-  return service.forget();
-}
-
-/* static */ already_AddRefed<nsIInputPortService>
-InputPortServiceFactory::AutoCreateInputPortService()
-{
-  nsresult rv;
-  nsCOMPtr<nsIInputPortService> service =
-    do_GetService(INPUTPORT_SERVICE_CONTRACTID);
-  if (!service) {
-    // Fallback to the fake service.
-    service = do_GetService(FAKE_INPUTPORT_SERVICE_CONTRACTID, &rv);
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return nullptr;
-    }
-  }
-  MOZ_ASSERT(service);
-  rv = service->SetInputPortListener(new InputPortListener());
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return nullptr;
-  }
-
-  return service.forget();
-}
-
-} // namespace dom
-} // namespace mozilla
deleted file mode 100644
--- a/dom/inputport/InputPortServiceFactory.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef mozilla_dom_InputPortServiceFactory_h
-#define mozilla_dom_InputPortServiceFactory_h
-
-#include "nsCOMPtr.h"
-
-class nsIInputPortService;
-
-namespace mozilla {
-namespace dom {
-
-class FakeInputPortService;
-
-class InputPortServiceFactory final
-{
-public:
-  static already_AddRefed<FakeInputPortService> CreateFakeInputPortService();
-
-  static already_AddRefed<nsIInputPortService> AutoCreateInputPortService();
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_InputPortServiceFactory_h
deleted file mode 100644
--- a/dom/inputport/moz.build
+++ /dev/null
@@ -1,46 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# 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/.
-
-EXPORTS.mozilla.dom += [
-    'AVInputPort.h',
-    'DisplayPortInputPort.h',
-    'HDMIInputPort.h',
-    'InputPort.h',
-    'InputPortManager.h',
-]
-
-EXPORTS += [
-    'FakeInputPortService.h',
-    'InputPortData.h',
-    'InputPortListeners.h',
-    'InputPortServiceFactory.h',
-]
-
-UNIFIED_SOURCES += [
-    'AVInputPort.cpp',
-    'DisplayPortInputPort.cpp',
-    'FakeInputPortService.cpp',
-    'HDMIInputPort.cpp',
-    'InputPort.cpp',
-    'InputPortData.cpp',
-    'InputPortListeners.cpp',
-    'InputPortManager.cpp',
-    'InputPortServiceFactory.cpp',
-]
-
-XPIDL_SOURCES += [
-    'nsIInputPortService.idl',
-]
-
-XPIDL_MODULE = 'dom_inputport'
-
-MOCHITEST_MANIFESTS += ['test/mochitest/mochitest.ini']
-
-XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini']
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-FINAL_LIBRARY = 'xul'
deleted file mode 100644
--- a/dom/inputport/nsIInputPortService.idl
+++ /dev/null
@@ -1,75 +0,0 @@
-/* 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/. */
-
-#include "nsISupports.idl"
-
-interface nsIArray;
-
-%{C++
-#define INPUTPORT_DATA_CID \
-  { 0x90b192d1, 0x357a, 0x4793, { 0xab, 0x58, 0x04, 0xee, 0x21, 0x62, 0x27, 0xda } }
-#define INPUTPORT_DATA_CONTRACTID \
-  "@mozilla.org/inputport/inputportdata;1"
-%}
-
-/**
- * XPCOM component which acts as the container for input port data.
- */
-[scriptable, builtinclass, uuid(244a2b1d-aa1f-4188-a639-ddb56c554b6d)]
-interface nsIInputPortData : nsISupports
-{
-  attribute DOMString id;
-  attribute DOMString type;
-  attribute boolean connected;
-};
-
-[builtinclass, uuid(32a62e7c-f698-4846-81f7-617c87854d32)]
-interface nsIInputPortListener : nsISupports
-{
-  void notifyConnectionChanged(in DOMString portId,
-                               in boolean isConnected);
-};
-
-[builtinclass, uuid(c2a47757-25f6-4bc8-bd27-c23af2d87381)]
-interface nsIInputPortServiceCallback : nsISupports
-{
-  const unsigned short INPUTPORT_ERROR_OK = 0;
-  const unsigned short INPUTPORT_ERROR_FAILURE = 1;
-  const unsigned short INPUTPORT_ERROR_INVALID_ARG = 2;
-  const unsigned short INPUTPORT_ERROR_NOT_SUPPORTED = 3;
-
-  /**
-   * Called when something wrong happens.
-   *
-   * @param errorCode Error code listed above from the underlying layer.
-   */
-  void notifyError(in unsigned short errorCode);
-
-  /**
-   * Called when the operation succeeds.
-   *
-   * @param dataList A list of data.
-   *                 An array of |nsIInputPortData| when used for |getInputPorts()|.
-   *
-   * NOTE: |nsIArray| is adopted to prevent this interface from being split into
-   * multiple interfaces with different |notifySuccess|. Though the
-   * implementation of TV service may need |nsIMutableArray| to fill in the
-   * array, it doesn't seem necessary for other places to use the mutable one.
-   */
-  void notifySuccess([optional] in nsIArray dataList);
-};
-
-
-%{C++
-#define INPUTPORT_SERVICE_CONTRACTID \
-  "@mozilla.org/inputport/inputportservice;1"
-%}
-
-[uuid(6214dae0-840e-11e4-b4a9-0800200c9a66)]
-interface nsIInputPortService : nsISupports
-{
-  attribute nsIInputPortListener inputPortListener;
-
-  void getInputPorts(in nsIInputPortServiceCallback callback);
-};
deleted file mode 100644
--- a/dom/inputport/test/mochitest/mochitest.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[DEFAULT]
-skip-if = buildapp != 'b2g'
-
-[test_inputport_get_inputports.html]
-[test_inputport_connection_event.html]
\ No newline at end of file
deleted file mode 100644
--- a/dom/inputport/test/mochitest/test_inputport_connection_event.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1026350
--->
-<head>
-<meta charset="utf-8">
-<title>Test Inputport Connection Event</title>
-<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1026350">Test Inputport Connection Event
-</a>
-<script type="application/javascript;version=1.8">
-
-'use strict';
-
-SimpleTest.waitForExplicitFinish();
-
-function testInputportConnectionEvent() {
-  return new Promise(function(resolve, reject) {
-    var inputPortMgr = navigator.inputPortManager;
-    inputPortMgr.getInputPorts().then(
-      function(aPorts) {
-        ok(aPorts.length > 0, "Got at least 1 inputport.");
-        var port0 = aPorts[0];
-        var port0_isConnected = port0.connected;
-        port0.onconnect = function(aEvent) {
-          var port = aEvent.target;
-          is(port.id, port0.id, "The inputport ID should be the same");
-          ok(port.connected, "The connected value matches the connect evnet purpose");
-          is(port.connected, !port0_isConnected, "The connected value should change");
-          resolve();
-        }
-        port0.ondisconnect = function (aEvent) {
-          var port = aEvent.target;
-          is(port.id, port0.id, "The inputport ID should be the same");
-          ok(!port.connected, "The connected value matches the disconnect evnet purpose");
-          is(port.connected, !port0_isConnected, "The connected value should change");
-          resolve();
-        }
-      },
-      function(aError) {
-        ok(false, "Fail to get input ports: " + aError);
-        resolve();
-      }