Bug 1405279 - Remove unused variables. r?whimboo draft
authorAndreas Tolfsen <ato@sny.no>
Tue, 03 Oct 2017 14:35:47 +0100
changeset 675011 e57abf9e7df0b9ac931a8b5e119b1468594e5a42
parent 674983 ee1c41cf306df0043a8e68af042f133acf2ef94e
child 675012 2a8df8abf94903224b030fd7516b0774d21ed741
push id83012
push userbmo:ato@sny.no
push dateWed, 04 Oct 2017 18:38:20 +0000
reviewerswhimboo
bugs1405279
milestone58.0a1
Bug 1405279 - Remove unused variables. r?whimboo MozReview-Commit-ID: CmiDVCw6xVK
testing/marionette/accessibility.js
testing/marionette/addon.js
testing/marionette/assert.js
testing/marionette/browser.js
testing/marionette/cert.js
testing/marionette/components/marionette.js
testing/marionette/dom.js
testing/marionette/driver.js
testing/marionette/element.js
testing/marionette/evaluate.js
testing/marionette/event.js
testing/marionette/interaction.js
testing/marionette/l10n.js
testing/marionette/listener.js
testing/marionette/message.js
testing/marionette/navigate.js
testing/marionette/packets.js
testing/marionette/reftest.js
testing/marionette/server.js
testing/marionette/session.js
testing/marionette/stream-utils.js
testing/marionette/transport.js
testing/marionette/wait.js
--- a/testing/marionette/accessibility.js
+++ b/testing/marionette/accessibility.js
@@ -151,17 +151,17 @@ accessibility.Checks = class {
           reject();
         } else {
           resolve(acc);
         }
         return;
       }
       // Accessibility for the doc is busy, so wait for the state to change.
       let eventObserver = {
-        observe(subject, topic, data) {
+        observe(subject, topic) {
           if (topic !== "accessible-event") {
             return;
           }
 
           // If event type does not match expected type, skip the event.
           let event = subject.QueryInterface(Ci.nsIAccessibleEvent);
           if (event.eventType !== Ci.nsIAccessibleEvent.EVENT_STATE_CHANGE) {
             return;
--- a/testing/marionette/addon.js
+++ b/testing/marionette/addon.js
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-const {interfaces: Ci, utils: Cu} = Components;
+const {utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/AddonManager.jsm");
 Cu.import("resource://gre/modules/FileUtils.jsm");
 
 const {UnknownError} = Cu.import("chrome://marionette/content/error.js", {});
 
 this.EXPORTED_SYMBOLS = ["addon"];
 
--- a/testing/marionette/assert.js
+++ b/testing/marionette/assert.js
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+const {utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/AppConstants.jsm");
 Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
 const {
   InvalidArgumentError,
   InvalidSessionIDError,
--- a/testing/marionette/browser.js
+++ b/testing/marionette/browser.js
@@ -229,19 +229,17 @@ browser.Context = class {
   /**
    * Close the current window.
    *
    * @return {Promise}
    *     A promise which is resolved when the current window has been closed.
    */
   closeWindow() {
     return new Promise(resolve => {
-      this.window.addEventListener("unload", ev => {
-        resolve();
-      }, {once: true});
+      this.window.addEventListener("unload", resolve, {once: true});
       this.window.close();
     });
   }
 
   /**
    * Close the current tab.
    *
    * @return {Promise}
@@ -258,26 +256,22 @@ browser.Context = class {
         this.tabBrowser.tabs.length === 1 ||
         !this.tab) {
       return this.closeWindow();
     }
 
     return new Promise((resolve, reject) => {
       if (this.tabBrowser.closeTab) {
         // Fennec
-        this.tabBrowser.deck.addEventListener("TabClose", ev => {
-          resolve();
-        }, {once: true});
+        this.tabBrowser.deck.addEventListener("TabClose", resolve, {once: true});
         this.tabBrowser.closeTab(this.tab);
 
       } else if (this.tabBrowser.removeTab) {
         // Firefox
-        this.tab.addEventListener("TabClose", ev => {
-          resolve();
-        }, {once: true});
+        this.tab.addEventListener("TabClose", resolve, {once: true});
         this.tabBrowser.removeTab(this.tab);
 
       } else {
         reject(new UnsupportedOperationError(
             `closeTab() not supported in ${this.driver.appName}`));
       }
     });
   }
--- a/testing/marionette/cert.js
+++ b/testing/marionette/cert.js
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
+const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 this.EXPORTED_SYMBOLS = ["cert"];
 
 const registrar =
     Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
--- a/testing/marionette/components/marionette.js
+++ b/testing/marionette/components/marionette.js
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-const {Constructor: CC, interfaces: Ci, utils: Cu, classes: Cc} = Components;
+const {interfaces: Ci, utils: Cu, classes: Cc} = Components;
 
 Cu.import("resource://gre/modules/Log.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(
     this, "env", "@mozilla.org/process/environment;1", "nsIEnvironment");
 
@@ -60,20 +60,16 @@ const ENV_ENABLED = "MOZ_MARIONETTE";
 // a different profile in order to test things like Firefox refresh.
 // The environment variable itself, if present, is interpreted as a
 // JSON structure, with the keys mapping to preference names in the
 // "marionette." branch, and the values to the values of those prefs. So
 // something like {"port": 4444} would result in the marionette.port
 // pref being set to 4444.
 const ENV_PRESERVE_PREFS = "MOZ_MARIONETTE_PREF_STATE_ACROSS_RESTARTS";
 
-const ServerSocket = CC("@mozilla.org/network/server-socket;1",
-    "nsIServerSocket",
-    "initSpecialConnection");
-
 const {PREF_STRING, PREF_BOOL, PREF_INT, PREF_INVALID} = Ci.nsIPrefBranch;
 
 function getPrefVal(pref) {
   let prefType = Services.prefs.getPrefType(pref);
   let prefValue;
   switch (prefType) {
     case PREF_STRING:
       prefValue = Services.prefs.getStringPref(pref);
@@ -187,17 +183,17 @@ MarionetteComponent.prototype = {
 // Handle -marionette flag
 MarionetteComponent.prototype.handle = function(cmdLine) {
   if (!this.enabled && cmdLine.handleFlag("marionette", false)) {
     this.enabled = true;
     this.logger.info("Enabled via --marionette");
   }
 };
 
-MarionetteComponent.prototype.observe = function(subject, topic, data) {
+MarionetteComponent.prototype.observe = function(subject, topic) {
   this.logger.debug(`Received observer notification "${topic}"`);
 
   switch (topic) {
     case "profile-after-change":
       Services.obs.addObserver(this, "command-line-startup");
       Services.obs.addObserver(this, "sessionstore-windows-restored");
 
       prefs.readFromEnvironment(ENV_PRESERVE_PREFS);
--- a/testing/marionette/dom.js
+++ b/testing/marionette/dom.js
@@ -1,16 +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 {utils: Cu} = Components;
-
 this.EXPORTED_SYMBOLS = [
   "ContentEventObserverService",
   "WebElementEventTarget",
 ];
 
 /**
  * The {@link EventTarget} for web elements can be used to observe DOM
  * events in the content document.
@@ -108,17 +106,17 @@ class WebElementEventTarget {
       listener.call(this, event);
 
       if (listener.once) {
         this.removeEventListener(event.type, listener);
       }
     });
   }
 
-  receiveMessage({target, name, data, objects}) {
+  receiveMessage({name, data, objects}) {
     if (name != "Marionette:DOM:OnEvent") {
       return;
     }
 
     let ev = {
       type: data.type,
       target: objects.target,
     };
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -2,19 +2,16 @@
  * 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";
 /* global XPCNativeWrapper */
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-const loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
-    .getService(Ci.mozIJSSubScriptLoader);
-
 Cu.import("resource://gre/modules/Log.jsm");
 Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 Cu.import("chrome://marionette/content/accessibility.js");
 Cu.import("chrome://marionette/content/addon.js");
 Cu.import("chrome://marionette/content/assert.js");
@@ -24,17 +21,16 @@ const {
   WindowState,
 } = Cu.import("chrome://marionette/content/browser.js", {});
 Cu.import("chrome://marionette/content/capture.js");
 Cu.import("chrome://marionette/content/cert.js");
 Cu.import("chrome://marionette/content/cookie.js");
 Cu.import("chrome://marionette/content/element.js");
 const {
   ElementNotInteractableError,
-  error,
   InsecureCertificateError,
   InvalidArgumentError,
   InvalidCookieDomainError,
   InvalidSelectorError,
   NoAlertOpenError,
   NoSuchFrameError,
   NoSuchWindowError,
   SessionNotCreatedError,
@@ -750,17 +746,17 @@ GeckoDriver.prototype.listeningPromise =
  *     above.
  *
  * @return {Object}
  *     Session ID and capabilities offered by the WebDriver service.
  *
  * @throws {SessionNotCreatedError}
  *     If, for whatever reason, a session could not be created.
  */
-GeckoDriver.prototype.newSession = async function(cmd, resp) {
+GeckoDriver.prototype.newSession = async function(cmd) {
   if (this.sessionID) {
     throw new SessionNotCreatedError("Maximum number of active sessions");
   }
   this.sessionID = element.generateUUID();
   this.newSessionCommandId = cmd.id;
 
   try {
     this.capabilities = session.Capabilities.fromJSON(cmd.parameters);
@@ -865,17 +861,17 @@ GeckoDriver.prototype.getSessionCapabili
 /**
  * Sets the context of the subsequent commands to be either "chrome" or
  * "content".
  *
  * @param {string} value
  *     Name of the context to be switched to.  Must be one of "chrome" or
  *     "content".
  */
-GeckoDriver.prototype.setContext = function(cmd, resp) {
+GeckoDriver.prototype.setContext = function(cmd) {
   let val = cmd.parameters.value;
   let ctx = Context.fromString(val);
   if (ctx === null) {
     throw new WebDriverError(`Invalid context: ${val}`);
   }
   this.context = ctx;
 };
 
@@ -1087,17 +1083,17 @@ GeckoDriver.prototype.execute_ = async f
  *
  * @throws {UnsupportedOperationError}
  *     Not available in current context.
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.get = async function(cmd, resp) {
+GeckoDriver.prototype.get = async function(cmd) {
   assert.content(this.context);
   assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   let url = cmd.parameters.url;
 
   let get = this.listener.get({url, pageTimeout: this.timeouts.pageLoad});
 
@@ -1131,17 +1127,17 @@ GeckoDriver.prototype.get = async functi
  * When in the context of the chrome, this returns the canonical URL
  * of the current resource.
  *
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.getCurrentUrl = function(cmd) {
+GeckoDriver.prototype.getCurrentUrl = function() {
   assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   return this.currentURL.toString();
 };
 
 /**
  * Gets the current title of the window.
@@ -1149,17 +1145,17 @@ GeckoDriver.prototype.getCurrentUrl = fu
  * @return {string}
  *     Document title of the top-level browsing context.
  *
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.getTitle = function(cmd, resp) {
+GeckoDriver.prototype.getTitle = function() {
   assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   return this.title;
 };
 
 /** Gets the current type of the window. */
 GeckoDriver.prototype.getWindowType = function(cmd, resp) {
@@ -1202,17 +1198,17 @@ GeckoDriver.prototype.getPageSource = as
  *
  * @throws {UnsupportedOperationError}
  *     Not available in current context.
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.goBack = async function(cmd, resp) {
+GeckoDriver.prototype.goBack = async function() {
   assert.content(this.context);
   assert.contentBrowser(this.curBrowser);
   assert.noUserPrompt(this.dialog);
 
   // If there is no history, just return
   if (!this.curBrowser.contentBrowser.webNavigation.canGoBack) {
     return;
   }
@@ -1245,17 +1241,17 @@ GeckoDriver.prototype.goBack = async fun
  *
  * @throws {UnsupportedOperationError}
  *     Not available in current context.
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.goForward = async function(cmd, resp) {
+GeckoDriver.prototype.goForward = async function() {
   assert.content(this.context);
   assert.contentBrowser(this.curBrowser);
   assert.noUserPrompt(this.dialog);
 
   // If there is no history, just return
   if (!this.curBrowser.contentBrowser.webNavigation.canGoForward) {
     return;
   }
@@ -1289,17 +1285,17 @@ GeckoDriver.prototype.goForward = async 
  *
  * @throws {UnsupportedOperationError}
  *     Not available in current context.
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.refresh = async function(cmd, resp) {
+GeckoDriver.prototype.refresh = async function() {
   assert.content(this.context);
   assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   let refresh = this.listener.refresh(
       {pageTimeout: this.timeouts.pageLoad});
 
   // If a reload of the frame script interrupts our page load, this will
@@ -1358,34 +1354,34 @@ GeckoDriver.prototype.getIdForBrowser = 
  * be used to switch to this window at a later point.
  *
  * @return {string}
  *     Unique window handle.
  *
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  */
-GeckoDriver.prototype.getWindowHandle = function(cmd, resp) {
+GeckoDriver.prototype.getWindowHandle = function() {
   assert.contentBrowser(this.curBrowser);
 
   return this.curBrowser.curFrameId.toString();
 };
 
 /**
  * Get a list of top-level browsing contexts. On desktop this typically
  * corresponds to the set of open tabs for browser windows, or the window
  * itself for non-browser chrome windows.
  *
  * Each window handle is assigned by the server and is guaranteed unique,
  * however the return array does not have a specified ordering.
  *
  * @return {Array.<string>}
  *     Unique window handles.
  */
-GeckoDriver.prototype.getWindowHandles = function(cmd, resp) {
+GeckoDriver.prototype.getWindowHandles = function() {
   return this.windowHandles.map(String);
 };
 
 /**
  * Get the current window's handle.  This corresponds to a window that
  * may itself contain tabs.
  *
  * Return an opaque server-assigned identifier to this window that
@@ -1411,17 +1407,17 @@ GeckoDriver.prototype.getChromeWindowHan
 
 /**
  * Returns identifiers for each open chrome window for tests interested in
  * managing a set of chrome windows and tabs separately.
  *
  * @return {Array.<string>}
  *     Unique window handles.
  */
-GeckoDriver.prototype.getChromeWindowHandles = function(cmd, resp) {
+GeckoDriver.prototype.getChromeWindowHandles = function() {
   return this.chromeWindowHandles.map(String);
 };
 
 /**
  * Get the current position and size of the browser window currently in focus.
  *
  * Will return the current browser window size in pixels. Refers to
  * window outerWidth and outerHeight values, which include scroll bars,
@@ -1431,17 +1427,17 @@ GeckoDriver.prototype.getChromeWindowHan
  *     Object with |x| and |y| coordinates, and |width| and |height|
  *     of browser window.
  *
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.getWindowRect = function(cmd, resp) {
+GeckoDriver.prototype.getWindowRect = function() {
   assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
   return this.curBrowser.rect;
 };
 
 /**
  * Set the window position and size of the browser on the operating
  * system window manager.
@@ -1467,17 +1463,17 @@ GeckoDriver.prototype.getWindowRect = fu
  *
  * @throws {UnsupportedOperationError}
  *     Not applicable to application.
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.setWindowRect = async function(cmd, resp) {
+GeckoDriver.prototype.setWindowRect = async function(cmd) {
   assert.firefox();
   const win = assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   let {x, y, width, height} = cmd.parameters;
   let origRect = this.curBrowser.rect;
 
   // Synchronous resize to |width| and |height| dimensions.
@@ -1552,17 +1548,17 @@ GeckoDriver.prototype.setWindowRect = as
  * precedence.
  *
  * @param {string} name
  *     Target name or ID of the window to switch to.
  * @param {boolean=} focus
  *      A boolean value which determines whether to focus
  *      the window. Defaults to true.
  */
-GeckoDriver.prototype.switchToWindow = async function(cmd, resp) {
+GeckoDriver.prototype.switchToWindow = async function(cmd) {
   let focus = true;
   if (typeof cmd.parameters.focus != "undefined") {
     focus = cmd.parameters.focus;
   }
 
   // Window IDs are internally handled as numbers, but here it could
   // also be the name of the window.
   let switchTo = parseInt(cmd.parameters.name);
@@ -1701,17 +1697,17 @@ GeckoDriver.prototype.getActiveFrame = f
  * Set the current browsing context for future commands to the parent
  * of the current browsing context.
  *
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.switchToParentFrame = async function(cmd, resp) {
+GeckoDriver.prototype.switchToParentFrame = async function() {
   assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   await this.listener.switchToParentFrame();
 };
 
 /**
  * Switch to a given frame within the current window.
@@ -1722,17 +1718,17 @@ GeckoDriver.prototype.switchToParentFram
  *     If element is not defined, then this holds either the id, name,
  *     or index of the frame to switch to.
  *
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.switchToFrame = async function(cmd, resp) {
+GeckoDriver.prototype.switchToFrame = async function(cmd) {
   assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   let {id, element, focus} = cmd.parameters;
 
   const otherErrorsExpr = /about:.+(error)|(blocked)\?/;
   const checkTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
 
@@ -1896,39 +1892,39 @@ GeckoDriver.prototype.switchToFrame = as
           this.curBrowser.frameManager.switchToFrame(winId, frameId);
 
       await registerBrowsers;
       await browserListening;
     }
   }
 };
 
-GeckoDriver.prototype.getTimeouts = function(cmd, resp) {
+GeckoDriver.prototype.getTimeouts = function() {
   return this.timeouts;
 };
 
 /**
  * Set timeout for page loading, searching, and scripts.
  *
  * @param {Object.<string, number>}
  *     Dictionary of timeout types and their new value, where all timeout
  *     types are optional.
  *
  * @throws {InvalidArgumentError}
  *     If timeout type key is unknown, or the value provided with it is
  *     not an integer.
  */
-GeckoDriver.prototype.setTimeouts = function(cmd, resp) {
+GeckoDriver.prototype.setTimeouts = function(cmd) {
   // merge with existing timeouts
   let merged = Object.assign(this.timeouts.toJSON(), cmd.parameters);
   this.timeouts = session.Timeouts.fromJSON(merged);
 };
 
 /** Single tap. */
-GeckoDriver.prototype.singleTap = async function(cmd, resp) {
+GeckoDriver.prototype.singleTap = async function(cmd) {
   assert.window(this.getCurrentWindow());
 
   let {id, x, y} = cmd.parameters;
 
   switch (this.context) {
     case Context.CHROME:
       throw new UnsupportedOperationError(
           "Command 'singleTap' is not yet available in chrome context");
@@ -1948,17 +1944,17 @@ GeckoDriver.prototype.singleTap = async 
  *
  * @throws {UnsupportedOperationError}
  *     Not yet available in current context.
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.performActions = async function(cmd, resp) {
+GeckoDriver.prototype.performActions = async function(cmd) {
   assert.content(this.context,
       "Command 'performActions' is not yet available in chrome context");
   assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   let actions = cmd.parameters.actions;
   await this.listener.performActions({"actions": actions});
 };
@@ -1968,17 +1964,17 @@ GeckoDriver.prototype.performActions = a
  *
  * @throws {UnsupportedOperationError}
  *     Not available in current context.
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.releaseActions = async function(cmd, resp) {
+GeckoDriver.prototype.releaseActions = async function() {
   assert.content(this.context);
   assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   await this.listener.releaseActions();
 };
 
 /**
@@ -2031,17 +2027,17 @@ GeckoDriver.prototype.actionChain = asyn
  *
  * @throws {UnsupportedOperationError}
  *     Not available in current context.
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.multiAction = async function(cmd, resp) {
+GeckoDriver.prototype.multiAction = async function(cmd) {
   assert.content(this.context);
   assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   let {value, max_length} = cmd.parameters;  // eslint-disable-line camelcase
 
   this.addFrameCloseListener("multi action chain");
   await this.listener.multiAction(value, max_length);
@@ -2170,17 +2166,17 @@ GeckoDriver.prototype.getActiveElement =
  * @param {string} id
  *     Reference ID to the element that will be clicked.
  *
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.clickElement = async function(cmd, resp) {
+GeckoDriver.prototype.clickElement = async function(cmd) {
   assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   let id = cmd.parameters.id;
 
   switch (this.context) {
     case Context.CHROME:
       let el = this.curBrowser.seenEls.get(id);
@@ -2530,17 +2526,17 @@ GeckoDriver.prototype.getElementRect = a
  * @param {string} value
  *     Value to send to the element.
  *
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.sendKeysToElement = async function(cmd, resp) {
+GeckoDriver.prototype.sendKeysToElement = async function(cmd) {
   assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   let {id, text} = cmd.parameters;
   assert.string(text);
 
   switch (this.context) {
     case Context.CHROME:
@@ -2561,17 +2557,17 @@ GeckoDriver.prototype.sendKeysToElement 
  * @param {string} id
  *     Reference ID to the element that will be cleared.
  *
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.clearElement = async function(cmd, resp) {
+GeckoDriver.prototype.clearElement = async function(cmd) {
   assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   let id = cmd.parameters.id;
 
   switch (this.context) {
     case Context.CHROME:
       // the selenium atom doesn't work here
@@ -2589,17 +2585,17 @@ GeckoDriver.prototype.clearElement = asy
   }
 };
 
 /**
  * Switch to shadow root of the given host element.
  *
  * @param {string} id element id.
  */
-GeckoDriver.prototype.switchToShadowRoot = async function(cmd, resp) {
+GeckoDriver.prototype.switchToShadowRoot = async function(cmd) {
   assert.content(this.context);
   assert.window(this.getCurrentWindow());
 
   let id = cmd.parameters.id;
   await this.listener.switchToShadowRoot(id);
 };
 
 /**
@@ -2614,17 +2610,17 @@ GeckoDriver.prototype.switchToShadowRoot
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  * @throws {InvalidCookieDomainError}
  *     If <var>cookie</var> is for a different domain than the active
  *     document's host.
  */
-GeckoDriver.prototype.addCookie = function(cmd, resp) {
+GeckoDriver.prototype.addCookie = function(cmd) {
   assert.content(this.context);
   assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   let {protocol, hostname} = this.currentURL;
 
   const networkSchemes = ["ftp:", "http:", "https:"];
   if (!networkSchemes.includes(protocol)) {
@@ -2666,17 +2662,17 @@ GeckoDriver.prototype.getCookies = funct
  *
  * @throws {UnsupportedOperationError}
  *     Not available in current context.
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.deleteAllCookies = function(cmd, resp) {
+GeckoDriver.prototype.deleteAllCookies = function() {
   assert.content(this.context);
   assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   let {hostname, pathname} = this.currentURL;
   for (let toDelete of cookie.iter(hostname, pathname)) {
     cookie.remove(toDelete);
   }
@@ -2687,17 +2683,17 @@ GeckoDriver.prototype.deleteAllCookies =
  *
  * @throws {UnsupportedOperationError}
  *     Not available in current context.
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.deleteCookie = function(cmd, resp) {
+GeckoDriver.prototype.deleteCookie = function(cmd) {
   assert.content(this.context);
   assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   let {hostname, pathname} = this.currentURL;
   let candidateName = assert.string(cmd.parameters.name);
   for (let toDelete of cookie.iter(hostname, pathname)) {
     if (toDelete.name === candidateName) {
@@ -2720,17 +2716,17 @@ GeckoDriver.prototype.deleteCookie = fun
  * @return {Array.<string>}
  *     Unique window handles of remaining windows.
  *
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.close = async function(cmd, resp) {
+GeckoDriver.prototype.close = async function() {
   assert.contentBrowser(this.curBrowser);
   assert.noUserPrompt(this.dialog);
 
   let nwins = 0;
 
   for (let win of this.windows) {
     // For browser windows count the tabs. Otherwise take the window itself.
     let tabbrowser = browser.getTabBrowser(win);
@@ -2761,17 +2757,17 @@ GeckoDriver.prototype.close = async func
  *
  * If it is the last window currently open, the chrome window will not be
  * closed to prevent a shutdown of the application. Instead the returned
  * list of chrome window handles is empty.
  *
  * @return {Array.<string>}
  *     Unique chrome window handles of remaining chrome windows.
  */
-GeckoDriver.prototype.closeChromeWindow = async function(cmd, resp) {
+GeckoDriver.prototype.closeChromeWindow = async function() {
   assert.firefox();
   assert.window(this.getCurrentWindow(Context.CHROME));
 
   let nwins = 0;
 
   // eslint-disable-next-line
   for (let _ of this.windows) {
     nwins++;
@@ -2791,17 +2787,17 @@ GeckoDriver.prototype.closeChromeWindow 
     this.mm.removeDelayedFrameScript(FRAME_SCRIPT);
   }
 
   await this.curBrowser.closeWindow();
   return this.chromeWindowHandles.map(String);
 };
 
 /** Delete Marionette session. */
-GeckoDriver.prototype.deleteSession = function(cmd, resp) {
+GeckoDriver.prototype.deleteSession = function() {
   if (this.curBrowser !== null) {
     // frame scripts can be safely reused
     Preferences.set(CONTENT_LISTENER_PREF, false);
 
     // delete session in each frame in each browser
     for (let win in this.browsers) {
       let browser = this.browsers[win];
       for (let i in browser.knownFrames) {
@@ -2879,17 +2875,17 @@ GeckoDriver.prototype.deleteSession = fu
  *     Scroll to element if |id| is provided.  If undefined, it will
  *     scroll to the element.
  *
  * @return {string}
  *     If <var>hash</var> is false, PNG image encoded as Base64 encoded
  *     string.  If <var>hash</var> is true, hex digest of the SHA-256
  *     hash of the Base64 encoded string.
  */
-GeckoDriver.prototype.takeScreenshot = function(cmd, resp) {
+GeckoDriver.prototype.takeScreenshot = function(cmd) {
   let win = assert.window(this.getCurrentWindow());
 
   let {id, highlights, full, hash} = cmd.parameters;
   highlights = highlights || [];
   let format = hash ? capture.Format.Hash : capture.Format.Base64;
 
   switch (this.context) {
     case Context.CHROME:
@@ -2949,17 +2945,17 @@ GeckoDriver.prototype.getScreenOrientati
  * The supplied orientation should be given as one of the valid
  * orientation values.  If the orientation is unknown, an error will
  * be raised.
  *
  * Valid orientations are "portrait" and "landscape", which fall
  * back to "portrait-primary" and "landscape-primary" respectively,
  * and "portrait-secondary" as well as "landscape-secondary".
  */
-GeckoDriver.prototype.setScreenOrientation = function(cmd, resp) {
+GeckoDriver.prototype.setScreenOrientation = function(cmd) {
   assert.fennec();
   let win = assert.window(this.getCurrentWindow());
 
   const ors = [
     "portrait", "landscape",
     "portrait-primary", "landscape-primary",
     "portrait-secondary", "landscape-secondary",
   ];
@@ -2989,17 +2985,17 @@ GeckoDriver.prototype.setScreenOrientati
  *
  * @throws {UnsupportedOperationError}
  *     Not available for current application.
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.minimizeWindow = async function(cmd, resp) {
+GeckoDriver.prototype.minimizeWindow = async function() {
   assert.firefox();
   const win = assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   if (WindowState.from(win.windowState) == WindowState.Fullscreen) {
     await exitFullscreen(win);
   }
 
@@ -3026,17 +3022,17 @@ GeckoDriver.prototype.minimizeWindow = a
  *
  * @throws {UnsupportedOperationError}
  *     Not available for current application.
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.maximizeWindow = async function(cmd, resp) {
+GeckoDriver.prototype.maximizeWindow = async function() {
   assert.firefox();
   const win = assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   switch (WindowState.from(win.windowState)) {
     case WindowState.Fullscreen:
       await exitFullscreen(win);
       break;
@@ -3047,17 +3043,17 @@ GeckoDriver.prototype.maximizeWindow = a
   }
 
   const origSize = {
     outerWidth: win.outerWidth,
     outerHeight: win.outerHeight,
   };
 
   // Wait for the window size to change.
-  async function windowSizeChange(from) {
+  async function windowSizeChange() {
     return wait.until((resolve, reject) => {
       let curSize = {
         outerWidth: win.outerWidth,
         outerHeight: win.outerHeight,
       };
       if (curSize.outerWidth != origSize.outerWidth ||
           curSize.outerHeight != origSize.outerHeight) {
         resolve();
@@ -3112,17 +3108,17 @@ GeckoDriver.prototype.maximizeWindow = a
  *
  * @throws {UnsupportedOperationError}
  *     Not available for current application.
  * @throws {NoSuchWindowError}
  *     Top-level browsing context has been discarded.
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
-GeckoDriver.prototype.fullscreenWindow = async function(cmd, resp) {
+GeckoDriver.prototype.fullscreenWindow = async function() {
   assert.firefox();
   const win = assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   if (WindowState.from(win.windowState) == WindowState.Minimized) {
     await restoreWindow(win, this.curBrowser.eventObserver);
   }
 
@@ -3135,30 +3131,30 @@ GeckoDriver.prototype.fullscreenWindow =
 
   return this.curBrowser.rect;
 };
 
 /**
  * Dismisses a currently displayed tab modal, or returns no such alert if
  * no modal is displayed.
  */
-GeckoDriver.prototype.dismissDialog = function(cmd, resp) {
+GeckoDriver.prototype.dismissDialog = function() {
   assert.window(this.getCurrentWindow());
   this._checkIfAlertIsPresent();
 
   let {button0, button1} = this.dialog.ui;
   (button1 ? button1 : button0).click();
   this.dialog = null;
 };
 
 /**
  * Accepts a currently displayed tab modal, or returns no such alert if
  * no modal is displayed.
  */
-GeckoDriver.prototype.acceptDialog = function(cmd, resp) {
+GeckoDriver.prototype.acceptDialog = function() {
   assert.window(this.getCurrentWindow());
   this._checkIfAlertIsPresent();
 
   let {button0} = this.dialog.ui;
   button0.click();
   this.dialog = null;
 };
 
@@ -3188,17 +3184,17 @@ GeckoDriver.prototype.getTextFromDialog 
  * @throws {ElementNotInteractableError}
  *     If the current user prompt is an alert or confirm.
  * @throws {NoSuchAlertError}
  *     If there is no current user prompt.
  * @throws {UnsupportedOperationError}
  *     If the current user prompt is something other than an alert,
  *     confirm, or a prompt.
  */
-GeckoDriver.prototype.sendKeysToDialog = function(cmd, resp) {
+GeckoDriver.prototype.sendKeysToDialog = function(cmd) {
   let win = assert.window(this.getCurrentWindow());
   this._checkIfAlertIsPresent();
 
   // see toolkit/components/prompts/content/commonDialog.js
   let {loginContainer, loginTextbox} = this.dialog.ui;
   if (loginContainer.hidden) {
     throw new ElementNotInteractableError(
         "This prompt does not accept text input");
@@ -3228,17 +3224,17 @@ GeckoDriver.prototype._checkIfAlertIsPre
  * end-up in a non-recoverable state if it hasn't been enabled before.
  *
  * This method is used for custom in application shutdowns via
  * marionette.quit() or marionette.restart(), like File -> Quit.
  *
  * @param {boolean} state
  *     True if the server should accept new socket connections.
  */
-GeckoDriver.prototype.acceptConnections = function(cmd, resp) {
+GeckoDriver.prototype.acceptConnections = function(cmd) {
   assert.boolean(cmd.parameters.value);
   this._server.acceptConnections = cmd.parameters.value;
 };
 
 /**
  * Quits the application with the provided flags.
  *
  * Marionette will stop accepting new connections before ending the
@@ -3308,30 +3304,30 @@ GeckoDriver.prototype.quit = async funct
   });
 
   Services.startup.quit(mode);
 
   resp.body.cause = await quitApplication;
   resp.send();
 };
 
-GeckoDriver.prototype.installAddon = function(cmd, resp) {
+GeckoDriver.prototype.installAddon = function(cmd) {
   assert.firefox();
 
   let path = cmd.parameters.path;
   let temp = cmd.parameters.temporary || false;
   if (typeof path == "undefined" || typeof path != "string" ||
       typeof temp != "boolean") {
     throw InvalidArgumentError();
   }
 
   return addon.install(path, temp);
 };
 
-GeckoDriver.prototype.uninstallAddon = function(cmd, resp) {
+GeckoDriver.prototype.uninstallAddon = function(cmd) {
   assert.firefox();
 
   let id = cmd.parameters.id;
   if (typeof id == "undefined" || typeof id != "string") {
     throw new InvalidArgumentError();
   }
 
   return addon.uninstall(id);
@@ -3461,17 +3457,17 @@ GeckoDriver.prototype.localizeProperty =
   }
 
   resp.body.value = l10n.localizeProperty(urls, id);
 };
 
 /**
  * Initialize the reftest mode
  */
-GeckoDriver.prototype.setupReftest = async function(cmd, resp) {
+GeckoDriver.prototype.setupReftest = async function(cmd) {
   if (this._reftest) {
     throw new UnsupportedOperationError(
         "Called reftest:setup with a reftest session already active");
   }
 
   if (this.context !== Context.CHROME) {
     throw new UnsupportedOperationError(
         "Must set chrome context before running reftests");
@@ -3506,17 +3502,17 @@ GeckoDriver.prototype.runReftest = async
 };
 
 /**
  * End a reftest run.
  *
  * Closes the reftest window (without changing the current window handle),
  * and removes cached canvases.
  */
-GeckoDriver.prototype.teardownReftest = function(cmd, resp) {
+GeckoDriver.prototype.teardownReftest = function() {
   if (!this._reftest) {
     throw new UnsupportedOperationError(
         "Called reftest:teardown before reftest:start");
   }
 
   this._reftest.abort();
   this._reftest = null;
 };
--- a/testing/marionette/element.js
+++ b/testing/marionette/element.js
@@ -919,19 +919,17 @@ element.getPointerInteractablePaintTree 
   let centre = element.getInViewCentrePoint(rects[0], win);
 
   // step 5
   return doc.elementsFromPoint(centre.x, centre.y);
 };
 
 // TODO(ato): Not implemented.
 // In fact, it's not defined in the spec.
-element.isKeyboardInteractable = function(el) {
-  return true;
-};
+element.isKeyboardInteractable = () => true;
 
 /**
  * Attempts to scroll into view |el|.
  *
  * @param {DOMElement} el
  *     Element to scroll into view.
  */
 element.scrollIntoView = function(el) {
--- a/testing/marionette/evaluate.js
+++ b/testing/marionette/evaluate.js
@@ -8,34 +8,31 @@ const {classes: Cc, interfaces: Ci, util
 
 Cu.import("resource://gre/modules/Log.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
 Cu.import("resource://gre/modules/Timer.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 Cu.import("chrome://marionette/content/element.js");
 const {
-  error,
   JavaScriptError,
   ScriptTimeoutError,
   WebDriverError,
 } = Cu.import("chrome://marionette/content/error.js", {});
 
-const logger = Log.repository.getLogger("Marionette");
+const log = Log.repository.getLogger("Marionette");
 
 this.EXPORTED_SYMBOLS = ["evaluate", "sandbox", "Sandboxes"];
 
 const ARGUMENTS = "__webDriverArguments";
 const CALLBACK = "__webDriverCallback";
 const COMPLETE = "__webDriverComplete";
 const DEFAULT_TIMEOUT = 10000; // ms
 const FINISH = "finish";
 const MARIONETTE_SCRIPT_FINISHED = "marionetteScriptFinished";
-const ELEMENT_KEY = "element";
-const W3C_ELEMENT_KEY = "element-6066-11e4-a52e-4f735466cecf";
 
 /** @namespace */
 this.evaluate = {};
 
 /**
  * Evaluate a script in given sandbox.
  *
  * If the option var>directInject</var> is not specified, the script
@@ -287,17 +284,17 @@ evaluate.toJSON = function(obj, seenEls)
 
   // arbitrary objects + files
   let rv = {};
   for (let prop in obj) {
     try {
       rv[prop] = evaluate.toJSON(obj[prop], seenEls);
     } catch (e) {
       if (e.result == Cr.NS_ERROR_NOT_IMPLEMENTED) {
-        logger.debug(`Skipping ${prop}: ${e.message}`);
+        log.debug(`Skipping ${prop}: ${e.message}`);
       } else {
         throw e;
       }
     }
   }
   return rv;
 };
 
--- a/testing/marionette/event.js
+++ b/testing/marionette/event.js
@@ -5,31 +5,22 @@
 /** Provides functionality for creating and sending DOM events. */
 this.event = {};
 
 "use strict";
 /* global content, is */
 
 const {interfaces: Ci, utils: Cu, classes: Cc} = Components;
 
-Cu.import("resource://gre/modules/Log.jsm");
-const logger = Log.repository.getLogger("Marionette");
-
 Cu.import("chrome://marionette/content/element.js");
 const {ElementNotInteractableError} =
     Cu.import("chrome://marionette/content/error.js", {});
 
 this.EXPORTED_SYMBOLS = ["event"];
 
-// must be synchronised with nsIDOMWindowUtils
-const COMPOSITION_ATTR_RAWINPUT = 0x02;
-const COMPOSITION_ATTR_SELECTEDRAWTEXT = 0x03;
-const COMPOSITION_ATTR_CONVERTEDTEXT = 0x04;
-const COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT = 0x05;
-
 // TODO(ato): Document!
 let seenEvent = false;
 
 function getDOMWindowUtils(win) {
   if (!win) {
     win = window;
   }
 
--- a/testing/marionette/interaction.js
+++ b/testing/marionette/interaction.js
@@ -6,17 +6,16 @@
 
 const {utils: Cu} = Components;
 
 Cu.import("chrome://marionette/content/accessibility.js");
 Cu.import("chrome://marionette/content/atom.js");
 const {
   ElementClickInterceptedError,
   ElementNotInteractableError,
-  InvalidArgument,
   InvalidArgumentError,
   InvalidElementStateError,
   pprint,
 } = Cu.import("chrome://marionette/content/error.js", {});
 Cu.import("chrome://marionette/content/element.js");
 Cu.import("chrome://marionette/content/event.js");
 
 Cu.importGlobalProperties(["File"]);
@@ -320,17 +319,17 @@ interaction.selectOption = function(el) 
  *
  * @return {Promise}
  *     Promise is accepted once event queue is flushed, or rejected if
  *     <var>win</var> has closed or been unloaded before the queue can
  *     be flushed.
  */
 interaction.flushEventLoop = async function(win) {
   return new Promise(resolve => {
-    let handleEvent = event => {
+    let handleEvent = () => {
       win.removeEventListener("beforeunload", this);
       resolve();
     };
 
     if (win.closed) {
       resolve();
       return;
     }
--- a/testing/marionette/l10n.js
+++ b/testing/marionette/l10n.js
@@ -10,17 +10,17 @@
  * The localization (https://mzl.la/2eUMjyF) of UI elements in Gecko
  * based applications is done via entities and properties. For static
  * values entities are used, which are located in .dtd files. Whereby for
  * dynamically updated content the values come from .property files. Both
  * types of elements can be identifed via a unique id, and the translated
  * content retrieved.
  */
 
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+const {utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(
     this, "domParser", "@mozilla.org/xmlextras/domparser;1", "nsIDOMParser");
 
 const {NoSuchElementError} =
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -2,22 +2,18 @@
  * 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/. */
 
 /* eslint-env mozilla/frame-script */
 /* global XPCNativeWrapper */
 
 "use strict";
 
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
+const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-const uuidGen = Cc["@mozilla.org/uuid-generator;1"]
-    .getService(Ci.nsIUUIDGenerator);
-const loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
-    .getService(Ci.mozIJSSubScriptLoader);
 const winUtil = content.QueryInterface(Ci.nsIInterfaceRequestor)
     .getInterface(Ci.nsIDOMWindowUtils);
 
 Cu.import("resource://gre/modules/FileUtils.jsm");
 Cu.import("resource://gre/modules/Log.jsm");
 Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
@@ -44,18 +40,16 @@ const {ContentEventObserverService} = Cu
 Cu.import("chrome://marionette/content/interaction.js");
 Cu.import("chrome://marionette/content/legacyaction.js");
 Cu.import("chrome://marionette/content/navigate.js");
 Cu.import("chrome://marionette/content/proxy.js");
 Cu.import("chrome://marionette/content/session.js");
 
 Cu.importGlobalProperties(["URL"]);
 
-let marionetteTestName;
-
 let listenerId = null;  // unique ID of this listener
 let curContainer = {frame: content, shadowRoot: null};
 let previousContainer = null;
 
 const seenEls = new element.Store();
 const SUPPORTED_STRATEGIES = new Set([
   element.Strategy.ClassName,
   element.Strategy.Selector,
@@ -66,60 +60,27 @@ const SUPPORTED_STRATEGIES = new Set([
   element.Strategy.TagName,
   element.Strategy.XPath,
 ]);
 
 let capabilities;
 
 let legacyactions = new legacyaction.Chain(checkForInterrupted);
 
-// the unload handler
-let onunload;
-
-// Flag to indicate whether an async script is currently running or not.
-let asyncTestRunning = false;
-let asyncTestCommandId;
-let asyncTestTimeoutId;
-
-let inactivityTimeoutId = null;
-
-let originalOnError;
-// Send move events about this often
-let EVENT_INTERVAL = 30; // milliseconds
 // last touch for each fingerId
 let multiLast = {};
 
-const asyncChrome = proxy.toChromeAsync({
-  addMessageListener: addMessageListenerId.bind(this),
-  removeMessageListener: removeMessageListenerId.bind(this),
-  sendAsyncMessage: sendAsyncMessage.bind(this),
-});
-const syncChrome = proxy.toChrome(sendSyncMessage.bind(this));
-
 const logger = Log.repository.getLogger("Marionette");
 // Append only once to avoid duplicated output after listener.js gets reloaded
 if (logger.ownAppenders.length == 0) {
   logger.addAppender(new Log.DumpAppender());
 }
 
-const modalHandler = function() {
-  // This gets called on the system app only since it receives the
-  // mozbrowserprompt event
-  sendSyncMessage("Marionette:switchedToFrame",
-      {frameValue: null, storePrevious: true});
-  let isLocal = sendSyncMessage("MarionetteFrame:handleModal", {})[0].value;
-  if (isLocal) {
-    previousContainer = curContainer;
-  }
-  curContainer = {frame: content, shadowRoot: null};
-};
-
 // sandbox storage and name of the current sandbox
 const sandboxes = new Sandboxes(() => curContainer.frame);
-let sandboxName = "default";
 
 const eventObservers = new ContentEventObserverService(
     content, sendAsyncMessage.bind(this));
 
 /**
  * The load listener singleton helps to keep track of active page load
  * activities, and can be used by any command which might cause a navigation
  * to happen. In the specific case of a reload of the frame script it allows
@@ -379,17 +340,17 @@ const loadListener = {
         this.stop();
         sendError(
             new TimeoutError(`Timeout loading page after ${this.timeout}ms`),
             this.commandID);
         break;
     }
   },
 
-  observe(subject, topic, data) {
+  observe(subject, topic) {
     const win = curContainer.frame;
     const winID = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
     const curWinID = win.QueryInterface(Ci.nsIInterfaceRequestor)
         .getInterface(Ci.nsIDOMWindowUtils).outerWindowID;
 
     logger.debug(`Received observer notification "${topic}" for "${winID}"`);
 
     switch (topic) {
@@ -449,17 +410,17 @@ const loadListener = {
     if (loadEventExpected) {
       let startTime = new Date().getTime();
       this.start(commandID, timeout, startTime, true);
     }
 
     return (async () => {
       await trigger();
 
-    })().then(val => {
+    })().then(() => {
       if (!loadEventExpected) {
         sendOk(commandID);
         return;
       }
 
       // If requested setup a timer to detect a possible page load
       if (useUnloadTimer) {
         this.timerPageUnload = Cc["@mozilla.org/timer;1"]
@@ -631,33 +592,33 @@ function newSession(msg) {
   capabilities = session.Capabilities.fromJSON(msg.json);
   resetValues();
 }
 
 /**
  * Puts the current session to sleep, so all listeners are removed except
  * for the 'restart' listener.
  */
-function sleepSession(msg) {
+function sleepSession() {
   deleteSession();
   addMessageListener("Marionette:restart", restart);
 }
 
 /**
  * Restarts all our listeners after this listener was put to sleep
  */
-function restart(msg) {
+function restart() {
   removeMessageListener("Marionette:restart", restart);
   registerSelf();
 }
 
 /**
  * Removes all listeners
  */
-function deleteSession(msg) {
+function deleteSession() {
   removeMessageListenerId("Marionette:newSession", newSession);
   removeMessageListenerId("Marionette:execute", executeFn);
   removeMessageListenerId("Marionette:executeInSandbox", executeInSandboxFn);
   removeMessageListenerId("Marionette:singleTap", singleTapFn);
   removeMessageListenerId("Marionette:performActions", performActionsFn);
   removeMessageListenerId("Marionette:releaseActions", releaseActionsFn);
   removeMessageListenerId("Marionette:actionChain", actionChainFn);
   removeMessageListenerId("Marionette:multiAction", multiActionFn);
--- a/testing/marionette/message.js
+++ b/testing/marionette/message.js
@@ -1,30 +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 {utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Log.jsm");
-
 Cu.import("chrome://marionette/content/assert.js");
 Cu.import("chrome://marionette/content/error.js");
 
 this.EXPORTED_SYMBOLS = [
   "Command",
   "Message",
   "MessageOrigin",
   "Response",
 ];
 
-const logger = Log.repository.getLogger("Marionette");
-
 /**
  * Messages may originate from either the server or the client.
  * Because the remote protocol is full duplex, both endpoints may be the
  * origin of both commands and responses.
  *
  * @enum
  * @see {@link Message}
  */
--- a/testing/marionette/navigate.js
+++ b/testing/marionette/navigate.js
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
+const {utils: Cu} = Components;
 
 Cu.importGlobalProperties(["URL"]);
 
 this.EXPORTED_SYMBOLS = ["navigate"];
 
 /** @namespace */
 this.navigate = {};
 
--- a/testing/marionette/packets.js
+++ b/testing/marionette/packets.js
@@ -385,19 +385,19 @@ function RawPacket(transport, data) {
   Packet.call(this, transport);
   this._data = data;
   this.length = data.length;
   this._done = false;
 }
 
 RawPacket.prototype = Object.create(Packet.prototype);
 
-RawPacket.prototype.read = function(stream) {
-  // This hasn't yet been needed for testing.
-  throw Error("Not implmented.");
+RawPacket.prototype.read = function() {
+  // this has not yet been needed for testing
+  throw new Error("Not implemented");
 };
 
 RawPacket.prototype.write = function(stream) {
   let written = stream.write(this._data, this._data.length);
   this._data = this._data.slice(written);
   this._done = !this._data.length;
 };
 
--- a/testing/marionette/reftest.js
+++ b/testing/marionette/reftest.js
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+const {interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/Log.jsm");
 Cu.import("resource://gre/modules/Preferences.jsm");
 
 Cu.import("chrome://marionette/content/assert.js");
 Cu.import("chrome://marionette/content/capture.js");
 const {InvalidArgumentError} =
     Cu.import("chrome://marionette/content/error.js", {});
--- a/testing/marionette/server.js
+++ b/testing/marionette/server.js
@@ -1,18 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-const {Constructor: CC, classes: Cc, interfaces: Ci, utils: Cu} = Components;
+const {Constructor: CC, interfaces: Ci, utils: Cu} = Components;
 
-const loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
-    .getService(Ci.mozIJSSubScriptLoader);
 const ServerSocket = CC(
     "@mozilla.org/network/server-socket;1",
     "nsIServerSocket",
     "initSpecialConnection");
 
 Cu.import("resource://gre/modules/Log.jsm");
 Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
@@ -455,17 +453,17 @@ server.TCPConnection = class {
     // lookup of commands sent by server to client by message ID
     this.commands_ = new Map();
   }
 
   /**
    * Debugger transport callback that cleans up
    * after a connection is closed.
    */
-  onClosed(reason) {
+  onClosed() {
     this.driver.deleteSession();
     if (this.onclose) {
       this.onclose(this);
     }
   }
 
   /**
    * Callback that receives data packets from the client.
--- a/testing/marionette/session.js
+++ b/testing/marionette/session.js
@@ -3,31 +3,24 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 Cu.importGlobalProperties(["URL"]);
 
-Cu.import("resource://gre/modules/Log.jsm");
 Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
 Cu.import("chrome://marionette/content/assert.js");
-const {
-  error,
-  InvalidArgumentError,
-} = Cu.import("chrome://marionette/content/error.js", {});
+const {InvalidArgumentError} = Cu.import("chrome://marionette/content/error.js", {});
 
 this.EXPORTED_SYMBOLS = ["session"];
 
-const logger = Log.repository.getLogger("Marionette");
-const {pprint} = error;
-
 // Enable testing this module, as Services.appinfo.* is not available
 // in xpcshell tests.
 const appinfo = {name: "<missing>", version: "<missing>"};
 try { appinfo.name = Services.appinfo.name.toLowerCase(); } catch (e) {}
 try { appinfo.version = Services.appinfo.version; } catch (e) {}
 
 /**
  * State associated with a WebDriver session.
--- a/testing/marionette/stream-utils.js
+++ b/testing/marionette/stream-utils.js
@@ -190,17 +190,17 @@ StreamCopier.prototype = {
     this._streamReadyCallback();
   },
 
   // nsIOutputStreamCallback
   onOutputStreamReady() {
     this._streamReadyCallback();
   },
 
-  _debug(msg) {
+  _debug() {
   },
 
 };
 
 /**
  * Read from a stream, one byte at a time, up to the next
  * <var>delimiter</var> character, but stopping if we've read |count|
  * without finding it.  Reading also terminates early if there are less
--- a/testing/marionette/transport.js
+++ b/testing/marionette/transport.js
@@ -1,18 +1,17 @@
 /* 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";
 
 /* global Pipe, ScriptableInputStream, uneval */
 
-const {Constructor: CC, classes: Cc, interfaces: Ci, utils: Cu, results: Cr} =
-    Components;
+const {Constructor: CC, classes: Cc, utils: Cu, results: Cr} = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/EventEmitter.jsm");
 const {StreamUtils} =
     Cu.import("chrome://marionette/content/stream-utils.js", {});
 const {Packet, JSONPacket, BulkPacket} =
     Cu.import("chrome://marionette/content/packets.js", {});
 
--- a/testing/marionette/wait.js
+++ b/testing/marionette/wait.js
@@ -6,16 +6,17 @@
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 const {
   error,
   TimeoutError,
 } = Cu.import("chrome://marionette/content/error.js", {});
 
+/* exported TimedPromise */
 this.EXPORTED_SYMBOLS = ["wait", "TimedPromise"];
 
 /**
  * Poll-waiting utilities.
  *
  * @namespace
  */
 this.wait = {};
@@ -145,17 +146,17 @@ wait.until = function(func, timeout = 20
  *     Timed promise.
  */
 function TimedPromise(fn, {timeout = 1500, throws = TimeoutError} = {}) {
   const timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
 
   return new Promise((resolve, reject) => {
     // Reject only if |throws| is given.  Otherwise it is assumed that
     // the user is OK with the promise timing out.
-    let bail = res => {
+    let bail = () => {
       if (throws !== null) {
         let err = new throws();
         reject(err);
       } else {
         resolve();
       }
     };