Bug 1508992 - Enable ESLint for dom/plugins/test/mochitest (Manual changes). r=Standard8,qdot
authorchampionshuttler <shivams2799@gmail.com>
Wed, 06 Mar 2019 10:27:23 +0000
changeset 520454 2993263a193c4b455915e78f45b03c27b839e075
parent 520453 8c1caae29d7cd9d7d756d29d2d9c8c7ed8e1274c
child 520455 0f706ba8fc8dd215149421cd278f400318e2a37b
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8, qdot
bugs1508992
milestone67.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 1508992 - Enable ESLint for dom/plugins/test/mochitest (Manual changes). r=Standard8,qdot Differential Revision: https://phabricator.services.mozilla.com/D20094
.eslintignore
dom/plugins/test/mochitest/browser_bug1196539.js
dom/plugins/test/mochitest/browser_pluginscroll.js
dom/plugins/test/mochitest/dialog_watcher.js
dom/plugins/test/mochitest/file_bug1245545.js
dom/plugins/test/mochitest/file_bug863792.html
dom/plugins/test/mochitest/hang_test.js
dom/plugins/test/mochitest/hangui_iface.js
dom/plugins/test/mochitest/test_bug1028200-1.html
dom/plugins/test/mochitest/test_bug1028200-2.html
dom/plugins/test/mochitest/test_bug1028200-3.html
dom/plugins/test/mochitest/test_bug1028200-4.html
dom/plugins/test/mochitest/test_bug1028200-5.html
dom/plugins/test/mochitest/test_bug1028200-6.html
dom/plugins/test/mochitest/test_bug1028200-7.html
dom/plugins/test/mochitest/test_bug1245545.html
dom/plugins/test/mochitest/test_bug1307694.html
dom/plugins/test/mochitest/test_bug539565-1.html
dom/plugins/test/mochitest/test_bug539565-2.html
dom/plugins/test/mochitest/test_bug751809.html
dom/plugins/test/mochitest/test_bug777098.html
dom/plugins/test/mochitest/test_bug784131.html
dom/plugins/test/mochitest/test_bug967694.html
dom/plugins/test/mochitest/test_clear_site_data.html
dom/plugins/test/mochitest/test_crashing.html
dom/plugins/test/mochitest/test_hanging.html
dom/plugins/test/mochitest/test_hangui.xul
dom/plugins/test/mochitest/test_hidden_plugin.html
dom/plugins/test/mochitest/test_instance_re-parent.html
dom/plugins/test/mochitest/test_npruntime_npnevaluate.html
dom/plugins/test/mochitest/test_npruntime_npninvoke.html
dom/plugins/test/mochitest/test_npruntime_npninvokedefault.html
dom/plugins/test/mochitest/test_object.html
dom/plugins/test/mochitest/test_painting.html
dom/plugins/test/mochitest/test_pluginstream_err.html
dom/plugins/test/mochitest/test_positioning.html
dom/plugins/test/mochitest/test_src_url_change.html
dom/plugins/test/mochitest/test_visibility.html
--- a/.eslintignore
+++ b/.eslintignore
@@ -184,17 +184,16 @@ dom/media/tests/**
 dom/media/webaudio/**
 dom/media/webspeech/**
 dom/messagechannel/**
 dom/midi/**
 dom/network/**
 dom/payments/**
 dom/performance/**
 dom/permission/**
-dom/plugins/test/mochitest/**
 dom/plugins/test/unit/**
 dom/promise/**
 dom/push/**
 dom/quota/**
 dom/security/test/cors/**
 dom/security/test/csp/**
 dom/security/test/general/**
 dom/security/test/mixedcontentblocker/**
--- a/dom/plugins/test/mochitest/browser_bug1196539.js
+++ b/dom/plugins/test/mochitest/browser_bug1196539.js
@@ -15,17 +15,16 @@ add_task(async function() {
   let result, tabSwitchedPromise;
 
   // We want to make sure that we will paint in cases where we need to. The
   // tab layer cache just gets in the way of measuring that.
   await SpecialPowers.pushPrefEnv({set: [["browser.tabs.remote.tabCacheSize", 0]]});
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
 
-  let testTab = gBrowser.selectedTab;
   let pluginTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, gTestRoot + "plugin_test.html");
   let homeTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:home");
 
   result = await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
     let doc = content.document;
     let plugin = doc.getElementById("testplugin");
     return !!plugin;
   });
--- a/dom/plugins/test/mochitest/browser_pluginscroll.js
+++ b/dom/plugins/test/mochitest/browser_pluginscroll.js
@@ -1,10 +1,12 @@
 var gTestRoot = getRootDirectory(gTestPath).replace("chrome://mochitests/content/", "http://127.0.0.1:8888/");
 
+const {Preferences} = ChromeUtils.import("resource://gre/modules/Preferences.jsm");
+
 /**
  * tests for plugin windows and scroll
  */
 
 function coordinatesRelativeToWindow(aX, aY, aElement) {
   var targetWindow = aElement.ownerGlobal;
   var scale = targetWindow.devicePixelRatio;
   var rect = aElement.getBoundingClientRect();
@@ -51,17 +53,16 @@ add_task(async function() {
 
   if (!pluginHideEnabled) {
     ok(true, "nothing to test, need gfx.e10s.hide-plugins-for-scroll");
     return;
   }
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
 
-  let testTab = gBrowser.selectedTab;
   let pluginTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, gTestRoot + "plugin_test.html");
 
   result = await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
     let doc = content.document;
     let plugin = doc.getElementById("testplugin");
     return !!plugin;
   });
   is(result, true, "plugin is loaded");
@@ -116,17 +117,16 @@ add_task(async function() {
 
   if (!pluginHideEnabled) {
     ok(true, "nothing to test, need gfx.e10s.hide-plugins-for-scroll");
     return;
   }
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
 
-  let testTab = gBrowser.selectedTab;
   let pluginTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, gTestRoot + "plugin_subframe_test.html");
 
   result = await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
     let doc = content.document.getElementById("subframe").contentDocument;
     let plugin = doc.getElementById("testplugin");
     return !!plugin;
   });
   is(result, true, "plugin is loaded");
@@ -178,17 +178,16 @@ add_task(async function() {
 
   if (!pluginHideEnabled) {
     ok(true, "nothing to test, need gfx.e10s.hide-plugins-for-scroll");
     return;
   }
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
 
-  let testTab = gBrowser.selectedTab;
   let pluginTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, gTestRoot + "plugin_test.html");
 
   result = await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
     let doc = content.document;
     let plugin = doc.getElementById("testplugin");
     return !!plugin;
   });
   is(result, true, "plugin is loaded");
@@ -243,17 +242,16 @@ add_task(async function() {
 
   if (!pluginHideEnabled) {
     ok(true, "nothing to test, need gfx.e10s.hide-plugins-for-scroll");
     return;
   }
 
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
 
-  let testTab = gBrowser.selectedTab;
   let pluginTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, gTestRoot + "plugin_subframe_test.html");
 
   result = await ContentTask.spawn(pluginTab.linkedBrowser, null, async function() {
     let doc = content.document.getElementById("subframe").contentDocument;
     let plugin = doc.getElementById("testplugin");
     return !!plugin;
   });
   is(result, true, "plugin is loaded");
--- a/dom/plugins/test/mochitest/dialog_watcher.js
+++ b/dom/plugins/test/mochitest/dialog_watcher.js
@@ -1,17 +1,20 @@
+/* eslint-env mozilla/chrome-worker */
+
 const EVENT_OBJECT_SHOW = 0x8002;
 const EVENT_OBJECT_HIDE = 0x8003;
 const WINEVENT_OUTOFCONTEXT = 0;
 const WINEVENT_SKIPOWNPROCESS = 2;
 const QS_ALLINPUT = 0x04FF;
 const INFINITE = 0xFFFFFFFF;
 const WAIT_OBJECT_0 = 0;
 const WAIT_TIMEOUT = 258;
 const PM_NOREMOVE = 0;
+var user32;
 
 function DialogWatcher(titleText, onDialogStart, onDialogEnd) {
   this.titleText = titleText;
   this.onDialogStart = onDialogStart;
   this.onDialogEnd = onDialogEnd;
 }
 
 DialogWatcher.prototype.init = function() {
@@ -111,16 +114,17 @@ DialogWatcher.prototype.init = function(
 
 DialogWatcher.prototype.getWindowText = function(hwnd) {
   var bufType = ctypes.ArrayType(ctypes.char16_t);
   var buffer = new bufType(256);
 
   if (this.getWindowTextW(hwnd, buffer, buffer.length)) {
     return buffer.readString();
   }
+  return undefined;
 };
 
 DialogWatcher.prototype.processWindowEvents = function(timeout) {
   var onWinEvent = function(self, hook, event, hwnd, idObject, idChild, dwEventThread, dwmsEventTime) {
     var nhwnd = Number(hwnd);
     if (event == EVENT_OBJECT_SHOW) {
       if (nhwnd == self.hwnd) {
         // We've already picked up this event via FindWindow
@@ -142,17 +146,17 @@ DialogWatcher.prototype.processWindowEve
                                                 dwmsEventTime) {
       onWinEvent(self, hook, event, hwnd, idObject, idChild, dwEventThread,
                  dwmsEventTime);
     } );
   var hook = this.setWinEventHook(EVENT_OBJECT_SHOW, EVENT_OBJECT_HIDE,
                                   0, callback, 0, 0,
                                   WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);
   if (!hook) {
-    return;
+    return null;
   }
   // Check if the window is already showing
   var hwnd = this.findWindow(null, this.titleText);
   if (hwnd && hwnd > 0) {
     this.hwnd = Number(hwnd);
     if (this.onDialogStart) {
       this.onDialogStart(this.hwnd);
     }
--- a/dom/plugins/test/mochitest/file_bug1245545.js
+++ b/dom/plugins/test/mochitest/file_bug1245545.js
@@ -1,8 +1,9 @@
+/* eslint-env mozilla/frame-script */
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function getTestPlugin(pluginName) {
   var ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
   var tags = ph.getPluginTags();
@@ -12,10 +13,10 @@ function getTestPlugin(pluginName) {
       return tag;
     }
   }
   return null;
 }
 
 addMessageListener("check-plugin-unload", function(message) {
   var tag = getTestPlugin();
-  var results = sendAsyncMessage("check-plugin-unload", tag.loaded);
+  sendAsyncMessage("check-plugin-unload", tag.loaded);
 });
--- a/dom/plugins/test/mochitest/file_bug863792.html
+++ b/dom/plugins/test/mochitest/file_bug863792.html
@@ -16,29 +16,27 @@ var outerwindow = window;
 var i = document.createElement("iframe");
 i.width = 500;
 i.height = 500;
 var ob = document.body;
 document.body.appendChild(i);
 i.addEventListener("load", function loaded() {
   var id = i.contentDocument;
   var e = id.createElement("embed");
-  var callbackrun = false;
   e.width = 200;
   e.height = 200;
   e.type = "application/x-test";
   e.__defineSetter__("pluginFoundElement", function() {
     window.console.log("pluginFoundElement");
     e.style.display = "none";
     e.clientTop;
     i.removeEventListener("load", loaded);
     ob.removeChild(i);
     id.body.clientTop;
     id.body.removeChild(e);
-    callbackrun = true;
   });
   id.body.appendChild(e);
   e.clientTop;
   e = id = i = ob = null;
   SpecialPowers.forceCC(); SpecialPowers.forceGC();
 });
 </script>
 </body>
--- a/dom/plugins/test/mochitest/hang_test.js
+++ b/dom/plugins/test/mochitest/hang_test.js
@@ -1,10 +1,11 @@
 
 const {parseKeyValuePairsFromFile} = ChromeUtils.import("resource://gre/modules/KeyValueParser.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var success = false;
 var observerFired = false;
 
 var testObserver = {
   idleHang: true,
 
   observe(subject, topic, data) {
@@ -14,19 +15,17 @@ var testObserver = {
     is(data, null, "Checking null data");
     ok((subject instanceof Ci.nsIPropertyBag2), "got Propbag");
     ok((subject instanceof Ci.nsIWritablePropertyBag2), "got writable Propbag");
 
     var pluginId = subject.getPropertyAsAString("pluginDumpID");
     isnot(pluginId, "", "got a non-empty plugin crash id");
 
     // check plugin dump and extra files
-    let directoryService =
-      Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
-    let profD = directoryService.get("ProfD", Ci.nsIFile);
+    let profD = Services.dirsvc.get("ProfD", Ci.nsIFile);
     profD.append("minidumps");
     let pluginDumpFile = profD.clone();
     pluginDumpFile.append(pluginId + ".dmp");
     ok(pluginDumpFile.exists(), "plugin minidump exists");
 
     let pluginExtraFile = profD.clone();
     pluginExtraFile.append(pluginId + ".extra");
     ok(pluginExtraFile.exists(), "plugin extra file exists");
@@ -77,14 +76,12 @@ function onPluginCrashed(aEvent) {
   is(aEvent.pluginName, "Test Plug-in", "got correct plugin name");
   is(typeof aEvent.pluginFilename, "string", "pluginFilename is correct type");
   isnot(aEvent.pluginFilename, "", "got a non-empty filename");
   // The app itself may or may not have decided to submit the report, so
   // allow either true or false here.
   ok("submittedCrashReport" in aEvent, "submittedCrashReport is a property of event");
   is(typeof aEvent.submittedCrashReport, "boolean", "submittedCrashReport is correct type");
 
-  var os = Cc["@mozilla.org/observer-service;1"].
-           getService(Ci.nsIObserverService);
-  os.removeObserver(testObserver, "plugin-crashed");
+  Services.obs.removeObserver(testObserver, "plugin-crashed");
 
   SimpleTest.finish();
 }
--- a/dom/plugins/test/mochitest/hangui_iface.js
+++ b/dom/plugins/test/mochitest/hangui_iface.js
@@ -1,15 +1,19 @@
+/* eslint-env mozilla/chrome-worker */
+
 var user32;
 var sendMessage;
 var getDlgItem;
 var messageBox;
 var watcher;
 
+/* import-globals-from hangui_common.js */
 importScripts("hangui_common.js");
+/* import-globals-from dialog_watcher.js */
 importScripts("dialog_watcher.js");
 
 function initCTypes() {
   if (!user32) {
     user32 = ctypes.open("user32.dll");
   }
   if (!getDlgItem) {
     getDlgItem = user32.declare("GetDlgItem",
--- a/dom/plugins/test/mochitest/test_bug1028200-1.html
+++ b/dom/plugins/test/mochitest/test_bug1028200-1.html
@@ -27,16 +27,17 @@
      * stops it.
      */
     SimpleTest.registerCleanupFunction(() => {
       if (this.document.mozFullScreenElement) {
         let fullScreenChange = promiseFullScreenChange();
         this.document.mozCancelFullScreen();
         return fullScreenChange;
       }
+      return Promise.resolve();
     });
 
     /**
      * Start with a fullscreen element.
      * Then crash the plugin - which is expected to be a child of the full
      * screen element - and therefore exit out of the fullscreen element.
      */
     let load = function testCrashChildPlugin_expectFullScreenElementToBeCancelled() {
--- a/dom/plugins/test/mochitest/test_bug1028200-2.html
+++ b/dom/plugins/test/mochitest/test_bug1028200-2.html
@@ -27,16 +27,17 @@
      * stops it.
      */
     SimpleTest.registerCleanupFunction(() => {
       if (this.document.mozFullScreenElement) {
         let fullScreenChange = promiseFullScreenChange();
         this.document.mozCancelFullScreen();
         return fullScreenChange;
       }
+      return Promise.resolve();
     });
 
     /**
      * Start with a fullscreen element.
      * Then crash the plugin - which is expected to not be a child of the full
      * screen element - and therefore remain in the fullscreen element.
      */
     let load = function testCrashChildPlugin_expectFullScreenElementToRemain() {
--- a/dom/plugins/test/mochitest/test_bug1028200-3.html
+++ b/dom/plugins/test/mochitest/test_bug1028200-3.html
@@ -27,16 +27,17 @@
      * stops it.
      */
     SimpleTest.registerCleanupFunction(() => {
       if (this.document.mozFullScreenElement) {
         let fullScreenChange = promiseFullScreenChange();
         this.document.mozCancelFullScreen();
         return fullScreenChange;
       }
+      return Promise.resolve();
     });
 
     /**
      * Start with a fullscreen element.
      * Then crash the plugin - which is expected to be a child of the full
      * screen element - and therefore exit out of the fullscreen element.
      */
     let load = function testCrashChildPlugin_expectFullScreenElementToBeCancelled() {
--- a/dom/plugins/test/mochitest/test_bug1028200-4.html
+++ b/dom/plugins/test/mochitest/test_bug1028200-4.html
@@ -27,16 +27,17 @@
      * stops it.
      */
     SimpleTest.registerCleanupFunction(() => {
       if (this.document.mozFullScreenElement) {
         let fullScreenChange = promiseFullScreenChange();
         this.document.mozCancelFullScreen();
         return fullScreenChange;
       }
+      return Promise.resolve();
     });
 
     /**
      * Start with a fullscreen element.
      * Then crash the plugin - which is expected to be a child of the full
      * screen element - and therefore exit out of the fullscreen element.
      */
     let load = function testCrashChildPlugin_expectFullScreenElementToBeCancelled() {
--- a/dom/plugins/test/mochitest/test_bug1028200-5.html
+++ b/dom/plugins/test/mochitest/test_bug1028200-5.html
@@ -27,16 +27,17 @@
      * stops it.
      */
     SimpleTest.registerCleanupFunction(() => {
       if (this.document.mozFullScreenElement) {
         let fullScreenChange = promiseFullScreenChange();
         this.document.mozCancelFullScreen();
         return fullScreenChange;
       }
+      return Promise.resolve();
     });
 
     /**
      * Start with a fullscreen element.
      * Then crash the plugin - which is expected to be a child of the full
      * screen element - and therefore exit out of the fullscreen element.
      */
     let load = function testCrashChildPlugin_expectFullScreenElementToBeCancelled() {
--- a/dom/plugins/test/mochitest/test_bug1028200-6.html
+++ b/dom/plugins/test/mochitest/test_bug1028200-6.html
@@ -27,16 +27,17 @@
      * stops it.
      */
     SimpleTest.registerCleanupFunction(() => {
       if (this.document.mozFullScreenElement) {
         let fullScreenChange = promiseFullScreenChange();
         this.document.mozCancelFullScreen();
         return fullScreenChange;
       }
+      return Promise.resolve();
     });
 
     /**
      * Start with a fullscreen element.
      * Then crash the plugin - which is expected to not be a child of the full
      * screen element - and therefore remain in the fullscreen element.
      */
     let load = function testCrashChildPlugin_expectFullScreenElementToRemain() {
--- a/dom/plugins/test/mochitest/test_bug1028200-7.html
+++ b/dom/plugins/test/mochitest/test_bug1028200-7.html
@@ -27,16 +27,17 @@
      * stops it.
      */
     SimpleTest.registerCleanupFunction(() => {
       if (this.document.mozFullScreenElement) {
         let fullScreenChange = promiseFullScreenChange();
         this.document.mozCancelFullScreen();
         return fullScreenChange;
       }
+      return Promise.resolve();
     });
 
     /**
      * Start with a fullscreen element.
      * Then crash the plugin - which is expected to not be a child of the full
      * screen element - and therefore remain in the fullscreen element.
      */
     let load = function testCrashChildPlugin_expectFullScreenElementToRemain() {
--- a/dom/plugins/test/mochitest/test_bug1245545.html
+++ b/dom/plugins/test/mochitest/test_bug1245545.html
@@ -35,17 +35,17 @@
          }
        }
 
        function testChromeUnload(isLoaded) {
          if (!isLoaded) {
            ok(true, "Test plugin unloaded in chrome process");
            SimpleTest.finish();
          } else {
-           var results = script.sendAsyncMessage("check-plugin-unload");
+           script.sendAsyncMessage("check-plugin-unload");
          }
        }
        testContentUnload();
      }
     </script>
     <object id="theplugin" type="application/x-test"></object>
 
   </body>
--- a/dom/plugins/test/mochitest/test_bug1307694.html
+++ b/dom/plugins/test/mochitest/test_bug1307694.html
@@ -19,19 +19,19 @@
      p.setAttribute("salign", "lt");
      document.body.appendChild(p);
      SimpleTest.executeSoon(function() {
       runTests();
      });
    }
 
    function runTests() {
-     p = document.getElementById("plugin1");
+     var p = document.getElementById("plugin1");
      ok(p.setColor != undefined, "Static plugin parameter (salign/scale) ordering were correct");
-     p2 = document.getElementById("plugin2");
+     var p2 = document.getElementById("plugin2");
      ok(p2.setColor != undefined, "Dynamic plugin parameter (salign/scale) ordering were correct");
      SimpleTest.finish();
    }
 
   </script>
   <p id="display"></p>
 
   <div id="div1">
--- a/dom/plugins/test/mochitest/test_bug539565-1.html
+++ b/dom/plugins/test/mochitest/test_bug539565-1.html
@@ -17,22 +17,23 @@ function runTests() {
   function waitForPaint(func) {
     waitedForPaint = 0;
     var testplugin = $("plugin1");
     testplugin.last_paint_count = testplugin.getPaintCount ? testplugin.getPaintCount() : -2;
     function waitForPaintCountIncrement() {
       waitedForPaint++;
       moveBy = -moveBy;
       $("abs").style.left = ($("abs").offsetLeft + moveBy) + "px";
-      var x = document.documentElement.offsetHeight;
+      document.documentElement.offsetHeight;
       var pc = testplugin.getPaintCount ? testplugin.getPaintCount() : -2;
       if (waitedForPaint == 20 || (pc != testplugin.last_paint_count && pc >= 0)) {
         setTimeout(func, 0);
-      } else
+      } else {
         setTimeout(waitForPaintCountIncrement, 50);
+      }
     }
     waitForPaintCountIncrement();
   }
 
   function doClick(x, y, func) {
     synthesizeMouse($("plugin1"), x, y, {}, window);
     setTimeout(func, 0);
   }
--- a/dom/plugins/test/mochitest/test_bug539565-2.html
+++ b/dom/plugins/test/mochitest/test_bug539565-2.html
@@ -17,22 +17,23 @@ function runTests() {
   function waitForPaint(func) {
     waitedForPaint = 0;
     var testplugin = $("plugin1");
     testplugin.last_paint_count = testplugin.getPaintCount ? testplugin.getPaintCount() : -2;
     function waitForPaintCountIncrement() {
       waitedForPaint++;
       moveBy = -moveBy;
       $("abs").style.left = ($("abs").offsetLeft + moveBy) + "px";
-      var x = document.documentElement.offsetHeight;
+      document.documentElement.offsetHeight;
       var pc = testplugin.getPaintCount ? testplugin.getPaintCount() : -2;
       if (waitedForPaint == 20 || (pc != testplugin.last_paint_count && pc >= 0)) {
         setTimeout(func, 0);
-      } else
+      } else {
         setTimeout(waitForPaintCountIncrement, 50);
+      }
     }
     waitForPaintCountIncrement();
   }
 
   function doClick(x, y, func) {
     synthesizeMouse($("plugin1"), x, y, {}, window);
     setTimeout(func, 0);
   }
@@ -71,25 +72,25 @@ function runTests() {
   function test3b() {
     click(208, 212, function() { verify("3b", 104, 106, test4); });
   }
   function test4() { // fullZoom=2 + scale(0.5)
     zoom(2);
     var container = $("container");
     container.style.MozTransformOrigin = "0px 0px";
     container.style.MozTransform = "scale(0.5)";
-    var x = document.documentElement.offsetHeight;
+    document.documentElement.offsetHeight;
     click(60, 52, function() { verify("4", 240, 208, test5); });
   }
   function test5() { // fullZoom=2 + scale(2)
     zoom(2);
     var container = $("container");
     container.style.MozTransformOrigin = "0px 0px";
     container.style.MozTransform = "scale(2)";
-    var x = document.documentElement.offsetHeight;
+    document.documentElement.offsetHeight;
     click(108, 112, function() { verify("5", 108, 112, endTest); });
   }
 
   function endTest() {
     zoom(1);
     SimpleTest.finish();
   }
 
--- a/dom/plugins/test/mochitest/test_bug751809.html
+++ b/dom/plugins/test/mochitest/test_bug751809.html
@@ -42,16 +42,17 @@
   function afterPluginActivation() {
     var plugin = document.getElementById("plugin");
     var objLoadingContent = SpecialPowers.wrap(plugin);
     ok(objLoadingContent.activated, "plugin should be activated now");
 
     // Triggering a paint and waiting for it to be flushed makes sure
     // that both plugin and platform see the plugin element as visible.
     // See bug 805330 for details.
+    /* global waitForAllPaintsFlushed */
     plugin.setColor("FF000088");
     waitForAllPaintsFlushed(afterPaintsFlushed);
   }
 
   function afterPaintsFlushed() {
     var plugin = document.getElementById("plugin");
     try {
       is(plugin.getMouseUpEventCount(), 0, "Plugin should not have received mouse events yet.");
--- a/dom/plugins/test/mochitest/test_bug777098.html
+++ b/dom/plugins/test/mochitest/test_bug777098.html
@@ -22,16 +22,17 @@ setTestPluginEnabledState(SpecialPowers.
 function go() {
   var plugin = document.getElementById("plugin");
 
   // Get wrapped npobject from plugin (plugin.__proto__)
   var val = plugin.getObjectValue();
 
   // Force a re-instantiate by re-setting dummy uri,
   // making val a wrapper for a dead plugin
+  // eslint-disable-next-line no-self-assign
   plugin.data = plugin.data;
 
   // The correct behavior is an exception, if plugin.checkObjectValue succeeds
   // the plugin wasn't torn down for some reason, and if we crash... that's bad
   function pluginCheck() {
     try {
       plugin.checkObjectValue(val);
     } catch (e) {
--- a/dom/plugins/test/mochitest/test_bug784131.html
+++ b/dom/plugins/test/mochitest/test_bug784131.html
@@ -53,33 +53,33 @@
     is(getObjectValue(body_embed), null, "body plugin gone");
     is(getObjectValue(nested_embed), null, "nested plugin gone");
 
     // Restart plugins...
     body_embed.style.display = "inherit";
     nested_parent.style.display = "inherit";
 
     // Ensure plugins are spawned
-    var body_obj = getObjectValue(body_embed);
-    var nested_obj = getObjectValue(nested_embed);
-    isnot(body_obj, null, "body plugin spawned");
-    isnot(nested_obj, null, "nested plugin spawned");
+    var body_objs = getObjectValue(body_embed);
+    var nested_objs = getObjectValue(nested_embed);
+    isnot(body_objs, null, "body plugin spawned");
+    isnot(nested_objs, null, "nested plugin spawned");
 
     // Take away frames again, flush layout, restore frames
     body_embed.style.display = "none";
     nested_parent.style.display = "none";
     body_embed.clientTop;
     nested_embed.clientTop;
     body_embed.style.display = "inherit";
     nested_parent.style.display = "inherit";
     body_embed.clientTop;
     nested_embed.clientTop;
 
     // Spin event loop, ensure plugin remains running
     SimpleTest.executeSoon(function() {
-      ok(body_embed.checkObjectValue(body_obj), "body plugin still running");
-      ok(nested_embed.checkObjectValue(nested_obj), "nested plugin still running");
+      ok(body_embed.checkObjectValue(body_objs), "body plugin still running");
+      ok(nested_embed.checkObjectValue(nested_objs), "nested plugin still running");
       SimpleTest.finish();
     });
   });
 </script>
 </body>
 </html>
--- a/dom/plugins/test/mochitest/test_bug967694.html
+++ b/dom/plugins/test/mochitest/test_bug967694.html
@@ -47,17 +47,17 @@ try {
 } catch (e) {
   thrown = true;
 }
 
 ok(thrown, "Function call should have thrown");
 ok(!spPlugin.hasRunningPlugin, "Plugin should not have spawned");
 
 // Try property access from content
-var hi = plugin._testShouldntExistContent;
+hi = plugin._testShouldntExistContent;
 ok(spPlugin.hasRunningPlugin, "Should've caused plugin to spawn");
 
 // Property set
 recreatePlugin();
 plugin._testShouldntExistContent = 5;
 ok(spPlugin.hasRunningPlugin, "Should've caused plugin to spawn");
 
 // Call test plugin function. Should succeed.
--- a/dom/plugins/test/mochitest/test_clear_site_data.html
+++ b/dom/plugins/test/mochitest/test_clear_site_data.html
@@ -71,97 +71,97 @@
 
       // Clear nothing.
       pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_ALL, 4, {callback() { test1(); }});
     }
     function test1() {
       ok(stored(["foo.com", "bar.com", "baz.com", "qux.com", "quz.com"]),
          "Data stored for sites");
 
-      pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_CACHE, 4, {callback() { test2(); }});
+      pluginHost.clearSiteData(this.pluginTag, null, FLAG_CLEAR_CACHE, 4, {callback() { test2(); }});
     }
     function test2() {
       ok(stored(["foo.com", "bar.com", "baz.com", "qux.com", "quz.com"]),
          "Data stored for sites");
 
       // Clear cache data 5 seconds or older.
-      pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_CACHE, 5, {callback() { test3(); }});
+      pluginHost.clearSiteData(this.pluginTag, null, FLAG_CLEAR_CACHE, 5, {callback() { test3(); }});
     }
     function test3() {
       ok(stored(["foo.com", "bar.com", "baz.com", "quz.com"]),
          "Data stored for sites");
       ok(!stored(["qux.com"]), "Data cleared for qux.com");
       // Clear cache data for foo.com, but leave non-cache data.
-      pluginHost.clearSiteData(pluginTag, "foo.com", FLAG_CLEAR_CACHE, 20, {callback() { test4(); }});
+      pluginHost.clearSiteData(this.pluginTag, "foo.com", FLAG_CLEAR_CACHE, 20, {callback() { test4(); }});
     }
     function test4() {
       ok(stored(["foo.com", "bar.com", "baz.com", "quz.com"]),
          "Data stored for sites");
 
       // Clear all data 7 seconds or older.
-      pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_ALL, 7, {callback() { test5(); }});
+      pluginHost.clearSiteData(this.pluginTag, null, FLAG_CLEAR_ALL, 7, {callback() { test5(); }});
     }
     function test5() {
       ok(stored(["bar.com", "baz.com", "quz.com"]), "Data stored for sites");
       ok(!stored(["foo.com"]), "Data cleared for foo.com");
       ok(!stored(["qux.com"]), "Data cleared for qux.com");
 
       // Clear all cache data.
-      pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_CACHE, 20, {callback() { test6(); }});
+      pluginHost.clearSiteData(this.pluginTag, null, FLAG_CLEAR_CACHE, 20, {callback() { test6(); }});
     }
     function test6() {
       ok(stored(["bar.com", "baz.com"]), "Data stored for sites");
       ok(!stored(["quz.com"]), "Data cleared for quz.com");
 
       // Clear all data for bar.com.
-      pluginHost.clearSiteData(pluginTag, "bar.com", FLAG_CLEAR_ALL, 20, {callback(rv) { test7(rv); }});
+      pluginHost.clearSiteData(this.pluginTag, "bar.com", FLAG_CLEAR_ALL, 20, {callback(rv) { test7(rv); }});
     }
-    function test7(rv) {
+    function test7() {
       ok(stored(["baz.com"]), "Data stored for baz.com");
       ok(!stored(["bar.com"]), "Data cleared for bar.com");
 
       // Disable clearing by age.
       p.setSitesWithDataCapabilities(false);
 
-      pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_ALL, 20, {callback(rv) {
+      pluginHost.clearSiteData(this.pluginTag, null, FLAG_CLEAR_ALL, 20, {callback(rv) {
     is(rv, Cr.NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED);
     test8(rv);
   }});
     }
-    function test8(rv) {
-      pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_CACHE, 20, {callback(rv) {
+    function test8() {
+      pluginHost.clearSiteData(this.pluginTag, null, FLAG_CLEAR_CACHE, 20, {callback(rv) {
     is(rv, Cr.NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED);
     test9(rv);
   }});
     }
-    function test9(rv) {
-      pluginHost.clearSiteData(pluginTag, "baz.com", FLAG_CLEAR_ALL, 20, {callback(rv) {
+    function test9() {
+      pluginHost.clearSiteData(this.pluginTag, "baz.com", FLAG_CLEAR_ALL, 20, {callback(rv) {
     is(rv, Cr.NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED);
     test10(rv);
   }});
     }
-    function test10(rv) {
-      pluginHost.clearSiteData(pluginTag, "baz.com", FLAG_CLEAR_CACHE, 20, {callback(rv) {
+    function test10() {
+      pluginHost.clearSiteData(this.pluginTag, "baz.com", FLAG_CLEAR_CACHE, 20, {callback(rv) {
     is(rv, Cr.NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED);
       test11();
       }});
     }
     function test11() {
       // Clear cache for baz.com and globally for all ages.
-      pluginHost.clearSiteData(pluginTag, "baz.com", FLAG_CLEAR_CACHE, -1, {callback(rv) { test12(); }});
+      pluginHost.clearSiteData(this.pluginTag, "baz.com", FLAG_CLEAR_CACHE, -1, {callback(rv) { test12(); }});
     }
     function test12() {
-      pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_CACHE, -1, {callback(rv) { test13(); }});
+      pluginHost.clearSiteData(this.pluginTag, null, FLAG_CLEAR_CACHE, -1, {callback(rv) { test13(); }});
     }
     function test13() {
       // Check that all of the above were no-ops.
       ok(stored(["baz.com"]), "Data stored for baz.com");
 
       // Clear everything for baz.com.
-      pluginHost.clearSiteData(pluginTag, "baz.com", FLAG_CLEAR_ALL, -1, {callback(rv) { test14(); }});
+      pluginHost.clearSiteData(this.pluginTag, "baz.com", FLAG_CLEAR_ALL, -1, {callback(rv) { test14(); }});
     }
     function test14() {
       ok(!stored(["baz.com"]), "Data cleared for baz.com");
       ok(!stored(null), "All data cleared");
 
       // Set data to test subdomains, IP literals, and 'localhost'-like hosts.
       p.setSitesWithData(
         "foo.com:0:0," +
@@ -170,71 +170,71 @@
         "bar.com:0:0," +
         "[192.168.1.1]:0:0," +
         "localhost:0:0"
       );
       ok(stored(["foo.com", "nonexistent.foo.com", "bar.com", "192.168.1.1", "localhost"]),
          "Data stored for sites");
 
       // Clear data for "foo.com" and its subdomains.
-      pluginHost.clearSiteData(pluginTag, "foo.com", FLAG_CLEAR_ALL, -1, {callback(rv) { test15(); }});
+      pluginHost.clearSiteData(this.pluginTag, "foo.com", FLAG_CLEAR_ALL, -1, {callback(rv) { test15(); }});
     }
     function test15() {
       ok(stored(["bar.com", "192.168.1.1", "localhost"]), "Data stored for sites");
       ok(!stored(["foo.com"]), "Data cleared for foo.com");
       ok(!stored(["bar.foo.com"]), "Data cleared for subdomains of foo.com");
 
       // Clear data for "bar.com" using a subdomain.
-      pluginHost.clearSiteData(pluginTag, "foo.bar.com", FLAG_CLEAR_ALL, -1, {callback(rv) { test16(); }});
+      pluginHost.clearSiteData(this.pluginTag, "foo.bar.com", FLAG_CLEAR_ALL, -1, {callback(rv) { test16(); }});
     }
     function test16() {
       ok(!stored(["bar.com"]), "Data cleared for bar.com");
 
       // Clear data for "192.168.1.1".
-      pluginHost.clearSiteData(pluginTag, "192.168.1.1", FLAG_CLEAR_ALL, -1, {callback(rv) { test17(); }});
+      pluginHost.clearSiteData(this.pluginTag, "192.168.1.1", FLAG_CLEAR_ALL, -1, {callback(rv) { test17(); }});
     }
     function test17() {
       ok(!stored(["192.168.1.1"]), "Data cleared for 192.168.1.1");
 
       // Clear data for "localhost".
-      pluginHost.clearSiteData(pluginTag, "localhost", FLAG_CLEAR_ALL, -1, {callback(rv) { test18(); }});
+      pluginHost.clearSiteData(this.pluginTag, "localhost", FLAG_CLEAR_ALL, -1, {callback(rv) { test18(); }});
     }
     function test18() {
       ok(!stored(null), "All data cleared");
 
       // Set data to test international domains.
       p.setSitesWithData(
         "b\u00FCcher.es:0:0," +
         "b\u00FCcher.uk:0:0," +
         "xn--bcher-kva.NZ:0:0"
       );
         // Check that both the ACE and UTF-8 representations register.
       ok(stored(["b\u00FCcher.es", "xn--bcher-kva.es", "b\u00FCcher.uk", "xn--bcher-kva.uk"]),
          "Data stored for sites");
 
       // Clear data for the UTF-8 version.
-      pluginHost.clearSiteData(pluginTag, "b\u00FCcher.es", FLAG_CLEAR_ALL, -1, {callback(rv) { test19(); }});
+      pluginHost.clearSiteData(this.pluginTag, "b\u00FCcher.es", FLAG_CLEAR_ALL, -1, {callback(rv) { test19(); }});
     }
     function test19() {
       ok(!stored(["b\u00FCcher.es"]), "Data cleared for UTF-8 representation");
       ok(!stored(["xn--bcher-kva.es"]), "Data cleared for ACE representation");
 
       // Clear data for the ACE version.
-      pluginHost.clearSiteData(pluginTag, "xn--bcher-kva.uk", FLAG_CLEAR_ALL, -1, {callback(rv) { test20(); }});
+      pluginHost.clearSiteData(this.pluginTag, "xn--bcher-kva.uk", FLAG_CLEAR_ALL, -1, {callback(rv) { test20(); }});
     }
     function test20() {
       ok(!stored(["b\u00FCcher.uk"]), "Data cleared for UTF-8 representation");
       ok(!stored(["xn--bcher-kva.uk"]), "Data cleared for ACE representation");
 
       // The NPAPI spec requires that the plugin report sites in normalized
       // UTF-8. We do happen to normalize the result anyway, so while that's not
       // strictly required, we test it here.
       ok(stored(["b\u00FCcher.nz", "xn--bcher-kva.nz"]),
          "Data stored for sites");
-      pluginHost.clearSiteData(pluginTag, "b\u00FCcher.nz", FLAG_CLEAR_ALL, -1, {callback(rv) { test21(); }});
+      pluginHost.clearSiteData(this.pluginTag, "b\u00FCcher.nz", FLAG_CLEAR_ALL, -1, {callback(rv) { test21(); }});
     }
     function test21() {
       ok(!stored(["b\u00FCcher.nz"]), "Data cleared for UTF-8 representation");
       ok(!stored(["xn--bcher-kva.nz"]), "Data cleared for ACE representation");
       ok(!stored(null), "All data cleared");
       SimpleTest.finish();
     }
   </script>
--- a/dom/plugins/test/mochitest/test_crashing.html
+++ b/dom/plugins/test/mochitest/test_crashing.html
@@ -36,19 +36,19 @@
     try {
       p.setColor("FFFF0000");
       ok(false, "p.setColor should throw after the plugin crashes");
     } catch (e) {
       ok(true, "p.setColor should throw after the plugin crashes");
     }
 
     window.frameLoaded = function reloaded() {
-      var p = iframe.contentDocument.getElementById("plugin1");
+      var p1 = iframe.contentDocument.getElementById("plugin1");
       try {
-        p.setColor("FF00FF00");
+        p1.setColor("FF00FF00");
         ok(true, "Reloading worked");
       } catch (e) {
         ok(false, "Reloading didn't give us a usable plugin");
       }
       SimpleTest.finish();
     };
 
     iframe.contentWindow.location.reload();
--- a/dom/plugins/test/mochitest/test_hanging.html
+++ b/dom/plugins/test/mochitest/test_hanging.html
@@ -30,19 +30,19 @@
     try {
       p.setColor("FFFF0000");
       ok(false, "p.setColor should throw after the plugin crashes");
     } catch (e) {
       ok(true, "p.setColor should throw after the plugin crashes");
     }
 
     window.frameLoaded = function reloaded() {
-      var p = iframe.contentDocument.getElementById("plugin1");
+      var p1 = iframe.contentDocument.getElementById("plugin1");
       try {
-        p.setColor("FF00FF00");
+        p1.setColor("FF00FF00");
         ok(true, "Reloading worked");
       } catch (e) {
         ok(false, "Reloading didn't give us a usable plugin");
       }
 
       try {
         SpecialPowers.clearUserPref(timeoutPref);
       } catch (e) {
--- a/dom/plugins/test/mochitest/test_hangui.xul
+++ b/dom/plugins/test/mochitest/test_hangui.xul
@@ -21,18 +21,16 @@
 <script class="testbody" type="application/javascript">
 <![CDATA[
 SimpleTest.waitForExplicitFinish();
 SimpleTest.expectChildProcessCrash();
 SpecialPowers.pushPrefEnv({"set": [["security.allow_eval_with_system_principal",
                                     true]]});
 setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-
 const hangUITimeoutPref = "dom.ipc.plugins.hangUITimeoutSecs";
 const hangUIMinDisplayPref = "dom.ipc.plugins.hangUIMinDisplaySecs";
 const timeoutPref = "dom.ipc.plugins.timeoutSecs";
 
 var worker = new ChromeWorker("hangui_iface.js");
 worker.onmessage = function(event) {
   var result = event.data;
   var params = result.params;
--- a/dom/plugins/test/mochitest/test_hidden_plugin.html
+++ b/dom/plugins/test/mochitest/test_hidden_plugin.html
@@ -9,20 +9,19 @@
 <body>
   <script type="application/javascript">
   "use strict";
   {
     SimpleTest.waitForExplicitFinish();
     let ph = SpecialPowers.Cc["@mozilla.org/plugin/host;1"].getService(SpecialPowers.Ci.nsIPluginHost);
     let plugins = ph.getPluginTags();
     let testPluginName = plugins[0].name;
-    let oldPrefVal = null;
     let prefName = "plugins.navigator.hidden_ctp_plugin";
     try {
-      oldPrefVal = SpecialPowers.getCharPref(prefName);
+      SpecialPowers.getCharPref(prefName);
     } catch (ex) {}
     let promise = SpecialPowers.pushPrefEnv({ set: [[prefName, testPluginName]]});
     promise.then(function() {
       for (let i = 0; i < plugins.length; i++) {
         let plugin = plugins[i];
         let newState = (plugin.name == testPluginName ? SpecialPowers.Ci.nsIPluginTag.STATE_CLICKTOPLAY :
                         SpecialPowers.Ci.nsIPluginTag.STATE_DISABLED);
         if (plugin.enabledState != newState) {
--- a/dom/plugins/test/mochitest/test_instance_re-parent.html
+++ b/dom/plugins/test/mochitest/test_instance_re-parent.html
@@ -24,16 +24,17 @@
     runTests(function() {
       // Callback when finished - set plugin to windowed and repeat the tests
 
       info("Repeating tests with wmode=window");
       p.setAttribute("wmode", "window");
       d1.appendChild(p);
 
       // Forces the plugin to be respawned
+      // eslint-disable-next-line no-self-assign
       p.src = p.src;
 
       destroyed = false;
       exceptionThrown = false;
       runTests(function() {
         SimpleTest.finish();
       });
     });
--- a/dom/plugins/test/mochitest/test_npruntime_npnevaluate.html
+++ b/dom/plugins/test/mochitest/test_npruntime_npnevaluate.html
@@ -34,16 +34,17 @@
   function runTests() {
     var tests = [
       ["3", 3],
       ["3 + 3", 6],
       ["'3'", "3"],
       ["function test() { return 3; } test();", 3],
       ["testMe(3)", 6],
       ["testMe(new Object(3))", 6],
+      // eslint-disable-next-line no-new-object
       ["new Object(3)", new Object(3)],
       ["new Array(1, 2, 3, 4)", [1, 2, 3, 4]],
       ["document.getElementById('display')",
           document.getElementById("display")],
       ["encodeURI('a = b')", "a%20=%20b"],
       ["document.getElementById('testdiv').innerHTML = 'Hello world!'",
           "Hello world!"],
       ["function test2() { var x = {a: '1', b: '2'}; return x; } test2();",
--- a/dom/plugins/test/mochitest/test_npruntime_npninvoke.html
+++ b/dom/plugins/test/mochitest/test_npruntime_npninvoke.html
@@ -21,18 +21,18 @@
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   // This function returns all the arguments passed to it, either as a
   // single variable (in the caes of 1 argument), or as an array.
   function returnArgs() {
     if (arguments.length == 1)
       return arguments[0];
-    var arr = new Array();
-    for (i = 0; i < arguments.length; i++) {
+    var arr = [];
+    for (var i = 0; i < arguments.length; i++) {
       arr.push(arguments[i]);
     }
     return arr;
   }
   
   // Same as above but explicitly expects two arguments.
   function returnTwoArgs(arg1, arg2) {
     return [arg1, arg2];
--- a/dom/plugins/test/mochitest/test_npruntime_npninvokedefault.html
+++ b/dom/plugins/test/mochitest/test_npruntime_npninvokedefault.html
@@ -43,28 +43,30 @@
     // Boolean object
     ["Boolean", 0, false],
     ["Boolean", null, false],
     ["Boolean", "", false],
     ["Boolean", false, false],
     ["Boolean", true, true],
     ["Boolean", "true", true],
     ["Boolean", "false", true],
+    /* eslint-disable no-new-wrappers */
     ["Boolean", new Boolean(false), true],
     ["Boolean", { "value": false }, true],
     // Function object
     ["Function", "return 3", Function("return 3")],
     ["Function", "window.alert('test')", Function("window.alert('test')")],
     // Object object
     ["Object", undefined, Object()],
     ["Object", null, Object()],
     ["Object", true, new Boolean(true)],
     ["Object", Boolean(), new Boolean(false)],
     ["Object", "a string", new String("a string")],
     ["Object", 3.14, new Number(3.14)],
+    /* eslint-enable no-new-wrappers */
     ["Object", { "key1": "test", "key2": 15 }, { "key1": "test", "key2": 15 }],
     ["Object", [1, 3, 5, 7, 9, 11, 13, 17], [1, 3, 5, 7, 9, 11, 13, 17]],
     // RegExp object
     ["RegExp", "...", RegExp("...")],
     // String object
     ["String", "testing", "testing"],
     ["String", "test\u0020me", "test me"],
     ["String", "314", "314"],
--- a/dom/plugins/test/mochitest/test_object.html
+++ b/dom/plugins/test/mochitest/test_object.html
@@ -239,17 +239,17 @@ function eachList() {
         displayNone(obj, state) {
     setDisplayed(obj, false);
   },
         displayInherit(obj, state) {
     setDisplayed(obj, true);
   },
       };
 
-
+      // eslint-disable-next-line complexity
       function testObject(obj, state) {
         // If our test combination both sets noChannel but no explicit type
         // it shouldn't load ever.
         let expectedMode = state.expectedMode;
         let actualMode = getMode(obj, state);
 
         if (state.noChannel && !getAttr(obj, "type")) {
           // Some combinations of test both set no type and no channel. This is
@@ -311,17 +311,17 @@ function eachList() {
         let shouldSpawn = shouldBeSpawnable && (!state.loading || state.initialPlugin);
         let didSpawn = runningPlugin(obj, state);
         is(didSpawn, !!shouldSpawn, "check plugin spawned is " + !!shouldSpawn);
 
         // If we are a plugin, scripting should work. If we're not spawned we
         // should spawn synchronously.
         let scripted = false;
         try {
-          let x = obj.getObjectValue();
+          obj.getObjectValue();
           scripted = true;
         } catch (e) {}
         is(scripted, shouldBeSpawnable, "check plugin scriptability");
 
         // If this tag previously had other spawned plugins, make sure it
         // respawned between then and now
         if (state.oldPlugins && didSpawn) {
           let didRespawn = false;
--- a/dom/plugins/test/mochitest/test_painting.html
+++ b/dom/plugins/test/mochitest/test_painting.html
@@ -81,16 +81,17 @@ function done() {
   SimpleTest.finish();
 }
 
 function waitForPaint(func) {
   paint_waiter.last_paint_count = paint_waiter.getPaintCount();
   // Ensure the waiter has had a style change, so that this will
   // change its size and cause a paint.
   paint_waiter.style.backgroundColor = paint_waiter.style.backgroundColor == "blue" ? "yellow" : "blue";
+  // eslint-disable-next-line no-unused-vars
   var flush = paint_waiter.offsetHeight;
   paint_waiter.style.height = "1px";
   waitForPaintHelper(func);
 }
 
 function waitForPaintHelper(func) {
   if (paint_waiter.getPaintCount() != paint_waiter.last_paint_count) {
     // hide the paint waiter
--- a/dom/plugins/test/mochitest/test_pluginstream_err.html
+++ b/dom/plugins/test/mochitest/test_pluginstream_err.html
@@ -122,17 +122,17 @@ function runNextTest() {
 
 function continueTest() {
   // We run each test as an embed and an object, as their initial stream
   // handling differs.
   var tag = index % 2 ? "embed" : "object";
   var test = tests[Math.floor(index / 2)];
 
   var p = gTestWindow.document.createElement("p");
-  p.innerHTML = "Plugin Stream Test " + index;
+  p.textContent = "Plugin Stream Test " + Number(index);
   gTestWindow.document.getElementById("test").appendChild(p);
 
   if (test.frame) {
     var iframe = gTestWindow.document.createElement("iframe");
     iframe.name = test.frame;
     iframe.onload = iframeonload;
     gTestWindow.document.getElementById("test").appendChild(iframe);
   }
--- a/dom/plugins/test/mochitest/test_positioning.html
+++ b/dom/plugins/test/mochitest/test_positioning.html
@@ -33,24 +33,24 @@
       doScroll();
     }, 100);
   }
 
   const kScrollAmount = 1000;
   var startY;
 
   function doScroll() {
-    let [x, y, w, h] = p.getWindowPosition();
+    let y = p.getWindowPosition()[1];
     startY = y;
 
     scrollBy(0, kScrollAmount);
     setTimeout(checkScroll, 500);
   }
 
   function checkScroll() {
-    let [x, y, w, h] = p.getWindowPosition();
+    let y = p.getWindowPosition()[1];
 
     is(y, startY - kScrollAmount, "Window should be informed of its new position.");
     SimpleTest.finish();
   }
   </script>
 
   <embed id="theplugin" type="application/x-test" width="200" height="200"></embed>
--- a/dom/plugins/test/mochitest/test_src_url_change.html
+++ b/dom/plugins/test/mochitest/test_src_url_change.html
@@ -12,17 +12,17 @@
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   var destroyed = false;
   function onDestroy() {
     destroyed = true;
   }
 
   function runTests() {
-    p = document.getElementById("plugin1");
+    var p = document.getElementById("plugin1");
 
     p.startWatchingInstanceCount();
     p.callOnDestroy(onDestroy);
 
     p.setAttribute("src", "loremipsum.txt");
 
     is(destroyed, true, "Instance should have been destroyed.");
     is(p.getInstanceCount(), 1, "One new instance should have been created.");
--- a/dom/plugins/test/mochitest/test_visibility.html
+++ b/dom/plugins/test/mochitest/test_visibility.html
@@ -15,16 +15,18 @@
   <script type="application/javascript" src="plugin-utils.js"></script>
   <script type="application/javascript">
   SimpleTest.waitForExplicitFinish();
   SimpleTest.requestFlakyTimeout("untriaged");
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   var didPaint = function() {};
 
+  var p = null;
+
   function startTest() {
     if (p.getPaintCount() < 1) {
       setTimeout(startTest, 0);
       return;
     }
 
     didPaint = function() {
       ok(false, "Plugin should not paint until it is visible!");