Bug 1589334 - Enable ESLint for all of devtools/shared (manual changes). r=Standard8,jdescottes,nchevobbe
authorMarco Vega <marco@proweb.co>
Tue, 03 Dec 2019 08:39:59 +0000
changeset 505046 f37f7892f77f58a983b82a15f6babc0db8afbcb1
parent 505045 52f5558248143b436fecc2e3755c2757ddbe6a4b
child 505047 9301bdb66fb4d02b4db1995f41ead6f4303943ae
push id102117
push usermbanner@mozilla.com
push dateTue, 03 Dec 2019 10:12:10 +0000
treeherderautoland@f37f7892f77f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8, jdescottes, nchevobbe
bugs1589334
milestone73.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1589334 - Enable ESLint for all of devtools/shared (manual changes). r=Standard8,jdescottes,nchevobbe Differential Revision: https://phabricator.services.mozilla.com/D51090
.eslintignore
devtools/.eslintrc.js
devtools/shared/qrcode/tests/mochitest/test_decode.html
devtools/shared/tests/mochitest/test_css-logic-findCssSelector.html
devtools/shared/tests/mochitest/test_css-logic-getCssPath.html
devtools/shared/webconsole/test/test_basics.html
devtools/shared/webconsole/test/test_bug819670_getter_throws.html
devtools/shared/webconsole/test/test_cached_messages.html
devtools/shared/webconsole/test/test_commands_other.html
devtools/shared/webconsole/test/test_console_group_styling.html
devtools/shared/webconsole/test/test_console_serviceworker.html
devtools/shared/webconsole/test/test_console_serviceworker_cached.html
devtools/shared/webconsole/test/test_console_styling.html
devtools/shared/webconsole/test/test_console_timestamp.html
devtools/shared/webconsole/test/test_console_worker.html
devtools/shared/webconsole/test/test_consoleapi.html
devtools/shared/webconsole/test/test_consoleapi_innerID.html
devtools/shared/webconsole/test/test_file_uri.html
devtools/shared/webconsole/test/test_jsterm.html
devtools/shared/webconsole/test/test_jsterm_autocomplete.html
devtools/shared/webconsole/test/test_jsterm_cd_iframe.html
devtools/shared/webconsole/test/test_jsterm_last_result.html
devtools/shared/webconsole/test/test_jsterm_queryselector.html
devtools/shared/webconsole/test/test_network_get.html
devtools/shared/webconsole/test/test_network_post.html
devtools/shared/webconsole/test/test_network_security-hpkp.html
devtools/shared/webconsole/test/test_network_security-hsts.html
devtools/shared/webconsole/test/test_object_actor.html
devtools/shared/webconsole/test/test_object_actor_native_getters.html
devtools/shared/webconsole/test/test_object_actor_native_getters_lenient_this.html
devtools/shared/webconsole/test/test_page_errors.html
devtools/shared/webconsole/test/test_throw.html
--- a/.eslintignore
+++ b/.eslintignore
@@ -54,19 +54,16 @@ browser/extensions/mortar/
 browser/extensions/formautofill/phonenumberutils/PhoneNumberMetaData.jsm
 
 # devtools/ exclusions
 devtools/client/inspector/markup/test/doc_markup_events_*.html
 devtools/client/performance/components/test/test_jit_optimizations_01.html
 devtools/server/tests/browser/storage-*.html
 !devtools/server/tests/browser/storage-unsecured-iframe.html
 devtools/server/tests/browser/stylesheets-nested-iframes.html
-devtools/shared/qrcode/tests/mochitest/test_decode.html
-devtools/shared/tests/mochitest/*.html
-devtools/shared/webconsole/test/test_*.html
 devtools/client/webreplay/mochitest/examples/*.html
 
 # Ignore devtools debugger files
 # Keep in sync with devtools/client/debugger/.eslintignore
 devtools/client/debugger/assets/*
 devtools/client/debugger/src/test/examples/
 devtools/client/debugger/src/test/integration/
 devtools/client/debugger/src/test/unit-sources/
--- a/devtools/.eslintrc.js
+++ b/devtools/.eslintrc.js
@@ -43,16 +43,17 @@ module.exports = {
     "rules": {
       "max-nested-callbacks": "off",
     }
   }, {
     "files": [
       "client/framework/**",
       "client/shared/*.jsm",
       "client/shared/widgets/*.jsm",
+      "shared/webconsole/test/*.html",
     ],
     "rules": {
       "mozilla/no-aArgs": "off",
     }
   }, {
     "files": [
       "client/framework/test/**",
     ],
--- a/devtools/shared/qrcode/tests/mochitest/test_decode.html
+++ b/devtools/shared/qrcode/tests/mochitest/test_decode.html
@@ -5,17 +5,20 @@ Test decoding a simple message
 -->
 <head>
   <meta charset="utf-8">
   <title>Test decoding a simple message</title>
 
   <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript">
+"use strict";
+
 window.onload = function() {
+
   const { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm");
 
   const QR = require("devtools/shared/qrcode/index");
 
   SimpleTest.waitForExplicitFinish();
 
   const testImage =
     "data:image/gif;base64,R0lGODdhOgA6AIAAAAAAAP///ywAAAAAOgA6AAAC" +
--- a/devtools/shared/tests/mochitest/test_css-logic-findCssSelector.html
+++ b/devtools/shared/tests/mochitest/test_css-logic-findCssSelector.html
@@ -2,16 +2,17 @@
 <html>
 <head>
   <meta charset="utf-8">
   <title>Test for CSS logic helper </title>
 
   <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript">
+"use strict";
 
 const { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm");
 const { findCssSelector } = require("devtools/shared/inspector/css-logic");
 
 var _tests = [];
 function addTest(test) {
   _tests.push(test);
 }
@@ -25,66 +26,66 @@ function runNextTest() {
 }
 
 window.onload = function() {
   SimpleTest.waitForExplicitFinish();
   runNextTest();
 };
 
 addTest(function findAllCssSelectors() {
-  var nodes = document.querySelectorAll("*");
-  for (var i = 0; i < nodes.length; i++) {
-    var selector = findCssSelector(nodes[i]);
-    var matches = document.querySelectorAll(selector);
+  const nodes = document.querySelectorAll("*");
+  for (let i = 0; i < nodes.length; i++) {
+    const selector = findCssSelector(nodes[i]);
+    const matches = document.querySelectorAll(selector);
 
     is(matches.length, 1, "There is a single match: " + selector);
     is(matches[0], nodes[i], "The selector matches the correct node: " + selector);
   }
 
   runNextTest();
 });
 
 addTest(function findCssSelectorNotContainedInDocument() {
-  var unattached = document.createElement("div");
+  const unattached = document.createElement("div");
   unattached.id = "unattached";
   is(findCssSelector(unattached), "", "Unattached node returns empty string");
 
-  var unattachedChild = document.createElement("div");
+  const unattachedChild = document.createElement("div");
   unattached.appendChild(unattachedChild);
   is(findCssSelector(unattachedChild), "", "Unattached child returns empty string");
 
-  var unattachedBody = document.createElement("body");
+  const unattachedBody = document.createElement("body");
   is(findCssSelector(unattachedBody), "", "Unattached body returns empty string");
 
   runNextTest();
 });
 
 addTest(function findCssSelectorBasic() {
-  let data = [
+  const data = [
     "#one",
     "#" + CSS.escape("2"),
     ".three",
     "." + CSS.escape("4"),
     "#find-css-selector > div:nth-child(5)",
     "#find-css-selector > p:nth-child(6)",
     ".seven",
     ".eight",
     ".nine",
     ".ten",
     "div.sameclass:nth-child(11)",
     "div.sameclass:nth-child(12)",
     "div.sameclass:nth-child(13)",
     "#" + CSS.escape("!, \", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \\, ], ^, `, {, |, }, ~"),
   ];
 
-  let container = document.querySelector("#find-css-selector");
+  const container = document.querySelector("#find-css-selector");
   is(container.children.length, data.length, "Container has correct number of children.");
 
   for (let i = 0; i < data.length; i++) {
-    let node = container.children[i];
+    const node = container.children[i];
     is(findCssSelector(node), data[i], "matched id for index " + (i - 1));
   }
 
   runNextTest();
 });
   </script>
 </head>
 <body>
--- a/devtools/shared/tests/mochitest/test_css-logic-getCssPath.html
+++ b/devtools/shared/tests/mochitest/test_css-logic-getCssPath.html
@@ -5,16 +5,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 -->
 <head>
   <meta charset="utf-8">
   <title>Test for Bug 1323700</title>
 
   <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript">
+"use strict";
 
 const { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm");
 const CssLogic = require("devtools/shared/inspector/css-logic");
 
 var _tests = [];
 function addTest(test) {
   _tests.push(test);
 }
@@ -28,36 +29,36 @@ function runNextTest() {
 }
 
 window.onload = function() {
   SimpleTest.waitForExplicitFinish();
   runNextTest();
 }
 
 addTest(function getCssPathForUnattachedElement() {
-  var unattached = document.createElement("div");
+  const unattached = document.createElement("div");
   unattached.id = "unattached";
   is(CssLogic.getCssPath(unattached), "", "Unattached node returns empty string");
 
-  var unattachedChild = document.createElement("div");
+  const unattachedChild = document.createElement("div");
   unattached.appendChild(unattachedChild);
   is(CssLogic.getCssPath(unattachedChild), "", "Unattached child returns empty string");
 
-  var unattachedBody = document.createElement("body");
+  const unattachedBody = document.createElement("body");
   is(CssLogic.getCssPath(unattachedBody), "", "Unattached body returns empty string");
 
   runNextTest();
 });
 
 addTest(function cssPathHasOneStepForEachAncestor() {
   for (const el of [...document.querySelectorAll('*')]) {
     const splitPath = CssLogic.getCssPath(el).split(" ");
 
     let expectedNbOfParts = 0;
-    var parent = el.parentNode;
+    let parent = el.parentNode;
     while (parent) {
       expectedNbOfParts ++;
       parent = parent.parentNode;
     }
 
     is(splitPath.length, expectedNbOfParts, "There are enough parts in the full path");
   }
 
--- a/devtools/shared/webconsole/test/test_basics.html
+++ b/devtools/shared/webconsole/test/test_basics.html
@@ -7,16 +7,18 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Basic Web Console Actor tests</p>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 function startTest()
 {
   removeEventListener("load", startTest);
 
   attachConsoleToTab(["PageError"], onStartPageError);
 }
--- a/devtools/shared/webconsole/test/test_bug819670_getter_throws.html
+++ b/devtools/shared/webconsole/test/test_bug819670_getter_throws.html
@@ -7,16 +7,18 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for Bug 819670 - Web console object inspection does not handle native getters throwing very well</p>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 function startTest()
 {
   removeEventListener("load", startTest);
   attachConsoleToTab([], onAttach);
 }
 
@@ -43,16 +45,17 @@ function onEvaluate(aState, aResponse)
   const client = new ObjectFront(aState.dbgClient, aResponse.result);
   client.getPrototypeAndProperties().then(onInspect);
 }
 
 function onInspect(aState, aResponse)
 {
   ok(!aResponse.error, "no response error");
 
+  // eslint-disable-next-line no-proto
   const expectedProps =  Object.getOwnPropertyNames(document.__proto__);
 
   const props = aResponse.ownProperties;
   ok(props, "response properties available");
 
   if (props) {
     isDeeply(Object.keys(props), expectedProps, "Same own properties.");
   }
--- a/devtools/shared/webconsole/test/test_cached_messages.html
+++ b/devtools/shared/webconsole/test/test_cached_messages.html
@@ -7,16 +7,18 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for cached messages</p>
 
 <script class="testbody" type="application/javascript">
+"use strict";
+
 window.docShell.cssErrorReportingEnabled = true;
 var ConsoleAPIStorage = Cc["@mozilla.org/consoleAPI-storage;1"]
                           .getService(Ci.nsIConsoleAPIStorage);
 let expectedConsoleCalls = [];
 let expectedPageErrors = [];
 
 function doPageErrors() {
   Services.console.reset();
@@ -91,16 +93,18 @@ function doConsoleCalls() {
       timeStamp: /^\d+$/,
       arguments: ["foobarBaz-warn", { type: "object", actor: /[a-z]/ }],
     },
   ];
 }
 </script>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 var {ConsoleServiceListener} =
   require("devtools/server/actors/webconsole/listeners/console-service");
 var {ConsoleAPIListener} =
   require("devtools/server/actors/webconsole/listeners/console-api");
 
 let consoleAPIListener, consoleServiceListener;
 let consoleAPICalls = 0;
--- a/devtools/shared/webconsole/test/test_commands_other.html
+++ b/devtools/shared/webconsole/test/test_commands_other.html
@@ -7,39 +7,22 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for the querySelector / querySelectorAll helpers</p>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 let gState;
 let gWin;
-let tests;
-
-function evaluateJS(input) {
-  return gState.webConsoleFront.evaluateJSAsync(input);
-}
-
-function startTest() {
-  info ("Content window opened, attaching console to it");
-
-  const systemPrincipal = Cc["@mozilla.org/systemprincipal;1"].createInstance(Ci.nsIPrincipal);
-  ok (!gWin.document.nodePrincipal.equals(systemPrincipal),
-      "The test document is not using the system principal");
-
-  attachConsoleToTab([], state => {
-    gState = state;
-    runTests(tests, testEnd);
-  });
-}
-
-tests = [
+const tests = [
   async function keys() {
     const response = await evaluateJS("keys({foo: 'bar'})");
     checkObject(response, {
       result: {
         class: "Array",
         preview: {
           items: ["foo"]
         }
@@ -56,16 +39,33 @@ tests = [
           items: ["bar"]
         }
       }
     });
     nextTest();
   },
 ];
 
+function evaluateJS(input) {
+  return gState.webConsoleFront.evaluateJSAsync(input);
+}
+
+function startTest() {
+  info ("Content window opened, attaching console to it");
+
+  const systemPrincipal = Cc["@mozilla.org/systemprincipal;1"].createInstance(Ci.nsIPrincipal);
+  ok (!gWin.document.nodePrincipal.equals(systemPrincipal),
+      "The test document is not using the system principal");
+
+  attachConsoleToTab([], state => {
+    gState = state;
+    runTests(tests, testEnd);
+  });
+}
+
 function testEnd() {
   gWin.close();
   gWin = null;
   closeDebugger(gState, function() {
     gState = null;
     SimpleTest.finish();
   });
 }
--- a/devtools/shared/webconsole/test/test_console_group_styling.html
+++ b/devtools/shared/webconsole/test/test_console_group_styling.html
@@ -5,18 +5,16 @@
   <title>Test for console.group styling with %c</title>
   <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
   <script>
 "use strict";
 
-const TEST_URL = "data:text/html,<html><body>Hello</body></html>";
-
 window.onload = async function () {
   SimpleTest.waitForExplicitFinish();
   let state;
   try {
     const onAttachConsole = new Promise(resolve => attachConsole(
       ["ConsoleAPI"],
       (consoleState, response) => resolve(consoleState)
     ));
--- a/devtools/shared/webconsole/test/test_console_serviceworker.html
+++ b/devtools/shared/webconsole/test/test_console_serviceworker.html
@@ -7,16 +7,18 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for the Console API and Service Workers</p>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 // Utils functions
 function withFrame(url) {
   return new Promise(resolve => {
     const iframe = document.createElement("iframe");
     iframe.onload = function () {
       resolve(iframe);
--- a/devtools/shared/webconsole/test/test_console_serviceworker_cached.html
+++ b/devtools/shared/webconsole/test/test_console_serviceworker_cached.html
@@ -7,16 +7,18 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for getCachedMessages and Service Workers</p>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 const BASE_URL = "https://example.com/chrome/devtools/shared/webconsole/test/";
 const SERVICE_WORKER_URL = BASE_URL + "helper_serviceworker.js";
 const FRAME_URL = BASE_URL + "sandboxed_iframe.html";
 
 const firstTabExpectedCalls = [
   {
@@ -68,17 +70,18 @@ const startTest = async function () {
       });
     });
   });
 
   // Because this tab is being added after the original messages happened,
   // they shouldn't show up in a call to getCachedMessages.
   // However, there is a fetch event which is logged due to loading the tab.
   info("Adding a new tab at the same URL");
-  const tab2 = await addTab(FRAME_URL);
+
+  await addTab(FRAME_URL);
   await new Promise(resolve => {
     info("Attaching console to tab 2");
     attachConsoleToTab(["ConsoleAPI"], function(state) {
       state.webConsoleFront.getCachedMessages(["ConsoleAPI"]).then(function(calls) {
         checkConsoleAPICalls(calls.messages, secondTabExpectedCalls);
         closeDebugger(state, resolve);
       });
     });
--- a/devtools/shared/webconsole/test/test_console_styling.html
+++ b/devtools/shared/webconsole/test/test_console_styling.html
@@ -7,16 +7,18 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for console.log styling with %c</p>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 let expectedConsoleCalls = [];
 
 function doConsoleCalls(aState)
 {
   top.console.log("%cOne formatter with no styles");
   top.console.log("%cOne formatter", "color: red");
--- a/devtools/shared/webconsole/test/test_console_timestamp.html
+++ b/devtools/shared/webconsole/test/test_console_timestamp.html
@@ -5,18 +5,16 @@
   <title>Test for console.group styling with %c</title>
   <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
   <script>
 "use strict";
 
-const TEST_URL = "data:text/html,<html>Test ConsoleAPI timestamp correctness";
-
 window.onload = async function () {
   SimpleTest.waitForExplicitFinish();
   let state;
   try {
     const onAttachConsole = new Promise(resolve => attachConsole(
       ["ConsoleAPI"],
       (consoleState, response) => resolve(consoleState)
     ));
--- a/devtools/shared/webconsole/test/test_console_worker.html
+++ b/devtools/shared/webconsole/test/test_console_worker.html
@@ -7,16 +7,18 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for the Console API and Workers</p>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 const expectedCachedConsoleCalls = [
     {
       level: "log",
       filename: /console-test-worker/,
       arguments: ['Log from worker init'],
     },
@@ -25,19 +27,19 @@ const expectedCachedConsoleCalls = [
 const expectedConsoleAPICalls = [
     {
       level: "log",
       arguments: ['Log was requested from worker'],
     },
 ];
 
 window.onload = async function () {
-  const {state,response} = await new Promise(resolve => {
-    attachConsoleToWorker(["ConsoleAPI"], (state, response) => {
-      resolve({state,response})
+  const {state} = await new Promise(resolve => {
+    attachConsoleToWorker(["ConsoleAPI"], (s) => {
+      resolve({state: s})
     });
   });
 
   await testCachedMessages(state);
   await testConsoleAPI(state);
 
   closeDebugger(state, function() {
     SimpleTest.finish();
--- a/devtools/shared/webconsole/test/test_consoleapi.html
+++ b/devtools/shared/webconsole/test/test_consoleapi.html
@@ -7,16 +7,18 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for the Console API</p>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 let expectedConsoleCalls = [];
 
 function doConsoleCalls(aState)
 {
   const longString = (new Array(DebuggerServer.LONG_STRING_LENGTH + 2)).join("a");
 
@@ -38,18 +40,17 @@ function doConsoleCalls(aState)
   top.console.log(sandboxObj);
 
   function fromAsmJS() {
       top.console.error("foobarBaz-asmjs-error", undefined);
   }
 
   (function(global, foreign) {
     "use asm";
-    var fromAsmJS = foreign.fromAsmJS;
-    function inAsmJS2() { fromAsmJS() }
+    function inAsmJS2() { foreign.fromAsmJS() }
     function inAsmJS1() { inAsmJS2() }
     return inAsmJS1
   })(null, { fromAsmJS:fromAsmJS })();
 
   expectedConsoleCalls = [
     {
       level: "log",
       filename: /test_consoleapi/,
--- a/devtools/shared/webconsole/test/test_consoleapi_innerID.html
+++ b/devtools/shared/webconsole/test/test_consoleapi_innerID.html
@@ -7,16 +7,18 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for the Console API</p>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 let expectedConsoleCalls = [];
 
 function doConsoleCalls(aState)
 {
   const { ConsoleAPI } = ChromeUtils.import("resource://gre/modules/Console.jsm");
   const console = new ConsoleAPI({
--- a/devtools/shared/webconsole/test/test_file_uri.html
+++ b/devtools/shared/webconsole/test/test_file_uri.html
@@ -7,16 +7,18 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for file activity tracking</p>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 const {FileUtils} = ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
 
 let gState;
 let gTmpFile;
 
--- a/devtools/shared/webconsole/test/test_jsterm.html
+++ b/devtools/shared/webconsole/test/test_jsterm.html
@@ -9,16 +9,18 @@
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for JavaScript terminal functionality</p>
 
 <iframe id="content-iframe" src="http://example.com/chrome/devtools/shared/webconsole/test/sandboxed_iframe.html"></iframe>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 let gState;
 
 const {MAX_AUTOCOMPLETE_ATTEMPTS,MAX_AUTOCOMPLETIONS} = require("devtools/shared/webconsole/js-property-provider");
 
 
 function evaluateJS(input, options = {}) {
@@ -176,17 +178,17 @@ async function doEvalWithBindingFrame() 
   frameWin.fooFrame = { bar: 1 };
 
   const response = await evaluateJS(
     "document.querySelector('iframe').contentWindow.fooFrame"
   );
   const iframeObjectActor = response.result.actor;
   ok(iframeObjectActor, "There is an actor associated with the response");
 
-  const selectedObjectGlobal = await evaluateJS("this.temp1 = _self;", {
+  await evaluateJS("this.temp1 = _self;", {
     selectedObjectActor: iframeObjectActor
   });
   ok(top.temp1 && top.temp1.bar === 1,
     "Global matches the top global with bindObjectActor");
   ok(!frameWin.temp1,
     "Global doesn't match the object's global with bindObjectActor");
 
   nextTest()
--- a/devtools/shared/webconsole/test/test_jsterm_autocomplete.html
+++ b/devtools/shared/webconsole/test/test_jsterm_autocomplete.html
@@ -7,16 +7,18 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for JavaScript terminal autocomplete functionality</p>
 
 <script class="testbody" type="text/javascript">
+  "use strict";
+
   SimpleTest.waitForExplicitFinish();
   const {
     MAX_AUTOCOMPLETE_ATTEMPTS,
     MAX_AUTOCOMPLETIONS
   } = require("devtools/shared/webconsole/js-property-provider");
   const RESERVED_JS_KEYWORDS = require("devtools/shared/webconsole/reserved-js-words");
 
 
--- a/devtools/shared/webconsole/test/test_jsterm_cd_iframe.html
+++ b/devtools/shared/webconsole/test/test_jsterm_cd_iframe.html
@@ -9,16 +9,18 @@
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for the cd() function</p>
 
 <iframe id="content-iframe" src="http://example.com/chrome/devtools/shared/webconsole/test/sandboxed_iframe.html"></iframe>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 let gState;
 
 function startTest()
 {
   removeEventListener("load", startTest);
 
--- a/devtools/shared/webconsole/test/test_jsterm_last_result.html
+++ b/devtools/shared/webconsole/test/test_jsterm_last_result.html
@@ -9,16 +9,18 @@
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for the $_ getter</p>
 
 <iframe id="content-iframe" src="http://example.com/chrome/devtools/shared/webconsole/test/sandboxed_iframe.html"></iframe>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 let gState;
 
 function evaluateJS(input) {
   return gState.webConsoleFront.evaluateJSAsync(input);
 }
 
 function startTest()
--- a/devtools/shared/webconsole/test/test_jsterm_queryselector.html
+++ b/devtools/shared/webconsole/test/test_jsterm_queryselector.html
@@ -7,16 +7,18 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for the querySelector / querySelectorAll helpers</p>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 let gState;
 let gWin;
 
 function evaluateJS(input) {
   return gState.webConsoleFront.evaluateJSAsync(input);
 }
 
--- a/devtools/shared/webconsole/test/test_network_get.html
+++ b/devtools/shared/webconsole/test/test_network_get.html
@@ -9,16 +9,18 @@
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for the network actor (GET request)</p>
 
 <iframe src="http://example.com/chrome/devtools/shared/webconsole/test/network_requests_iframe.html"></iframe>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 function startTest()
 {
   removeEventListener("load", startTest);
   attachConsoleToTab(["NetworkActivity"], onAttach);
 }
 
--- a/devtools/shared/webconsole/test/test_network_post.html
+++ b/devtools/shared/webconsole/test/test_network_post.html
@@ -9,16 +9,18 @@
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for the network actor (POST request)</p>
 
 <iframe src="http://example.com/chrome/devtools/shared/webconsole/test/network_requests_iframe.html"></iframe>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 function startTest()
 {
   removeEventListener("load", startTest);
 
   attachConsoleToTab(["NetworkActivity"], onAttach);
 }
--- a/devtools/shared/webconsole/test/test_network_security-hpkp.html
+++ b/devtools/shared/webconsole/test/test_network_security-hpkp.html
@@ -9,16 +9,18 @@
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for the network actor (HPKP detection)</p>
 
 <iframe src="https://example.com/chrome/devtools/shared/webconsole/test/network_requests_iframe.html"></iframe>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 let gCurrentTestCase = -1;
 const HPKP_ENABLED_PREF = "security.cert_pinning.hpkp.enabled";
 const PROCESS_HPKP_FROM_NON_BUILTIN_ROOTS_PREF = "security.cert_pinning.process_headers_from_non_builtin_roots";
 
 // Static pins tested by unit/test_security-info-static-hpkp.js.
 const TEST_CASES = [
@@ -46,18 +48,17 @@ function startTest() {
   SimpleTest.registerCleanupFunction(() => {
     Services.prefs.setBoolPref(HPKP_ENABLED_PREF, false);
     Services.prefs.setBoolPref(PROCESS_HPKP_FROM_NON_BUILTIN_ROOTS_PREF, false);
 
     // Reset pinning state.
     const gSSService = Cc["@mozilla.org/ssservice;1"]
                        .getService(Ci.nsISiteSecurityService);
 
-    const gIOService = Cc["@mozilla.org/network/io-service;1"]
-                       .getService(Ci.nsIIOService);
+    const gIOService = Services.io;
     for (const {url} of TEST_CASES) {
       const uri = gIOService.newURI(url);
       gSSService.resetState(Ci.nsISiteSecurityService.HEADER_HPKP, uri, 0);
     }
   });
 
   info("Test detection of Public Key Pinning.");
   removeEventListener("load", startTest);
--- a/devtools/shared/webconsole/test/test_network_security-hsts.html
+++ b/devtools/shared/webconsole/test/test_network_security-hsts.html
@@ -9,16 +9,18 @@
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for the network actor (HSTS detection)</p>
 
 <iframe src="https://example.com/chrome/devtools/shared/webconsole/test/network_requests_iframe.html"></iframe>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 let gCurrentTestCase = -1;
 const TEST_CASES = [
   {
     desc: "no HSTS",
     url: "https://example.com",
     usesHSTS: false,
@@ -39,18 +41,17 @@ const TEST_CASES = [
 function startTest()
 {
 
   SimpleTest.registerCleanupFunction(() => {
     // Reset HSTS state.
     const gSSService = Cc["@mozilla.org/ssservice;1"]
                        .getService(Ci.nsISiteSecurityService);
 
-    const gIOService = Cc["@mozilla.org/network/io-service;1"]
-                       .getService(Ci.nsIIOService);
+    const gIOService = Services.io;
 
     const uri = gIOService.newURI(TEST_CASES[0].url);
     gSSService.resetState(Ci.nsISiteSecurityService.HEADER_HSTS, uri, 0);
   });
 
   info("Test detection of HTTP Strict Transport Security.");
   removeEventListener("load", startTest);
   attachConsoleToTab(["NetworkActivity"], onAttach);
--- a/devtools/shared/webconsole/test/test_object_actor.html
+++ b/devtools/shared/webconsole/test/test_object_actor.html
@@ -7,16 +7,18 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for the object actor</p>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 SpecialPowers.pushPrefEnv({"set": [["security.allow_eval_with_system_principal",
 																		true]]});
 
 let expectedProps = [];
 
 function startTest() {
--- a/devtools/shared/webconsole/test/test_object_actor_native_getters.html
+++ b/devtools/shared/webconsole/test/test_object_actor_native_getters.html
@@ -7,16 +7,18 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for the native getters in object actors</p>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 let expectedProps = [];
 let expectedSafeGetters = [];
 
 function startTest()
 {
   removeEventListener("load", startTest);
--- a/devtools/shared/webconsole/test/test_object_actor_native_getters_lenient_this.html
+++ b/devtools/shared/webconsole/test/test_object_actor_native_getters_lenient_this.html
@@ -8,16 +8,18 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for the native getters in object actors</p>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 function startTest()
 {
   removeEventListener("load", startTest);
 
   attachConsoleToTab(["ConsoleAPI"], onAttach);
 }
--- a/devtools/shared/webconsole/test/test_page_errors.html
+++ b/devtools/shared/webconsole/test/test_page_errors.html
@@ -7,16 +7,18 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Test for page errors</p>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 let expectedPageErrors = [];
 
 function doPageErrors() {
   expectedPageErrors = {
     "document.body.style.color = 'fooColor';": {
       errorMessage: /fooColor/,
--- a/devtools/shared/webconsole/test/test_throw.html
+++ b/devtools/shared/webconsole/test/test_throw.html
@@ -7,72 +7,74 @@
   <script type="text/javascript" src="common.js"></script>
   <!-- Any copyright is dedicated to the Public Domain.
      - http://creativecommons.org/publicdomain/zero/1.0/ -->
 </head>
 <body>
 <p>Web Console throw tests</p>
 
 <script class="testbody" type="text/javascript">
+"use strict";
+
 SimpleTest.waitForExplicitFinish();
 
 function startTest()
 {
   removeEventListener("load", startTest);
   attachConsoleToTab([], onAttach);
 }
 
-function onAttach(aState, aResponse)
+function onAttach(aState)
 {
   const tests = [];
 
   const falsyValues = ["-0", "null", "undefined", "Infinity", "-Infinity", "NaN"];
   falsyValues.forEach(function(value) {
     tests.push(async function() {
-      const aResponse = await aState.webConsoleFront.evaluateJSAsync("throw " + value + ";")
-      const type = aResponse.exception.type;
+      const response = await aState.webConsoleFront.evaluateJSAsync("throw " + value + ";")
+      const type = response.exception.type;
       is(type, value, "exception.type for throw " + value);
       nextTest();
     });
   });
 
   const identityTestValues = [false, 0];
   identityTestValues.forEach(function(value) {
     tests.push(async function() {
-      const aResponse = await aState.webConsoleFront.evaluateJSAsync("throw " + value + ";")
-      const exception = aResponse.exception;
+      const response = await aState.webConsoleFront.evaluateJSAsync("throw " + value + ";")
+      const exception = response.exception;
       is(exception, value, "response.exception for throw " + value);
       nextTest();
     });
   });
 
   const longString = Array(DebuggerServer.LONG_STRING_LENGTH + 1).join("a"),
       shortedString = longString.substring(0,
                         DebuggerServer.LONG_STRING_INITIAL_LENGTH
                       );
   tests.push(async function() {
-    const aResponse = await aState.webConsoleFront.evaluateJSAsync("throw '" + longString + "';")
-    is(aResponse.exception.initial, shortedString,
+    const response = await aState.webConsoleFront.evaluateJSAsync("throw '" + longString + "';")
+    is(response.exception.initial, shortedString,
       "exception.initial for throw longString"
     );
-    is(aResponse.exceptionMessage.initial, shortedString,
+    is(response.exceptionMessage.initial, shortedString,
       "exceptionMessage.initial for throw longString"
     );
     nextTest();
   });
 
   const symbolTestValues = [
     ["Symbol.iterator", "Symbol(Symbol.iterator)"],
     ["Symbol('foo')", "Symbol(foo)"],
     ["Symbol()", "Symbol()"],
   ];
   symbolTestValues.forEach(function([expr, message]) {
     tests.push(async function() {
-      const aResponse = await aState.webConsoleFront.evaluateJSAsync("throw " + expr + ";");
-      is(aResponse.exceptionMessage, message,
+      const response = await aState.webConsoleFront.evaluateJSAsync("throw " + expr + ";");
+      is(response.exceptionMessage, message,
          "response.exception for throw " + expr);
       nextTest();
     });
   });
 
   runTests(tests, endTest.bind(null, aState));
 }