Bug 1508992 - Enable ESLint for dom/plugins/test/mochitest (Automatic changes). r=Standard8,qdot
authorchampionshuttler <shivams2799@gmail.com>
Wed, 06 Mar 2019 08:10:47 +0000
changeset 520453 8c1caae29d7cd9d7d756d29d2d9c8c7ed8e1274c
parent 520452 352a1b792577eb06f743c62c9241634ed3cc7cf0
child 520454 2993263a193c4b455915e78f45b03c27b839e075
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 (Automatic changes). r=Standard8,qdot Differential Revision: https://phabricator.services.mozilla.com/D20093
dom/plugins/test/mochitest/browser_bug1163570.js
dom/plugins/test/mochitest/browser_pluginscroll.js
dom/plugins/test/mochitest/cocoa_focus.html
dom/plugins/test/mochitest/dialog_watcher.js
dom/plugins/test/mochitest/file_bug1245545.js
dom/plugins/test/mochitest/hang_test.js
dom/plugins/test/mochitest/hangui_iface.js
dom/plugins/test/mochitest/head.js
dom/plugins/test/mochitest/plugin-utils.js
dom/plugins/test/mochitest/pluginstream.js
dom/plugins/test/mochitest/test_CrashService_crash.html
dom/plugins/test/mochitest/test_CrashService_hang.html
dom/plugins/test/mochitest/test_NPNVdocumentOrigin.html
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_bug1092842.html
dom/plugins/test/mochitest/test_bug1245545.html
dom/plugins/test/mochitest/test_bug1307694.html
dom/plugins/test/mochitest/test_bug532208.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_bug771202.html
dom/plugins/test/mochitest/test_bug777098.html
dom/plugins/test/mochitest/test_bug813906.html
dom/plugins/test/mochitest/test_bug827160.html
dom/plugins/test/mochitest/test_clear_site_data.html
dom/plugins/test/mochitest/test_copyText.html
dom/plugins/test/mochitest/test_crash_nested_loop.html
dom/plugins/test/mochitest/test_crashing.html
dom/plugins/test/mochitest/test_crashing2.html
dom/plugins/test/mochitest/test_enumerate.html
dom/plugins/test/mochitest/test_hanging.html
dom/plugins/test/mochitest/test_hidden_plugin.html
dom/plugins/test/mochitest/test_instance_re-parent.html
dom/plugins/test/mochitest/test_instance_unparent1.html
dom/plugins/test/mochitest/test_instance_unparent2.html
dom/plugins/test/mochitest/test_instance_unparent3.html
dom/plugins/test/mochitest/test_instantiation.html
dom/plugins/test/mochitest/test_mixed_case_mime.html
dom/plugins/test/mochitest/test_multipleinstanceobjects.html
dom/plugins/test/mochitest/test_newstreamondestroy.html
dom/plugins/test/mochitest/test_npobject_getters.html
dom/plugins/test/mochitest/test_npruntime_construct.html
dom/plugins/test/mochitest/test_npruntime_identifiers.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_plugin_scroll_invalidation.html
dom/plugins/test/mochitest/test_pluginstream_err.html
dom/plugins/test/mochitest/test_pluginstream_referer.html
dom/plugins/test/mochitest/test_pluginstream_src_dynamic.html
dom/plugins/test/mochitest/test_pluginstream_src_referer.html
dom/plugins/test/mochitest/test_positioning.html
dom/plugins/test/mochitest/test_propertyAndMethod.html
dom/plugins/test/mochitest/test_src_url_change.html
dom/plugins/test/mochitest/test_streamNotify.html
dom/plugins/test/mochitest/test_streamatclose.html
dom/plugins/test/mochitest/test_stringHandling.html
dom/plugins/test/mochitest/test_visibility.html
dom/plugins/test/mochitest/test_windowless_flash.html
dom/plugins/test/mochitest/test_windowless_ime.html
dom/plugins/test/mochitest/test_x11_error_crash.html
dom/plugins/test/mochitest/test_zero_opacity.html
--- a/dom/plugins/test/mochitest/browser_bug1163570.js
+++ b/dom/plugins/test/mochitest/browser_bug1163570.js
@@ -1,12 +1,12 @@
 var gTestRoot = getRootDirectory(gTestPath).replace("chrome://mochitests/content/", "http://127.0.0.1:8888/");
 
 // simple tab load helper, pilfered from browser plugin tests
-function promiseTabLoad(tab, url, eventType="load") {
+function promiseTabLoad(tab, url, eventType = "load") {
   return new Promise((resolve) => {
     function handle(event) {
       if (event.originalTarget != tab.linkedBrowser.contentDocument ||
           event.target.location.href == "about:blank" ||
           (url && event.target.location.href != url)) {
         return;
       }
       tab.linkedBrowser.removeEventListener(eventType, handle, true);
@@ -27,17 +27,17 @@ function promiseWaitForEvent(object, eve
       object.removeEventListener(eventName, listener, capturing, chrome);
       resolve(event);
     }
     object.addEventListener(eventName, listener, capturing, chrome);
   });
 }
 
 add_task(async function() {
-  registerCleanupFunction(function () {
+  registerCleanupFunction(function() {
     window.focus();
   });
 });
 
 add_task(async function() {
   setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, "Test Plug-in");
 
   let pluginTab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
--- a/dom/plugins/test/mochitest/browser_pluginscroll.js
+++ b/dom/plugins/test/mochitest/browser_pluginscroll.js
@@ -5,26 +5,26 @@ var gTestRoot = getRootDirectory(gTestPa
  */
 
 function coordinatesRelativeToWindow(aX, aY, aElement) {
   var targetWindow = aElement.ownerGlobal;
   var scale = targetWindow.devicePixelRatio;
   var rect = aElement.getBoundingClientRect();
   return {
     x: targetWindow.mozInnerScreenX + ((rect.left + aX) * scale),
-    y: targetWindow.mozInnerScreenY + ((rect.top + aY) * scale)
+    y: targetWindow.mozInnerScreenY + ((rect.top + aY) * scale),
   };
 }
 
 var apzEnabled = Preferences.get("layers.async-pan-zoom.enabled", false);
 var pluginHideEnabled = Preferences.get("gfx.e10s.hide-plugins-for-scroll", true);
 
 
 add_task(async function() {
-  registerCleanupFunction(function () {
+  registerCleanupFunction(function() {
     setTestPluginEnabledState(Ci.nsIPluginTag.STATE_CLICKTOPLAY, "Test Plug-in");
   });
 });
 
 add_task(async function() {
   await SpecialPowers.pushPrefEnv({
     "set": [
              ["general.smoothScroll", true],
--- a/dom/plugins/test/mochitest/cocoa_focus.html
+++ b/dom/plugins/test/mochitest/cocoa_focus.html
@@ -11,21 +11,21 @@
     }
 
     function ok(aValue, aMessage) {
       window.opener.SimpleTest.ok(aValue, aMessage);
     }
 
     function synthesizeNativeMouseEvent(aX, aY, aNativeMsg, aModifiers, aElement, aCallback) {
       var observer = {
-        observe: function(aSubject, aTopic, aData) {
-          if (aCallback && aTopic == "mouseevent") {
-            aCallback(aData);
-          }
-        }
+        observe(aSubject, aTopic, aData) {
+      if (aCallback && aTopic == "mouseevent") {
+        aCallback(aData);
+      }
+    },
       };
       SpecialPowers.DOMWindowUtils.sendNativeMouseEvent(aX, aY, aNativeMsg, aModifiers, aElement, observer);
       return true;
     }
 
     function* runTests() {
       var utils = SpecialPowers.DOMWindowUtils;
       var scale = utils.screenPixelsPerCSSPixel;
--- a/dom/plugins/test/mochitest/dialog_watcher.js
+++ b/dom/plugins/test/mochitest/dialog_watcher.js
@@ -115,17 +115,17 @@ DialogWatcher.prototype.getWindowText = 
 
   if (this.getWindowTextW(hwnd, buffer, buffer.length)) {
     return buffer.readString();
   }
 };
 
 DialogWatcher.prototype.processWindowEvents = function(timeout) {
   var onWinEvent = function(self, hook, event, hwnd, idObject, idChild, dwEventThread, dwmsEventTime) {
-    var nhwnd = Number(hwnd)
+    var nhwnd = Number(hwnd);
     if (event == EVENT_OBJECT_SHOW) {
       if (nhwnd == self.hwnd) {
         // We've already picked up this event via FindWindow
         return;
       }
       var windowText = self.getWindowText(hwnd);
       if (windowText == self.titleText && self.onDialogStart) {
         self.hwnd = nhwnd;
--- a/dom/plugins/test/mochitest/file_bug1245545.js
+++ b/dom/plugins/test/mochitest/file_bug1245545.js
@@ -10,12 +10,12 @@ function getTestPlugin(pluginName) {
   for (var tag of tags) {
     if (tag.name == name) {
       return tag;
     }
   }
   return null;
 }
 
-addMessageListener('check-plugin-unload', function(message) {
+addMessageListener("check-plugin-unload", function(message) {
   var tag = getTestPlugin();
   var results = sendAsyncMessage("check-plugin-unload", tag.loaded);
 });
--- a/dom/plugins/test/mochitest/hang_test.js
+++ b/dom/plugins/test/mochitest/hang_test.js
@@ -2,21 +2,21 @@
 const {parseKeyValuePairsFromFile} = ChromeUtils.import("resource://gre/modules/KeyValueParser.jsm");
 
 var success = false;
 var observerFired = false;
 
 var testObserver = {
   idleHang: true,
 
-  observe: function(subject, topic, data) {
+  observe(subject, topic, data) {
     observerFired = true;
     ok(true, "Observer fired");
     is(topic, "plugin-crashed", "Checking correct topic");
-    is(data,  null, "Checking null data");
+    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 =
@@ -31,53 +31,47 @@ var testObserver = {
     pluginExtraFile.append(pluginId + ".extra");
     ok(pluginExtraFile.exists(), "plugin extra file exists");
 
     let extraData = parseKeyValuePairsFromFile(pluginExtraFile);
 
     // check additional dumps
 
     ok("additional_minidumps" in extraData, "got field for additional minidumps");
-    let additionalDumps = extraData.additional_minidumps.split(',');
-    ok(additionalDumps.includes('browser'), "browser in additional_minidumps");
+    let additionalDumps = extraData.additional_minidumps.split(",");
+    ok(additionalDumps.includes("browser"), "browser in additional_minidumps");
 
     for (let name of additionalDumps) {
       let file = profD.clone();
       file.append(pluginId + "-" + name + ".dmp");
-      ok(file.exists(), "additional dump '"+name+"' exists");
+      ok(file.exists(), "additional dump '" + name + "' exists");
     }
 
     // check cpu usage field
 
     ok("PluginCpuUsage" in extraData, "got extra field for plugin cpu usage");
-    let cpuUsage = parseFloat(extraData["PluginCpuUsage"]);
+    let cpuUsage = parseFloat(extraData.PluginCpuUsage);
     if (this.idleHang) {
       ok(cpuUsage == 0, "plugin cpu usage is 0%");
     } else {
       ok(cpuUsage > 0, "plugin cpu usage is >0%");
     }
   },
 
-  QueryInterface: function(iid) {
-    if (iid.equals(Ci.nsIObserver) ||
-        iid.equals(Ci.nsISupportsWeakReference) ||
-        iid.equals(Ci.nsISupports))
-      return this;
-    throw Cr.NS_NOINTERFACE;
-  }
+  QueryInterface: ChromeUtils.generateQI(["nsIObserver", "nsISupportsWeakReference"]),
 };
 
 
 function onPluginCrashed(aEvent) {
   ok(true, "Plugin crashed notification received");
   ok(observerFired, "Observer should have fired first");
   is(aEvent.type, "PluginCrashed", "event is correct type");
 
   var pluginElement = document.getElementById("plugin1");
-  is (pluginElement, aEvent.target, "Plugin crashed event target is plugin element");
+  is(pluginElement, aEvent.target, "Plugin crashed event target is plugin element");
 
   ok(aEvent instanceof PluginCrashedEvent,
      "plugin crashed event has the right interface");
 
   is(typeof aEvent.pluginDumpID, "string", "pluginDumpID is correct type");
   isnot(aEvent.pluginDumpID, "", "got a non-empty dump ID");
   is(typeof aEvent.pluginName, "string", "pluginName is correct type");
   is(aEvent.pluginName, "Test Plug-in", "got correct plugin name");
--- a/dom/plugins/test/mochitest/hangui_iface.js
+++ b/dom/plugins/test/mochitest/hangui_iface.js
@@ -107,15 +107,15 @@ self.onmessage = function(event) {
     postFail(params, "Hook failed");
   } else if (!result) {
     if (params.expectToFind) {
       postFail(params, "The dialog didn't show but we were expecting it to");
     } else {
       postSuccess(params);
     }
   }
-}
+};
 
 self.onerror = function(event) {
   var msg = "Error: " + event.message + " at " + event.filename + ":" + event.lineno;
   postFail(null, msg);
 };
 
--- a/dom/plugins/test/mochitest/head.js
+++ b/dom/plugins/test/mochitest/head.js
@@ -79,17 +79,17 @@ function waitScrollStart(aTarget) {
 function waitScrollFinish(aTarget) {
   return new Promise((resolve, reject) => {
     let recent = false;
     let count = 0;
     function listener(event) {
       recent = true;
     }
     aTarget.addEventListener("scroll", listener, true);
-    setInterval(function () {
+    setInterval(function() {
       // one second passed and we didn't receive a scroll event.
       if (!recent) {
         aTarget.removeEventListener("scroll", listener, true);
         resolve();
         return;
       }
       recent = false;
       // ten seconds
--- a/dom/plugins/test/mochitest/plugin-utils.js
+++ b/dom/plugins/test/mochitest/plugin-utils.js
@@ -1,123 +1,118 @@
-function paintCountIs(plugin, expected, msg) {
-  var count = plugin.getPaintCount();
-  var realExpected = expected;
-  ++realExpected; // extra paint at startup for all async-rendering plugins
-  ok(realExpected == count, msg + " (expected " + expected +
-     " independent paints, expected " + realExpected + " logged paints, got " +
-     count + " actual paints)");
-}
-
-function getTestPlugin(pluginName) {
-  var ph = SpecialPowers.Cc["@mozilla.org/plugin/host;1"]
-                                 .getService(SpecialPowers.Ci.nsIPluginHost);
-  var tags = ph.getPluginTags();
-  var name = pluginName || "Test Plug-in";
-  for (var tag of tags) {
-    if (tag.name == name) {
-      return tag;
-    }
-  }
-
-  ok(false, "Could not find plugin tag with plugin name '" + name + "'");
-  return null;
-}
-
-// call this to set the test plugin(s) initially expected enabled state.
-// it will automatically be reset to it's previous value after the test
-// ends
-function setTestPluginEnabledState(newEnabledState, pluginName) {
-  var oldEnabledState = SpecialPowers.setTestPluginEnabledState(newEnabledState, pluginName);
-  var plugin = getTestPlugin(pluginName);
-  // Run a nested event loop to wait for the preference change to
-  // propagate to the child. Yuck!
-  SpecialPowers.Services.tm.spinEventLoopUntil(() => {
-    return plugin.enabledState == newEnabledState;
-  });
-  SimpleTest.registerCleanupFunction(function() {
-    SpecialPowers.setTestPluginEnabledState(oldEnabledState, pluginName);
-  });
-}
-
-function crashAndGetCrashServiceRecord(crashMethodName, callback) {
-  var crashMan =
-    SpecialPowers.Cu.import("resource://gre/modules/Services.jsm").
-    Services.crashmanager;
-
-  // First, clear the crash record store.
-  info("Waiting for pruneOldCrashes");
-  var future = new Date(Date.now() + 1000 * 60 * 60 * 24);
-  crashMan.pruneOldCrashes(future).then(function () {
-
-    var iframe = document.getElementById("iframe1");
-    var p = iframe.contentDocument.getElementById("plugin1");
-
-    var crashDateMS = Date.now();
-    try {
-      p[crashMethodName]();
-      ok(false, "p." + crashMethodName + "() should throw an exception");
-    }
-    catch (e) {
-      ok(true, "p." + crashMethodName + "() should throw an exception");
-    }
-
-    // The crash record store is written and read back asyncly, so poll for
-    // the new record.
-    function tryGetCrash() {
-      info("Waiting for getCrashes");
-      crashMan.getCrashes().then(SpecialPowers.wrapCallback(function (crashes) {
-        if (crashes.length) {
-          is(crashes.length, 1, "There should be only one record");
-          var crash = SpecialPowers.wrap(crashes[0]);
-          ok(!!crash.id, "Record should have an ID");
-          ok(!!crash.crashDate, "Record should have a crash date");
-          var dateMS = crash.crashDate.valueOf();
-          var twoMin = 1000 * 60 * 2;
-          ok(crashDateMS - twoMin <= dateMS &&
-             dateMS <= crashDateMS + twoMin,
-             "Record's crash date should be nowish: " +
-             "now=" + crashDateMS + " recordDate=" + dateMS);
-          callback(crashMan, crash);
-        }
-        else {
-          setTimeout(tryGetCrash, 1000);
-        }
-      }), function (err) {
-        ok(false, "Error getting crashes: " + err);
-        SimpleTest.finish();
-      });
-    }
-    setTimeout(tryGetCrash, 1000);
-
-  }, function () {
-    ok(false, "pruneOldCrashes error");
-    SimpleTest.finish();
-  });
-}
-
-/**
- * Returns a promise which resolves on `mozFullScreenChange`.
- */
-function promiseFullScreenChange(){
-  return new Promise(resolve => {
-    document.addEventListener("fullscreenchange", function(e) {
-      resolve();
-    }, {once: true});
-  });
-}
-
-/**
- * Crashes target plugin. Returns a promise; resolves on successful crash,
- * rejects otherwise.
- * @param plugin  Target plugin to attempt to crash.
- */
-function crashPlugin(plugin) {
-  return new Promise( (resolve, reject) => {
-    try {
-      plugin.crash();
-      reject();
-    }
-    catch (e) {
-      resolve();
-    }
-  });
-}
+function paintCountIs(plugin, expected, msg) {
+  var count = plugin.getPaintCount();
+  var realExpected = expected;
+  ++realExpected; // extra paint at startup for all async-rendering plugins
+  ok(realExpected == count, msg + " (expected " + expected +
+     " independent paints, expected " + realExpected + " logged paints, got " +
+     count + " actual paints)");
+}
+
+function getTestPlugin(pluginName) {
+  var ph = SpecialPowers.Cc["@mozilla.org/plugin/host;1"]
+                                 .getService(SpecialPowers.Ci.nsIPluginHost);
+  var tags = ph.getPluginTags();
+  var name = pluginName || "Test Plug-in";
+  for (var tag of tags) {
+    if (tag.name == name) {
+      return tag;
+    }
+  }
+
+  ok(false, "Could not find plugin tag with plugin name '" + name + "'");
+  return null;
+}
+
+// call this to set the test plugin(s) initially expected enabled state.
+// it will automatically be reset to it's previous value after the test
+// ends
+function setTestPluginEnabledState(newEnabledState, pluginName) {
+  var oldEnabledState = SpecialPowers.setTestPluginEnabledState(newEnabledState, pluginName);
+  var plugin = getTestPlugin(pluginName);
+  // Run a nested event loop to wait for the preference change to
+  // propagate to the child. Yuck!
+  SpecialPowers.Services.tm.spinEventLoopUntil(() => {
+    return plugin.enabledState == newEnabledState;
+  });
+  SimpleTest.registerCleanupFunction(function() {
+    SpecialPowers.setTestPluginEnabledState(oldEnabledState, pluginName);
+  });
+}
+
+function crashAndGetCrashServiceRecord(crashMethodName, callback) {
+  var crashMan =
+    SpecialPowers.Cu.import("resource://gre/modules/Services.jsm").
+    Services.crashmanager;
+
+  // First, clear the crash record store.
+  info("Waiting for pruneOldCrashes");
+  var future = new Date(Date.now() + 1000 * 60 * 60 * 24);
+  crashMan.pruneOldCrashes(future).then(function() {
+    var iframe = document.getElementById("iframe1");
+    var p = iframe.contentDocument.getElementById("plugin1");
+
+    var crashDateMS = Date.now();
+    try {
+      p[crashMethodName]();
+      ok(false, "p." + crashMethodName + "() should throw an exception");
+    } catch (e) {
+      ok(true, "p." + crashMethodName + "() should throw an exception");
+    }
+
+    // The crash record store is written and read back asyncly, so poll for
+    // the new record.
+    function tryGetCrash() {
+      info("Waiting for getCrashes");
+      crashMan.getCrashes().then(SpecialPowers.wrapCallback(function(crashes) {
+        if (crashes.length) {
+          is(crashes.length, 1, "There should be only one record");
+          var crash = SpecialPowers.wrap(crashes[0]);
+          ok(!!crash.id, "Record should have an ID");
+          ok(!!crash.crashDate, "Record should have a crash date");
+          var dateMS = crash.crashDate.valueOf();
+          var twoMin = 1000 * 60 * 2;
+          ok(crashDateMS - twoMin <= dateMS &&
+             dateMS <= crashDateMS + twoMin,
+             "Record's crash date should be nowish: " +
+             "now=" + crashDateMS + " recordDate=" + dateMS);
+          callback(crashMan, crash);
+        } else {
+          setTimeout(tryGetCrash, 1000);
+        }
+      }), function(err) {
+        ok(false, "Error getting crashes: " + err);
+        SimpleTest.finish();
+      });
+    }
+    setTimeout(tryGetCrash, 1000);
+  }, function() {
+    ok(false, "pruneOldCrashes error");
+    SimpleTest.finish();
+  });
+}
+
+/**
+ * Returns a promise which resolves on `mozFullScreenChange`.
+ */
+function promiseFullScreenChange() {
+  return new Promise(resolve => {
+    document.addEventListener("fullscreenchange", function(e) {
+      resolve();
+    }, {once: true});
+  });
+}
+
+/**
+ * Crashes target plugin. Returns a promise; resolves on successful crash,
+ * rejects otherwise.
+ * @param plugin  Target plugin to attempt to crash.
+ */
+function crashPlugin(plugin) {
+  return new Promise( (resolve, reject) => {
+    try {
+      plugin.crash();
+      reject();
+    } catch (e) {
+      resolve();
+    }
+  });
+}
--- a/dom/plugins/test/mochitest/pluginstream.js
+++ b/dom/plugins/test/mochitest/pluginstream.js
@@ -1,36 +1,36 @@
   SimpleTest.waitForExplicitFinish();
 
   function frameLoaded(finishWhenCalled = true, lastObject = false) {
-    var testframe = document.getElementById('testframe');
+    var testframe = document.getElementById("testframe");
     function getNode(list) {
       if (list.length === 0)
         return undefined;
       return lastObject ? list[list.length - 1] : list[0];
     }
-    var embed = getNode(document.getElementsByTagName('embed'));
+    var embed = getNode(document.getElementsByTagName("embed"));
     if (undefined === embed)
-      embed = getNode(document.getElementsByTagName('object'));
+      embed = getNode(document.getElementsByTagName("object"));
 
     // In the file:// URI case, this ends up being cross-origin.
     // Skip these checks in that case.
     if (testframe.contentDocument) {
       var content = testframe.contentDocument.body.innerHTML;
       if (!content.length)
         return;
 
       var filename = embed.getAttribute("src") ||
           embed.getAttribute("geturl") ||
           embed.getAttribute("geturlnotify") ||
           embed.getAttribute("data");
 
       var req = new XMLHttpRequest();
-      req.open('GET', filename, false);
-      req.overrideMimeType('text/plain; charset=x-user-defined');
+      req.open("GET", filename, false);
+      req.overrideMimeType("text/plain; charset=x-user-defined");
       req.send(null);
       is(req.status, 200, "bad XMLHttpRequest status");
       is(content, req.responseText.replace(/\r\n/g, "\n"),
          "content doesn't match");
     }
 
     is(embed.getError(), "pass", "plugin reported error");
     if (finishWhenCalled) {
--- a/dom/plugins/test/mochitest/test_CrashService_crash.html
+++ b/dom/plugins/test/mochitest/test_CrashService_crash.html
@@ -9,20 +9,19 @@
   SimpleTest.requestFlakyTimeout(
     "crashAndGetCrashServiceRecord() polls for async crash recording");
   SimpleTest.requestCompleteLog();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   window.frameLoaded = function frameLoaded_toCrash() {
     SimpleTest.expectChildProcessCrash();
 
-    crashAndGetCrashServiceRecord("crash", function (cm, crash) {
+    crashAndGetCrashServiceRecord("crash", function(cm, crash) {
       var isPluginCrash = crash.isOfType(cm.PROCESS_TYPE_PLUGIN, cm.CRASH_TYPE_CRASH);
       ok(isPluginCrash, "Record should be a plugin crash");
       if (!isPluginCrash) {
         dump("Crash type: " + crash.type + "\n");
       }
       SimpleTest.finish();
     });
-
-  }
+  };
   </script>
   <iframe id="iframe1" src="crashing_subpage.html" width="600" height="600"></iframe>
--- a/dom/plugins/test/mochitest/test_CrashService_hang.html
+++ b/dom/plugins/test/mochitest/test_CrashService_hang.html
@@ -13,16 +13,16 @@
 
   window.frameLoaded = function frameLoaded_toCrash() {
     SimpleTest.expectChildProcessCrash();
 
     // the default timeout is annoying high for mochitest runs
     var timeoutPref = "dom.ipc.plugins.timeoutSecs";
     SpecialPowers.setIntPref(timeoutPref, 5);
 
-    crashAndGetCrashServiceRecord("hang", function (cm, crash) {
+    crashAndGetCrashServiceRecord("hang", function(cm, crash) {
       ok(crash.isOfType(cm.PROCESS_TYPE_PLUGIN, cm.CRASH_TYPE_HANG),
          "Record should be a plugin hang");
       SimpleTest.finish();
     });
-  }
+  };
   </script>
   <iframe id="iframe1" src="crashing_subpage.html" width="600" height="600"></iframe>
--- a/dom/plugins/test/mochitest/test_NPNVdocumentOrigin.html
+++ b/dom/plugins/test/mochitest/test_NPNVdocumentOrigin.html
@@ -17,20 +17,19 @@
       // Test with no modifications
       is(p1.getNPNVdocumentOrigin(), realOrigin, "Checking for expected origin.");
 
       // This used to test that shadowing window.location.toString didn't confuse
       // getNPNVdocumentOrigin. But now we explicitly throw when that happens. So
       // just verify that we throw. There's no reason why getNPNVdocumentOrigin _would_
       // be confused in this case anyway.
       try {
-        window.location.toString = function() { return 'http://victim.rckc.at/'; }
+        window.location.toString = function() { return "http://victim.rckc.at/"; };
         ok(false, "Should throw when shadowing window.location.toString");
-      }
-      catch (e) {
+      } catch (e) {
         ok(true, "Should throw when shadowing window.location.toString");
       }
 
       // Create a plugin in a new window with about:blank
       var newWindow = window.open("about:blank");
       newWindow.onload = function() {
         newWindow.document.writeln('<embed id="plugin2" type="application/x-test" width="200" height="200"></embed>');
         var p2 = newWindow.document.getElementById("plugin2");
--- a/dom/plugins/test/mochitest/test_bug1028200-1.html
+++ b/dom/plugins/test/mochitest/test_bug1028200-1.html
@@ -49,20 +49,20 @@
           "set": [
             ["full-screen-api.allow-trusted-requests-only", false],
             ["full-screen-api.unprefix.enabled", true],
           ],
         });
       });
 
       add_task(async function() {
-        let fullScreenElement = document.getElementById('div1');
-        let plugin = document.getElementById('iframe1')
-          .contentDocument.getElementById('iframe2')
-          .contentDocument.getElementById('plugin1');
+        let fullScreenElement = document.getElementById("div1");
+        let plugin = document.getElementById("iframe1")
+          .contentDocument.getElementById("iframe2")
+          .contentDocument.getElementById("plugin1");
 
         let fullScreenChange = promiseFullScreenChange();
         fullScreenElement.mozRequestFullScreen();
         await fullScreenChange;
         ok(true, "Element is fullscreen");
 
         await crashPlugin(plugin)
           .then(() => {
@@ -80,29 +80,29 @@
          * doesn't.
          */
         await new Promise((resolve, reject) => {
           let timeoutId;
           let onFullScreenChange = () => {
             document.removeEventListener("fullscreenchange", onFullScreenChange);
             clearTimeout(timeoutId);
             resolve();
-          }
+          };
           document.addEventListener("fullscreenchange", onFullScreenChange);
           timeoutId = setTimeout(() => {
             document.removeEventListener("fullscreenchange", onFullScreenChange);
             reject();
           }, 5000);
         })
         .then(() => {
           ok(true, "Element is no longer fullscreen");
         })
         .catch(() => {
           ok(false, "Element is no longer fullscreen");
         });
       });
-    }
+    };
   </script>
 
   <div id="div1">
     <iframe id="iframe1" src="1028200-subpageA.html" height="600" width="600"></iframe>
   </div>
 </body>
--- a/dom/plugins/test/mochitest/test_bug1028200-2.html
+++ b/dom/plugins/test/mochitest/test_bug1028200-2.html
@@ -49,18 +49,18 @@
           "set": [
             ["full-screen-api.allow-trusted-requests-only", false],
             ["full-screen-api.unprefix.enabled", true],
           ],
         });
       });
 
       add_task(async function() {
-        let fullScreenElement = document.getElementById('div1');
-        let plugin = document.getElementById('plugin1');
+        let fullScreenElement = document.getElementById("div1");
+        let plugin = document.getElementById("plugin1");
 
         let fullScreenChange = promiseFullScreenChange();
         fullScreenElement.mozRequestFullScreen();
         await fullScreenChange;
         ok(true, "Element is fullscreen");
 
         await crashPlugin(plugin)
           .then(() => {
@@ -79,28 +79,28 @@
          * test.
          */
         await new Promise((resolve, reject) => {
           let timeoutId;
           let onFullScreenChange = () => {
             document.removeEventListener("fullscreenchange", onFullScreenChange);
             clearTimeout(timeoutId);
             reject();
-          }
+          };
           document.addEventListener("fullscreenchange", onFullScreenChange);
           timeoutId = setTimeout(() => {
             document.removeEventListener("fullscreenchange", onFullScreenChange);
             resolve();
           }, 5000);
         })
         .then(() => {
           ok(true, "Element is still fullscreen");
         })
         .catch(() => {
           ok(false, "Element is still fullscreen");
         });
       });
-    }
+    };
   </script>
 
   <div id="div1"></div>
   <embed id="plugin1" type="application/x-test" />
 </body>
--- a/dom/plugins/test/mochitest/test_bug1028200-3.html
+++ b/dom/plugins/test/mochitest/test_bug1028200-3.html
@@ -49,20 +49,20 @@
           "set": [
             ["full-screen-api.allow-trusted-requests-only", false],
             ["full-screen-api.unprefix.enabled", true],
           ],
         });
       });
 
       add_task(async function() {
-        let fullScreenElement = document.getElementById('iframe1');
-        let plugin = document.getElementById('iframe1')
-             .contentDocument.getElementById('iframe2')
-             .contentDocument.getElementById('plugin1');
+        let fullScreenElement = document.getElementById("iframe1");
+        let plugin = document.getElementById("iframe1")
+             .contentDocument.getElementById("iframe2")
+             .contentDocument.getElementById("plugin1");
 
         let fullScreenChange = promiseFullScreenChange();
         fullScreenElement.mozRequestFullScreen();
         await fullScreenChange;
         ok(true, "Element is fullscreen");
 
         await crashPlugin(plugin)
           .then(() => {
@@ -80,27 +80,27 @@
          * doesn't.
          */
         await new Promise((resolve, reject) => {
           let timeoutId;
           let onFullScreenChange = () => {
             document.removeEventListener("fullscreenchange", onFullScreenChange);
             clearTimeout(timeoutId);
             resolve();
-          }
+          };
           document.addEventListener("fullscreenchange", onFullScreenChange);
           timeoutId = setTimeout(() => {
             document.removeEventListener("fullscreenchange", onFullScreenChange);
             reject();
           }, 5000);
         })
         .then(() => {
           ok(true, "Element is no longer fullscreen");
         })
         .catch(() => {
           ok(false, "Element is no longer fullscreen");
         });
       });
-    }
+    };
   </script>
 
   <iframe id="iframe1" src="1028200-subpageB.html" height="600" width="600"></iframe>
 </body>
--- a/dom/plugins/test/mochitest/test_bug1028200-4.html
+++ b/dom/plugins/test/mochitest/test_bug1028200-4.html
@@ -49,20 +49,20 @@
           "set": [
             ["full-screen-api.allow-trusted-requests-only", false],
             ["full-screen-api.unprefix.enabled", true],
           ],
         });
       });
 
       add_task(async function() {
-        let fullScreenElement = document.getElementById('iframe1');
-        let plugin = document.getElementById('iframe1')
-             .contentDocument.getElementById('iframe2')
-             .contentDocument.getElementById('plugin1');
+        let fullScreenElement = document.getElementById("iframe1");
+        let plugin = document.getElementById("iframe1")
+             .contentDocument.getElementById("iframe2")
+             .contentDocument.getElementById("plugin1");
 
         let fullScreenChange = promiseFullScreenChange();
         fullScreenElement.mozRequestFullScreen();
         await fullScreenChange;
         ok(true, "Element is fullscreen");
 
         await crashPlugin(plugin)
           .then(() => {
@@ -80,27 +80,27 @@
          * doesn't.
          */
         await new Promise((resolve, reject) => {
           let timeoutId;
           let onFullScreenChange = () => {
             document.removeEventListener("fullscreenchange", onFullScreenChange);
             clearTimeout(timeoutId);
             resolve();
-          }
+          };
           document.addEventListener("fullscreenchange", onFullScreenChange);
           timeoutId = setTimeout(() => {
             document.removeEventListener("fullscreenchange", onFullScreenChange);
             reject();
           }, 5000);
         })
         .then(() => {
           ok(true, "Element is no longer fullscreen");
         })
         .catch(() => {
           ok(false, "Element is no longer fullscreen");
         });
       });
-    }
+    };
   </script>
 
   <iframe id="iframe1" src="1028200-subpageB.html" height="600" width="600"></iframe>
 </body>
--- a/dom/plugins/test/mochitest/test_bug1028200-5.html
+++ b/dom/plugins/test/mochitest/test_bug1028200-5.html
@@ -49,18 +49,18 @@
           "set": [
             ["full-screen-api.allow-trusted-requests-only", false],
             ["full-screen-api.unprefix.enabled", true],
           ],
         });
       });
 
       add_task(async function() {
-        let fullScreenElement = document.getElementById('div1');
-        let plugin = document.getElementById('plugin1');
+        let fullScreenElement = document.getElementById("div1");
+        let plugin = document.getElementById("plugin1");
 
         let fullScreenChange = promiseFullScreenChange();
         fullScreenElement.mozRequestFullScreen();
         await fullScreenChange;
         ok(true, "Element is fullscreen");
 
         await crashPlugin(plugin)
           .then(() => {
@@ -78,29 +78,29 @@
          * doesn't.
          */
         await new Promise((resolve, reject) => {
           let timeoutId;
           let onFullScreenChange = () => {
             document.removeEventListener("fullscreenchange", onFullScreenChange);
             clearTimeout(timeoutId);
             resolve();
-          }
+          };
           document.addEventListener("fullscreenchange", onFullScreenChange);
           timeoutId = setTimeout(() => {
             document.removeEventListener("fullscreenchange", onFullScreenChange);
             reject();
           }, 5000);
         })
         .then(() => {
           ok(true, "Element is no longer fullscreen");
         })
         .catch(() => {
           ok(false, "Element is no longer fullscreen");
         });
       });
-    }
+    };
   </script>
 
   <div id="div1">
     <embed id="plugin1" type="application/x-test" />
   </div>
 </body>
--- a/dom/plugins/test/mochitest/test_bug1028200-6.html
+++ b/dom/plugins/test/mochitest/test_bug1028200-6.html
@@ -49,18 +49,18 @@
           "set": [
             ["full-screen-api.allow-trusted-requests-only", false],
             ["full-screen-api.unprefix.enabled", true],
           ],
         });
       });
 
       add_task(async function() {
-        let fullScreenElement = document.getElementById('iframe1');
-        let plugin = document.getElementById('plugin1');
+        let fullScreenElement = document.getElementById("iframe1");
+        let plugin = document.getElementById("plugin1");
 
         let fullScreenChange = promiseFullScreenChange();
         fullScreenElement.mozRequestFullScreen();
         await fullScreenChange;
         ok(true, "Element is fullscreen");
 
         await crashPlugin(plugin)
           .then(() => {
@@ -79,28 +79,28 @@
          * test.
          */
         await new Promise((resolve, reject) => {
           let timeoutId;
           let onFullScreenChange = () => {
             document.removeEventListener("fullscreenchange", onFullScreenChange);
             clearTimeout(timeoutId);
             reject();
-          }
+          };
           document.addEventListener("fullscreenchange", onFullScreenChange);
           timeoutId = setTimeout(() => {
             document.removeEventListener("fullscreenchange", onFullScreenChange);
             resolve();
           }, 5000);
         })
         .then(() => {
           ok(true, "Element is still fullscreen");
         })
         .catch(() => {
           ok(false, "Element is still fullscreen");
         });
       });
-    }
+    };
   </script>
 
   <iframe id="iframe1"></iframe>
   <embed id="plugin1" type="application/x-test" />
 </body>
--- a/dom/plugins/test/mochitest/test_bug1028200-7.html
+++ b/dom/plugins/test/mochitest/test_bug1028200-7.html
@@ -49,20 +49,20 @@
           "set": [
             ["full-screen-api.allow-trusted-requests-only", false],
             ["full-screen-api.unprefix.enabled", true],
           ],
         });
       });
 
       add_task(async function() {
-        let fullScreenElement = document.getElementById('iframeA')
-        let plugin = document.getElementById('iframe1')
-          .contentDocument.getElementById('iframe2')
-          .contentDocument.getElementById('plugin1');
+        let fullScreenElement = document.getElementById("iframeA");
+        let plugin = document.getElementById("iframe1")
+          .contentDocument.getElementById("iframe2")
+          .contentDocument.getElementById("plugin1");
 
         let fullScreenChange = promiseFullScreenChange();
         fullScreenElement.mozRequestFullScreen();
         await fullScreenChange;
         ok(true, "Element is fullscreen");
 
         await crashPlugin(plugin)
           .then(() => {
@@ -81,29 +81,28 @@
          * test.
          */
         await new Promise((resolve, reject) => {
           let timeoutId;
           let onFullScreenChange = () => {
             document.removeEventListener("fullscreenchange", onFullScreenChange);
             clearTimeout(timeoutId);
             reject();
-          }
+          };
           document.addEventListener("fullscreenchange", onFullScreenChange);
           timeoutId = setTimeout(() => {
             document.removeEventListener("fullscreenchange", onFullScreenChange);
             resolve();
           }, 5000);
         })
         .then(() => {
           ok(true, "Element is still fullscreen");
         })
         .catch(() => {
           ok(false, "Element is still fullscreen");
         });
       });
-
-    }
+    };
   </script>
 
   <iframe id="iframeA" src="1028200-subpageC.html" allowfullscreen="true"></iframe>
   <iframe id="iframe1" src="1028200-subpageA.html" height="600" width="600"></iframe>
 </body>
--- a/dom/plugins/test/mochitest/test_bug1092842.html
+++ b/dom/plugins/test/mochitest/test_bug1092842.html
@@ -9,17 +9,17 @@
 <body onload="startTest()">
   <script type="application/javascript">
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   var p = null;
 
   function startTest() {
-    p = document.getElementById('theplugin');
+    p = document.getElementById("theplugin");
     if (!p.hasWidget()) {
       todo(false, "This test is only relevant for windowed plugins");
       SimpleTest.finish();
       return;
     }
 
     // Wait for the plugin to have painted once.
     var interval = setInterval(function() {
@@ -30,18 +30,18 @@
       doTest();
       SimpleTest.finish();
     }, 100);
   }
 
   function doTest() {
     is(p.getClipRegionRectCount(), 1, "getClipRegionRectCount should be a single rect");
     var dpr = window.devicePixelRatio;
-    is(p.getClipRegionRectEdge(0,2) - p.getClipRegionRectEdge(0,0), 100 * dpr, "width of clip region rect");
-    is(p.getClipRegionRectEdge(0,3) - p.getClipRegionRectEdge(0,1), 26 * dpr, "height of clip region rect");
+    is(p.getClipRegionRectEdge(0, 2) - p.getClipRegionRectEdge(0, 0), 100 * dpr, "width of clip region rect");
+    is(p.getClipRegionRectEdge(0, 3) - p.getClipRegionRectEdge(0, 1), 26 * dpr, "height of clip region rect");
   }
   </script>
 
   <div style="position:fixed; z-index:1; left:0; right:0; top:0; height:100px; border-bottom:24px solid blue; background:pink; transform:translateZ(0)"></div>
   <object id="theplugin" type="application/x-test" drawmode="solid" color="ff00ff00" wmode="window"
           style="position:absolute; top:50px; left:0; width:100px; height:100px"></object>
 
   <p id="display"></p>
--- a/dom/plugins/test/mochitest/test_bug1245545.html
+++ b/dom/plugins/test/mochitest/test_bug1245545.html
@@ -7,17 +7,17 @@
     <script type="application/javascript" src="plugin-utils.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   </head>
   <body onload="startTest()">
     <script class="testbody" type="application/javascript">
      SimpleTest.waitForExplicitFinish();
      setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
      SpecialPowers.pushPrefEnv({ "set": [
-       ['dom.ipc.plugins.unloadTimeoutSecs', 0]
+       ["dom.ipc.plugins.unloadTimeoutSecs", 0],
      ] });
 
      function startTest() {
        let url = SimpleTest.getTestFileURL("file_bug1245545.js");
        let script = SpecialPowers.loadChromeScript(url);
        script.addMessageListener("check-plugin-unload", testChromeUnload);
        var testPlugin = getTestPlugin();
        ok(testPlugin, "Should have Test Plug-in");
--- a/dom/plugins/test/mochitest/test_bug1307694.html
+++ b/dom/plugins/test/mochitest/test_bug1307694.html
@@ -7,31 +7,31 @@
 </head>
 <body onLoad="addPluginElement()">
 
   <script type="text/javascript">
    SimpleTest.waitForExplicitFinish();
    SpecialPowers.setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
    function addPluginElement() {
-     var p = document.createElement('embed');
-     p.setAttribute('id', 'plugin2');
-     p.setAttribute('type', 'application/x-shockwave-flash-test');
-     p.setAttribute('scale', 'noscale');
-     p.setAttribute('salign', 'lt');
+     var p = document.createElement("embed");
+     p.setAttribute("id", "plugin2");
+     p.setAttribute("type", "application/x-shockwave-flash-test");
+     p.setAttribute("scale", "noscale");
+     p.setAttribute("salign", "lt");
      document.body.appendChild(p);
      SimpleTest.executeSoon(function() {
       runTests();
      });
    }
 
    function runTests() {
-     p = document.getElementById('plugin1');
+     p = document.getElementById("plugin1");
      ok(p.setColor != undefined, "Static plugin parameter (salign/scale) ordering were correct");
-     p2 = document.getElementById('plugin2');
+     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_bug532208.html
+++ b/dom/plugins/test/mochitest/test_bug532208.html
@@ -10,20 +10,19 @@ src="/tests/SimpleTest/SimpleTest.js"></
 
 <script class="testbody" type="application/javascript">
 SimpleTest.waitForExplicitFinish();
 SimpleTest.requestFlakyTimeout("untriaged");
 setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
 function runTests() {
   try {
-    document.getElementById('plugin1').getPaintCount();
+    document.getElementById("plugin1").getPaintCount();
     ok(true, "Data delivery didn't crash");
-  }
-  catch (e) {
+  } catch (e) {
     ok(false, "Data delivery crashed");
   }
   SimpleTest.finish();
 }
 </script>
 
 <embed id="plugin1" type="application/x-test" width="400"
   height="400" src="large-pic.jpg" functiontofail="npp_write_rpc" streammode="normal"></embed>
--- a/dom/plugins/test/mochitest/test_bug539565-1.html
+++ b/dom/plugins/test/mochitest/test_bug539565-1.html
@@ -16,69 +16,69 @@ function runTests() {
   var waitedForPaint = 0;
   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';
+      $("abs").style.left = ($("abs").offsetLeft + moveBy) + "px";
       var x = document.documentElement.offsetHeight;
       var pc = testplugin.getPaintCount ? testplugin.getPaintCount() : -2;
       if (waitedForPaint == 20 || (pc != testplugin.last_paint_count && pc >= 0)) {
-        setTimeout(func,0);
+        setTimeout(func, 0);
       } else
         setTimeout(waitForPaintCountIncrement, 50);
     }
     waitForPaintCountIncrement();
   }
 
-  function doClick(x,y,func) {
+  function doClick(x, y, func) {
     synthesizeMouse($("plugin1"), x, y, {}, window);
-    setTimeout(func,0);
+    setTimeout(func, 0);
   }
 
-  function verify(test,x,y,next) {
+  function verify(test, x, y, next) {
     var p = $("plugin1").getLastMouseX();
     const delta = 2;
     var dpr = window.devicePixelRatio / SpecialPowers.getFullZoom(window);
-    ok(p-delta <= x * dpr && x * dpr <= p+delta, "test"+test+" LastMouseX got " + p + " expected " + x + 
-                                     " with fullZoom="+SpecialPowers.getFullZoom(window)+" MozTransform='"+$("container").style.MozTransform+"'");
+    ok(p - delta <= x * dpr && x * dpr <= p + delta, "test" + test + " LastMouseX got " + p + " expected " + x +
+                                     " with fullZoom=" + SpecialPowers.getFullZoom(window) + " MozTransform='" + $("container").style.MozTransform + "'");
     p = $("plugin1").getLastMouseY();
-    ok(p-delta <= y * dpr && y * dpr <= p+delta, "test"+test+" LastMouseY got " + p + " expected " + y +
-                                     " with fullZoom="+SpecialPowers.getFullZoom(window)+" MozTransform='"+$("container").style.MozTransform+"'");
+    ok(p - delta <= y * dpr && y * dpr <= p + delta, "test" + test + " LastMouseY got " + p + " expected " + y +
+                                     " with fullZoom=" + SpecialPowers.getFullZoom(window) + " MozTransform='" + $("container").style.MozTransform + "'");
     if (next) next();
   }
 
-  function click(x,y,next) {
-    waitForPaint(function(){doClick(x,y,next);})
+  function click(x, y, next) {
+    waitForPaint(function() { doClick(x, y, next); });
   }
   function zoom(factor) {
     SpecialPowers.setFullZoom(window, factor);
   }
 
   function test1() { // fullZoom=1 (sanity check)
     zoom(1);
-    click(55,136, function(){verify("1",55,136,test2)});
+    click(55, 136, function() { verify("1", 55, 136, test2); });
   }
   function test2() { // fullZoom=2
     zoom(2);
-    click(40,108, function(){verify("2",80,216,test2b)})
+    click(40, 108, function() { verify("2", 80, 216, test2b); });
   }
   function test2b() {
-    click(108,112, function(){verify("2c",216,224,endTest)})
+    click(108, 112, function() { verify("2c", 216, 224, endTest); });
   }
 
   function endTest() {
     zoom(1);
     SimpleTest.finish();
   }
 
-  setTimeout(function(){waitForPaint(test1)},1000);
+  setTimeout(function() { waitForPaint(test1); }, 1000);
 }
 
 SimpleTest.waitForExplicitFinish();
 SimpleTest.requestFlakyTimeout("untriaged");
 setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   </script>
 </head>
--- a/dom/plugins/test/mochitest/test_bug539565-2.html
+++ b/dom/plugins/test/mochitest/test_bug539565-2.html
@@ -16,89 +16,89 @@ function runTests() {
   var waitedForPaint = 0;
   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';
+      $("abs").style.left = ($("abs").offsetLeft + moveBy) + "px";
       var x = document.documentElement.offsetHeight;
       var pc = testplugin.getPaintCount ? testplugin.getPaintCount() : -2;
       if (waitedForPaint == 20 || (pc != testplugin.last_paint_count && pc >= 0)) {
-        setTimeout(func,0);
+        setTimeout(func, 0);
       } else
         setTimeout(waitForPaintCountIncrement, 50);
     }
     waitForPaintCountIncrement();
   }
 
-  function doClick(x,y,func) {
-    synthesizeMouse($("plugin1"), x, y, {}, window); 
-    setTimeout(func,0);
+  function doClick(x, y, func) {
+    synthesizeMouse($("plugin1"), x, y, {}, window);
+    setTimeout(func, 0);
   }
 
-  function verify(test,x,y,next) {
+  function verify(test, x, y, next) {
     var p = $("plugin1").getLastMouseX();
     const delta = 2;
     var dpr = window.devicePixelRatio / SpecialPowers.getFullZoom(window);
-    ok(p-delta <= x * dpr && x * dpr <= p+delta, "test"+test+" LastMouseX got " + p + " expected " + x + 
-                                     " with fullZoom="+SpecialPowers.getFullZoom(window)+" MozTransform='"+$("container").style.MozTransform+"'");
+    ok(p - delta <= x * dpr && x * dpr <= p + delta, "test" + test + " LastMouseX got " + p + " expected " + x +
+                                     " with fullZoom=" + SpecialPowers.getFullZoom(window) + " MozTransform='" + $("container").style.MozTransform + "'");
     p = $("plugin1").getLastMouseY();
-    ok(p-delta <= y * dpr && y * dpr <= p+delta, "test"+test+" LastMouseY got " + p + " expected " + y +
-                                     " with fullZoom="+SpecialPowers.getFullZoom(window)+" MozTransform='"+$("container").style.MozTransform+"'");
+    ok(p - delta <= y * dpr && y * dpr <= p + delta, "test" + test + " LastMouseY got " + p + " expected " + y +
+                                     " with fullZoom=" + SpecialPowers.getFullZoom(window) + " MozTransform='" + $("container").style.MozTransform + "'");
     if (next) next();
   }
 
-  function click(x,y,next) {
-    waitForPaint(function(){doClick(x,y,next);})
+  function click(x, y, next) {
+    waitForPaint(function() { doClick(x, y, next); });
   }
   function zoom(factor) {
     SpecialPowers.setFullZoom(window, factor);
   }
 
   function test3() { // fullZoom=1 + scale(2)
     zoom(1);
     //
     // ======================== BUG WARNING =========================================
     // 'container' already has -moz-transform:scale(2) in its style attribute.
     // Removing that and setting MozTransform dynamically here (as in test4)
     // makes the test fail ("getLastMouseX is not a function" in verify() above)
     // Looks like the plugin instance got destroyed and we never recover from that...
     // ==============================================================================
     //
-    click(50,136, function(){verify("3",25,68,test3b)});
+    click(50, 136, function() { verify("3", 25, 68, test3b); });
   }
   function test3b() {
-    click(208,212, function(){verify("3b",104,106,test4)});
+    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;
-    click(60,52, function(){verify("4",240,208,test5)});
+    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;
-    click(108,112, function(){verify("5",108,112,endTest)});
+    click(108, 112, function() { verify("5", 108, 112, endTest); });
   }
 
   function endTest() {
     zoom(1);
     SimpleTest.finish();
   }
 
-  setTimeout(function(){waitForPaint(test3)},1000);
+  setTimeout(function() { waitForPaint(test3); }, 1000);
 }
 
 SimpleTest.waitForExplicitFinish();
 SimpleTest.requestFlakyTimeout("untriaged");
 setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   </script>
 </head>
--- a/dom/plugins/test/mochitest/test_bug751809.html
+++ b/dom/plugins/test/mochitest/test_bug751809.html
@@ -17,64 +17,64 @@
 
   <script type="application/javascript">
 
   SimpleTest.waitForExplicitFinish();
 
   const utils = window.windowUtils;
 
   function go() {
-    var plugin = document.getElementById('plugin');
+    var plugin = document.getElementById("plugin");
     var objLoadingContent = SpecialPowers.wrap(plugin);
     ok(!objLoadingContent.activated, "plugin should not be activated");
-    
+  
     SimpleTest.waitForFocus(afterWindowFocus);
   }
 
   function afterWindowFocus() {
-    var plugin = document.getElementById('plugin');
+    var plugin = document.getElementById("plugin");
     var objLoadingContent = SpecialPowers.wrap(plugin);
 
     objLoadingContent.playPlugin();
     var condition = () => plugin.setColor !== undefined;
     SimpleTest.waitForCondition(condition, afterPluginActivation,
                                 "Waited too long for plugin to activate");
   }
-    
+  
   function afterPluginActivation() {
-    var plugin = document.getElementById('plugin');
+    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.
     plugin.setColor("FF000088");
     waitForAllPaintsFlushed(afterPaintsFlushed);
   }
 
   function afterPaintsFlushed() {
-    var plugin = document.getElementById('plugin');
+    var plugin = document.getElementById("plugin");
     try {
       is(plugin.getMouseUpEventCount(), 0, "Plugin should not have received mouse events yet.");
-    } catch(e) {
+    } catch (e) {
       ok(false, "plugin.getMouseUpEventCount() shouldn't throw");
     }
 
     synthesizeMouseAtCenter(plugin, {});
     var condition = () => plugin.getMouseUpEventCount() > 0;
     SimpleTest.waitForCondition(condition, afterFirstClick,
                                 "Waited too long for plugin to receive the mouse click");
   }
 
   function afterFirstClick() {
-    var plugin = document.getElementById('plugin');
+    var plugin = document.getElementById("plugin");
     try {
       is(plugin.getMouseUpEventCount(), 1, "Plugin should have received 1 mouse up event.");
-    } catch(e) {
+    } catch (e) {
       ok(false, "plugin.getMouseUpEventCount() shouldn't throw");
     }
 
     Services.prefs.clearUserPref("plugins.click_to_play");
     SimpleTest.finish();
   }
 
   </script>
--- a/dom/plugins/test/mochitest/test_bug771202.html
+++ b/dom/plugins/test/mochitest/test_bug771202.html
@@ -16,23 +16,23 @@ https://bugzilla.mozilla.org/show_bug.cg
 <script type="application/javascript">
 
 /** Test for recreating spliced plugin prototype chains after tranplant. **/
 SimpleTest.waitForExplicitFinish();
 setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
 function go() {
   // Set things up.
-  var win = document.getElementById('ifr').contentWindow;
-  var plugin = win.document.getElementById('pluginElement');
+  var win = document.getElementById("ifr").contentWindow;
+  var plugin = win.document.getElementById("pluginElement");
   var testValue = plugin.getObjectValue();
 
   function checkPlugin() {
       dump("About to call checkObjectValue\n");
-      ok(plugin.checkObjectValue(testValue), 'Plugin proto should work correctly');
+      ok(plugin.checkObjectValue(testValue), "Plugin proto should work correctly");
   }
   // First, check things before transplanting.
   checkPlugin();
 
   // Adopt the plugin and retest.
   document.body.appendChild(plugin);
   checkPlugin();
 
--- a/dom/plugins/test/mochitest/test_bug777098.html
+++ b/dom/plugins/test/mochitest/test_bug777098.html
@@ -15,17 +15,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <pre id="test">
 <script type="application/javascript">
 
 /** Test for passing dead NPObjects back into plugins. **/
 SimpleTest.waitForExplicitFinish();
 setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
 function go() {
-  var plugin = document.getElementById('plugin');
+  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
   plugin.data = plugin.data;
 
@@ -36,17 +36,17 @@ function go() {
       plugin.checkObjectValue(val);
     } catch (e) {
       return true;
     }
     return false;
   }
 
   // Spin the event loop so the instantiation can complete
-  window.setTimeout(function () {
+  window.setTimeout(function() {
     ok(pluginCheck(), "Shouldn't explode");
 
     // All done.
     SimpleTest.finish();
   }, 0);
 }
 
 </script>
--- a/dom/plugins/test/mochitest/test_bug813906.html
+++ b/dom/plugins/test/mochitest/test_bug813906.html
@@ -22,18 +22,18 @@ SimpleTest.requestFlakyTimeout(
   "Blocking an iframe does not cause the onerror event to be fired");
 
 SimpleTest.waitForExplicitFinish();
 setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
 var frameLoadCount = 0;
 
 function frameNavBlocked() {
-  isnot(SpecialPowers.wrap(window.frame1).location.href.indexOf('chrome://'),
-        0, 'plugin shouldnt be able to cause navigation to chrome URLs');
+  isnot(SpecialPowers.wrap(window.frame1).location.href.indexOf("chrome://"),
+        0, "plugin shouldnt be able to cause navigation to chrome URLs");
   SimpleTest.finish();
 }
 
 function frameLoaded() {
   frameLoadCount++;
   if (frameLoadCount == 1) {
     document.getElementsByTagName("object")[0].type = "application/x-test";
     document.getElementsByTagName("use")[0].setAttributeNS("http://www.w3.org/1999/xlink", "href", location.href + "#a");
--- a/dom/plugins/test/mochitest/test_bug827160.html
+++ b/dom/plugins/test/mochitest/test_bug827160.html
@@ -33,17 +33,17 @@ setTestPluginEnabledState(SpecialPowers.
 <object id="shouldNotLoadMissingType" data="data:application/x-test2,foo" typemustmatch></object>
 <!-- Should load, no data field is present  -->
 <object id="shouldLoadMissingData" type="application/x-test" typemustmatch></object>
 <pre id="test">
 
 <script type="application/javascript">
 SimpleTest.waitForExplicitFinish();
 
-window.addEventListener("load", function () {
+window.addEventListener("load", function() {
   const OBJLC = SpecialPowers.Ci.nsIObjectLoadingContent;
   is(SpecialPowers.wrap(document.getElementById("shouldLoad")).displayedType, OBJLC.TYPE_PLUGIN, "Testing object load without type, failed expected load");
   is(SpecialPowers.wrap(document.getElementById("shouldIgnoreType")).displayedType, OBJLC.TYPE_PLUGIN, "Testing object load with type, failed expected load");
   is(SpecialPowers.wrap(document.getElementById("shouldNotLoad")).displayedType, OBJLC.TYPE_NULL, "Testing object load with typemustmatch, load success even though failure expected");
   is(SpecialPowers.wrap(document.getElementById("shouldNotLoadMissingType")).displayedType, OBJLC.TYPE_NULL, "Testing object load with typemustmatch and with type, load success even though failure expected");
   is(SpecialPowers.wrap(document.getElementById("shouldLoadMissingData")).displayedType, OBJLC.TYPE_PLUGIN, "Testing object load with typemustmatch and without data, failed expected load");
   SimpleTest.finish();
 });
--- a/dom/plugins/test/mochitest/test_clear_site_data.html
+++ b/dom/plugins/test/mochitest/test_clear_site_data.html
@@ -61,180 +61,180 @@
         "foo.com:0:5," +
         "foo.com:0:7," +
         "bar.com:0:10," +
         "baz.com:0:10," +
         "foo.com:1:7," +
         "qux.com:1:5," +
         "quz.com:1:8"
       );
-      ok(stored(["foo.com","bar.com","baz.com","qux.com","quz.com"]),
+      ok(stored(["foo.com", "bar.com", "baz.com", "qux.com", "quz.com"]),
          "Data stored for sites");
 
       // Clear nothing.
-      pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_ALL, 4, {callback: function() { test1(); }});
+      pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_ALL, 4, {callback() { test1(); }});
     }
     function test1() {
-      ok(stored(["foo.com","bar.com","baz.com","qux.com","quz.com"]),
+      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: function() { test2(); }});
+      pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_CACHE, 4, {callback() { test2(); }});
     }
     function test2() {
-      ok(stored(["foo.com","bar.com","baz.com","qux.com","quz.com"]),
+      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: function() { test3(); }});
+      pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_CACHE, 5, {callback() { test3(); }});
     }
     function test3() {
-      ok(stored(["foo.com","bar.com","baz.com","quz.com"]),
+      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: function() { test4(); }});
+      pluginHost.clearSiteData(pluginTag, "foo.com", FLAG_CLEAR_CACHE, 20, {callback() { test4(); }});
     }
     function test4() {
-      ok(stored(["foo.com","bar.com","baz.com","quz.com"]),
+      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: function() { test5(); }});
+      pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_ALL, 7, {callback() { test5(); }});
     }
     function test5() {
-      ok(stored(["bar.com","baz.com","quz.com"]), "Data stored for sites");
+      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: function() { test6(); }});
+      pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_CACHE, 20, {callback() { test6(); }});
     }
     function test6() {
-      ok(stored(["bar.com","baz.com"]), "Data stored for sites");
+      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: function(rv) { test7(rv); }});
+      pluginHost.clearSiteData(pluginTag, "bar.com", FLAG_CLEAR_ALL, 20, {callback(rv) { test7(rv); }});
     }
     function test7(rv) {
       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: function(rv) {
-        is(rv, Cr.NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED);
-        test8(rv);
-      }});
+      pluginHost.clearSiteData(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: function(rv) {
-        is(rv, Cr.NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED);
-        test9(rv);
-      }});
+      pluginHost.clearSiteData(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: function(rv) {
-        is(rv, Cr.NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED);
-        test10(rv);
-      }});
+      pluginHost.clearSiteData(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: function(rv) {
-        is(rv, Cr.NS_ERROR_PLUGIN_TIME_RANGE_NOT_SUPPORTED);
-          test11();
-          }});
+      pluginHost.clearSiteData(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: function(rv) { test12()}});
+      pluginHost.clearSiteData(pluginTag, "baz.com", FLAG_CLEAR_CACHE, -1, {callback(rv) { test12(); }});
     }
     function test12() {
-      pluginHost.clearSiteData(pluginTag, null, FLAG_CLEAR_CACHE, -1, {callback: function(rv) { test13()}});
+      pluginHost.clearSiteData(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: function(rv) { test14()}});
+      pluginHost.clearSiteData(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," +
         "bar.foo.com:0:0," +
         "baz.foo.com:0:0," +
         "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"]),
+      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: function(rv) { test15()}});
+      pluginHost.clearSiteData(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(["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: function(rv) { test16()}});
+      pluginHost.clearSiteData(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: function(rv) { test17()}});
+      pluginHost.clearSiteData(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: function(rv) { test18()}});
+      pluginHost.clearSiteData(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"]),
+      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: function(rv) { test19()}});
+      pluginHost.clearSiteData(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: function(rv) { test20()}});
+      pluginHost.clearSiteData(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"]),
+      ok(stored(["b\u00FCcher.nz", "xn--bcher-kva.nz"]),
          "Data stored for sites");
-      pluginHost.clearSiteData(pluginTag, "b\u00FCcher.nz", FLAG_CLEAR_ALL, -1, {callback: function(rv) { test21()}});
+      pluginHost.clearSiteData(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_copyText.html
+++ b/dom/plugins/test/mochitest/test_copyText.html
@@ -2,17 +2,17 @@
 <html>
 <head>
   <title>Test copying text from browser to plugin</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript" src="plugin-utils.js"></script>
 
   <script class="testbody" type="text/javascript">
 function runTests() {
-  var text = " some text \n to copy 'n paste "
+  var text = " some text \n to copy 'n paste ";
   var textElt = document.getElementById("input");
   var plugin = document.getElementById("plugin1");
 
   // Make sure we wait for the clipboard
   SimpleTest.waitForClipboard(text, () => {
     textElt.focus();
     textElt.value = text;
     textElt.select();
--- a/dom/plugins/test/mochitest/test_crash_nested_loop.html
+++ b/dom/plugins/test/mochitest/test_crash_nested_loop.html
@@ -4,18 +4,18 @@
   <script type="application/javascript" src="plugin-utils.js"></script>
 
 <body>
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   window.frameLoaded = function frameLoaded_toCrash() {
-    var iframe = document.getElementById('iframe1');
-    var p = iframe.contentDocument.getElementById('plugin1');
+    var iframe = document.getElementById("iframe1");
+    var p = iframe.contentDocument.getElementById("plugin1");
 
     // This test is for bug 550026, which is inherently nondeterministic.
     // If we hit that bug, the browser process would crash when the plugin
     // crashes in crashInNestedLoop.  If not, we'll pass "spuriously".
     try {
       p.crashInNestedLoop();
       // The plugin didn't crash when expected.  This happens sometimes.  Give
       // it longer to crash.  If it crashes (but not at the apropriate time),
@@ -29,18 +29,16 @@
             ok(false, "plugin should crash");
           } catch (e) {
             todo(false, "p.crashInNestedLoop() should throw an exception");
           }
 
           SimpleTest.finish();
         },
         1000);
-    }
-    catch (e) {
+    } catch (e) {
       ok(true, "p.crashInNestedLoop() should throw an exception");
       SimpleTest.finish();
     }
-
-  }
+  };
 
   </script>
   <iframe id="iframe1" src="crashing_subpage.html" width="600" height="600"></iframe>
--- a/dom/plugins/test/mochitest/test_crashing.html
+++ b/dom/plugins/test/mochitest/test_crashing.html
@@ -6,57 +6,53 @@
 <body>
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   window.frameLoaded = function frameLoaded_toCrash() {
     SimpleTest.expectChildProcessCrash();
 
-    var iframe = document.getElementById('iframe1');
-    var p = iframe.contentDocument.getElementById('plugin1');
+    var iframe = document.getElementById("iframe1");
+    var p = iframe.contentDocument.getElementById("plugin1");
 
     p.setColor("FFFF00FF");
 
     try {
       p.crash();
       ok(false, "p.crash() should throw an exception");
-    }
-    catch (e) {
+    } catch (e) {
       ok(true, "p.crash() should throw an exception");
     }
 
     // Create random identifiers to test bug 560213
     for (var i = 0; i < 5; ++i) {
-      var r = 'rid_' + Math.floor(Math.random() * 10000 + 1);
+      var r = "rid_" + Math.floor(Math.random() * 10000 + 1);
       try {
         ok(!(r in p), "unknown identifier in crashed plugin should fail silently");
-      }
-      catch (e) {
+      } catch (e) {
         ok(false, "unknown identifier check threw");
       }
     }
 
     try {
       p.setColor("FFFF0000");
       ok(false, "p.setColor should throw after the plugin crashes");
-    }
-    catch (e) {
+    } catch (e) {
       ok(true, "p.setColor should throw after the plugin crashes");
     }
 
     window.frameLoaded = function reloaded() {
-      var p = iframe.contentDocument.getElementById('plugin1');
+      var p = iframe.contentDocument.getElementById("plugin1");
       try {
-        p.setColor('FF00FF00');
+        p.setColor("FF00FF00");
         ok(true, "Reloading worked");
-      }
-      catch (e) {
+      } catch (e) {
         ok(false, "Reloading didn't give us a usable plugin");
       }
       SimpleTest.finish();
-    }
+    };
 
     iframe.contentWindow.location.reload();
-  }
+  };
 
   </script>
   <iframe id="iframe1" src="crashing_subpage.html" width="600" height="600"></iframe>
--- a/dom/plugins/test/mochitest/test_crashing2.html
+++ b/dom/plugins/test/mochitest/test_crashing2.html
@@ -5,70 +5,68 @@
 
 <body onload="mainLoaded()">
   <iframe id="iframe1" src="about:blank" width="600" height="600"></iframe>
 
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
-  var iframe = document.getElementById('iframe1');
+  var iframe = document.getElementById("iframe1");
 
   function mainLoaded() {
     SimpleTest.expectChildProcessCrash();
 
-    var p = iframe.contentDocument.createElement('embed');
-    p.setAttribute('id', 'plugin1');
-    p.setAttribute('type', 'application/x-test');
-    p.setAttribute('width', '400');
-    p.setAttribute('height', '400');
-    p.setAttribute('drawmode', 'solid');
-    p.setAttribute('color', 'FF00FFFF');
-    p.setAttribute('newCrash', 'true');
+    var p = iframe.contentDocument.createElement("embed");
+    p.setAttribute("id", "plugin1");
+    p.setAttribute("type", "application/x-test");
+    p.setAttribute("width", "400");
+    p.setAttribute("height", "400");
+    p.setAttribute("drawmode", "solid");
+    p.setAttribute("color", "FF00FFFF");
+    p.setAttribute("newCrash", "true");
     iframe.contentDocument.body.appendChild(p);
 
     // The plugin will now crash when it is instantiated, but
     // that happens asynchronously. HACK: this should use an
     // event instead of nested pending runnables, but I don't
     // know of any DOM event that's fired when a plugin is
     // instantiated.
     SimpleTest.executeSoon(function() {
       SimpleTest.executeSoon(function() {
         ok(p.setColor === undefined,
            "Plugin should have crashed on creation");
 
         window.frameLoaded = reloaded1;
-        iframe.contentWindow.location.replace('crashing_subpage.html');
-      })
+        iframe.contentWindow.location.replace("crashing_subpage.html");
+      });
     });
   }
 
   function reloaded1() {
-    var p = iframe.contentDocument.getElementById('plugin1');
+    var p = iframe.contentDocument.getElementById("plugin1");
     try {
-      p.setColor('FF00FF00');
+      p.setColor("FF00FF00");
       ok(true, "Reloading after crash-on-new worked");
-    }
-    catch (e) {
+    } catch (e) {
       ok(false, "Reloading after crash-on-new didn't give us a usable plugin");
     }
     p.crashOnDestroy();
     // the child crash should happen here
     p.remove();
 
     window.frameLoaded = reloaded2;
     SimpleTest.executeSoon(function() {
       iframe.contentWindow.location.reload();
     });
   }
 
   function reloaded2() {
-    var p = iframe.contentDocument.getElementById('plugin1');
+    var p = iframe.contentDocument.getElementById("plugin1");
     try {
-      p.setColor('FF00FF00');
+      p.setColor("FF00FF00");
       ok(true, "Reloading after crash-on-destroy worked");
-    }
-    catch (e) {
+    } catch (e) {
       ok(false, "Reloading after crash-on-destroy didn't give us a usable plugin");
     }
     SimpleTest.finish();
   }
   </script>
--- a/dom/plugins/test/mochitest/test_enumerate.html
+++ b/dom/plugins/test/mochitest/test_enumerate.html
@@ -15,17 +15,17 @@
 
     function runTests() {
       var pluginElement = document.getElementById("plugin1");
       var c = 0;
       var foundSetColor = false;
       for (var n in pluginElement) {
         ++c;
         ok(n in pluginElement, "Enumerated property which doesn't exist?");
-        if (n == 'setColor')
+        if (n == "setColor")
           foundSetColor = true;
       }
       ok(c > 0, "Should have enumerated some properties");
       ok(foundSetColor, "Should have enumerated .setColor");
       SimpleTest.finish();
     }
   </script>
 
--- a/dom/plugins/test/mochitest/test_hanging.html
+++ b/dom/plugins/test/mochitest/test_hanging.html
@@ -10,54 +10,50 @@
 
   window.frameLoaded = function frameLoaded_toCrash() {
     SimpleTest.expectChildProcessCrash();
 
     // the default timeout is annoying high for mochitest runs
     var timeoutPref = "dom.ipc.plugins.timeoutSecs";
     SpecialPowers.setIntPref(timeoutPref, 5);
 
-    var iframe = document.getElementById('iframe1');
-    var p = iframe.contentDocument.getElementById('plugin1');
+    var iframe = document.getElementById("iframe1");
+    var p = iframe.contentDocument.getElementById("plugin1");
 
     p.setColor("FFFF00FF");
 
     try {
       p.hang();
       ok(false, "p.hang() should throw an exception");
-    }
-    catch (e) {
+    } catch (e) {
       ok(true, "p.hang() should throw an exception");
     }
 
     try {
       p.setColor("FFFF0000");
       ok(false, "p.setColor should throw after the plugin crashes");
-    }
-    catch (e) {
+    } catch (e) {
       ok(true, "p.setColor should throw after the plugin crashes");
     }
 
     window.frameLoaded = function reloaded() {
-      var p = iframe.contentDocument.getElementById('plugin1');
+      var p = iframe.contentDocument.getElementById("plugin1");
       try {
-        p.setColor('FF00FF00');
+        p.setColor("FF00FF00");
         ok(true, "Reloading worked");
-      }
-      catch (e) {
+      } catch (e) {
         ok(false, "Reloading didn't give us a usable plugin");
       }
 
       try {
         SpecialPowers.clearUserPref(timeoutPref);
-      }
-      catch(e) {
+      } catch (e) {
         ok(false, "Couldn't reset timeout pref");
       }
 
       SimpleTest.finish();
-    }
+    };
 
     iframe.contentWindow.location.reload();
-  }
+  };
 
   </script>
   <iframe id="iframe1" src="crashing_subpage.html" width="600" height="600"></iframe>
--- a/dom/plugins/test/mochitest/test_hidden_plugin.html
+++ b/dom/plugins/test/mochitest/test_hidden_plugin.html
@@ -3,17 +3,17 @@
 <head>
   <title>Test whether we are adding the dummy plugin correctly when there is only 1 plugin and its hidden</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript" src="plugin-utils.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
 <body>
   <script type="application/javascript">
-  "use strict"
+  "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 {
--- a/dom/plugins/test/mochitest/test_instance_re-parent.html
+++ b/dom/plugins/test/mochitest/test_instance_re-parent.html
@@ -28,17 +28,17 @@
       p.setAttribute("wmode", "window");
       d1.appendChild(p);
 
       // Forces the plugin to be respawned
       p.src = p.src;
 
       destroyed = false;
       exceptionThrown = false;
-      runTests(function () {
+      runTests(function() {
         SimpleTest.finish();
       });
     });
   }
 
   function checkPluginStopped(callback, param) {
     if (numCheckPluginStoppedAttempts < MAX_CHECK_PLUGIN_STOPPED_ATTEMPTS &&
         !destroyed) {
@@ -49,19 +49,19 @@
     } else {
       info("Number of check plugin stopped attempts: " +
            numCheckPluginStoppedAttempts);
       callback(param);
     }
   }
 
   function runTests(callback) {
-    p = document.getElementById('plugin1');
-    d1 = document.getElementById('div1');
-    d2 = document.getElementById('div2');
+    p = document.getElementById("plugin1");
+    d1 = document.getElementById("div1");
+    d2 = document.getElementById("div2");
 
     // First tests involve moving the instance from one div to another.
     p.startWatchingInstanceCount();
     p.callOnDestroy(function() {
       destroyed = true;
     });
 
     try {
--- a/dom/plugins/test/mochitest/test_instance_unparent1.html
+++ b/dom/plugins/test/mochitest/test_instance_unparent1.html
@@ -27,18 +27,18 @@
     } else {
       info("Number of retry attempts: " + attempts);
       is(destroyed, true, "Plugin instance should have been destroyed.");
       SimpleTest.finish();
     }
   }
 
   function startTest() {
-    var p1 = document.getElementById('plugin1');
-    var d1 = document.getElementById('div1');
+    var p1 = document.getElementById("plugin1");
+    var d1 = document.getElementById("div1");
 
     p1.callOnDestroy(onDestroy);
     d1.removeChild(p1);
     SimpleTest.executeSoon(checkPluginAlreadyDestroyed);
   }
   </script>
 
   <p id="display"></p>
--- a/dom/plugins/test/mochitest/test_instance_unparent2.html
+++ b/dom/plugins/test/mochitest/test_instance_unparent2.html
@@ -27,18 +27,18 @@
     } else {
       info("Number of retry attempts: " + attempts);
       is(destroyed, true, "Plugin instance should have been destroyed.");
       SimpleTest.finish();
     }
   }
 
   function startTest() {
-    var p1 = document.getElementById('plugin1');
-    var d1 = document.getElementById('div1');
+    var p1 = document.getElementById("plugin1");
+    var d1 = document.getElementById("div1");
 
     p1.callOnDestroy(onDestroy);
 
     // Get two parent check events to run.
     d1.removeChild(p1);
     d1.appendChild(p1);
     d1.removeChild(p1);
 
--- a/dom/plugins/test/mochitest/test_instance_unparent3.html
+++ b/dom/plugins/test/mochitest/test_instance_unparent3.html
@@ -27,19 +27,19 @@
     } else {
       info("Number of retry attempts: " + attempts);
       is(destroyed, true, "Plugin instance should have been destroyed.");
       SimpleTest.finish();
     }
   }
 
   function startTest() {
-    var p1 = document.getElementById('plugin1');
-    var d1 = document.getElementById('div1');
-    var d2 = document.getElementById('div2');
+    var p1 = document.getElementById("plugin1");
+    var d1 = document.getElementById("div1");
+    var d2 = document.getElementById("div2");
 
     p1.callOnDestroy(onDestroy);
     d1.removeChild(d2);
     SimpleTest.executeSoon(checkPluginAlreadyDestroyed);
   }
   </script>
 
   <p id="display"></p>
--- a/dom/plugins/test/mochitest/test_instantiation.html
+++ b/dom/plugins/test/mochitest/test_instantiation.html
@@ -5,29 +5,29 @@
 
 <body onload="mainLoaded()">
   <iframe id="iframe1" src="about:blank" width="600" height="600"></iframe>
 
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
-  var iframe = document.getElementById('iframe1');
+  var iframe = document.getElementById("iframe1");
 
   function mainLoaded() {
-    var p = iframe.contentDocument.createElement('embed');
-    p.setAttribute('id', 'plugin1');
-    p.setAttribute('type', 'application/x-test');
-    p.setAttribute('width', '400');
-    p.setAttribute('height', '400');
-    p.setAttribute('drawmode', 'solid');
-    p.setAttribute('color', 'FF00FFFF');
+    var p = iframe.contentDocument.createElement("embed");
+    p.setAttribute("id", "plugin1");
+    p.setAttribute("type", "application/x-test");
+    p.setAttribute("width", "400");
+    p.setAttribute("height", "400");
+    p.setAttribute("drawmode", "solid");
+    p.setAttribute("color", "FF00FFFF");
     iframe.contentDocument.body.appendChild(p);
 
     // Plugin instantiation happens asynchronously
     SimpleTest.executeSoon(function() {
       SimpleTest.executeSoon(function() {
         ok(p.setColor !== undefined, "Dynamic plugin instantiation.");
         SimpleTest.finish();
-      })
+      });
     });
   }
   </script>
--- a/dom/plugins/test/mochitest/test_mixed_case_mime.html
+++ b/dom/plugins/test/mochitest/test_mixed_case_mime.html
@@ -6,17 +6,17 @@
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 <script>
   SimpleTest.expectAssertions(0, 1);
 
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED, "Second Test Plug-in");
 
   function frameLoaded() {
-    var contentDocument = document.getElementById('testframe').contentDocument;
+    var contentDocument = document.getElementById("testframe").contentDocument;
     ok(contentDocument.body.innerHTML.length > 0, "Frame content shouldn't be empty.");
     ok(contentDocument.plugins.length > 0, "Frame content should have a plugin.");
     var plugin = contentDocument.plugins[0];
     is(plugin.type.toLowerCase(), "application/x-second-test", "Should have loaded the second test plugin.");
     SimpleTest.finish();
   }
 </script>
 </head>
--- a/dom/plugins/test/mochitest/test_multipleinstanceobjects.html
+++ b/dom/plugins/test/mochitest/test_multipleinstanceobjects.html
@@ -4,18 +4,18 @@
   <script type="application/javascript" src="plugin-utils.js"></script>
 
 <body onload="runTests()">
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   function runTests() {
-    var p1 = document.getElementById('plugin1');
-    var p2 = document.getElementById('plugin2');
+    var p1 = document.getElementById("plugin1");
+    var p2 = document.getElementById("plugin2");
 
     var o = p1.getObjectValue();
     ok(p1.checkObjectValue(o), "Plugin objects passed to the same instance are identical.");
     ok(!p2.checkObjectValue(o), "Plugin objects passed to another instance are double-wrapped.");
 
     SimpleTest.finish();
   }
   </script>
--- a/dom/plugins/test/mochitest/test_newstreamondestroy.html
+++ b/dom/plugins/test/mochitest/test_newstreamondestroy.html
@@ -8,21 +8,21 @@
 
 <body onload="runTest()">
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
   SimpleTest.requestFlakyTimeout("untriaged");
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   function runTest() {
-    var p = document.getElementById('plugin1');
+    var p = document.getElementById("plugin1");
     var destroyed = false;
     p.callOnDestroy(function() {
       destroyed = true;
-      ok(!p.streamTest('loremipsum.txt', false, null, null,
+      ok(!p.streamTest("loremipsum.txt", false, null, null,
                        function(r, t) {
                          ok(false, "get-during-destroy should have failed");
                        }, null, true), "NPN_GetURLNotify should fail during NPP_Destroy");
     });
     document.body.removeChild(p);
 
     setTimeout(function() {
       ok(destroyed, "callback was fired as expected");
--- a/dom/plugins/test/mochitest/test_npobject_getters.html
+++ b/dom/plugins/test/mochitest/test_npobject_getters.html
@@ -1,25 +1,25 @@
 <head>
   <title>NPNV*NPObject accessibility tests</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript" src="plugin-utils.js"></script>
 
 <body onload="runTests()">
   <script class="testbody" type="application/javascript">
-  dump('lastScript\n');
+  dump("lastScript\n");
 
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   function runTests() {
     ok(
-      document.getElementById('plugin1').pluginFoundElement,
+      document.getElementById("plugin1").pluginFoundElement,
       "plugin1.pluginFoundElement (NPNVPluginElementNPObject) - " +
-      document.getElementById('plugin1').pluginFoundElement
+      document.getElementById("plugin1").pluginFoundElement
     );
     ok(
       window.pluginFoundWindow,
       "window.pluginFoundWindow (NPNVWindowNPObject) - " +
       window.pluginFoundWindow
     );
 
     SimpleTest.finish();
--- a/dom/plugins/test/mochitest/test_npruntime_construct.html
+++ b/dom/plugins/test/mochitest/test_npruntime_construct.html
@@ -13,20 +13,20 @@
 
   <p id="display"></p>
 
   <embed id="theplugin" type="application/x-test"></embed>
 
   <script type="application/javascript">
     function MyFunc(arg) {
       is(arg, "hi", "Argument passed to constructor function");
-      this.localProp = 'local';
+      this.localProp = "local";
     }
-    MyFunc.prototype.protoProp = 't';
+    MyFunc.prototype.protoProp = "t";
 
-    var theplugin = document.getElementById('theplugin');
+    var theplugin = document.getElementById("theplugin");
 
     ok(theplugin.constructObject(Array) instanceof Array, "Constructed Array");
     var o = theplugin.constructObject(MyFunc, "hi");
     ok(o instanceof MyFunc, "Constructed MyFunc");
-    is(o.localProp, 'local', "this property correct");
-    is(o.protoProp, 't', "prototype property correct");
+    is(o.localProp, "local", "this property correct");
+    is(o.protoProp, "t", "prototype property correct");
   </script>
--- a/dom/plugins/test/mochitest/test_npruntime_identifiers.html
+++ b/dom/plugins/test/mochitest/test_npruntime_identifiers.html
@@ -6,62 +6,61 @@
   <script type="text/javascript" src="plugin-utils.js"></script>
   <link rel="stylesheet" type="text/css" 
         href="/tests/SimpleTest/test.css" />
 </head>
 <body>
   <p id="display"></p>
 
   <script class="testbody" type="application/javascript">
-  ////
+  // //
   // This test exercises NP identifiers by querying the reflector to make sure
   // that identifiers are translated to values correctly.
   
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   var testsRun = 0;
 
   function doTest() {
     SpecialPowers.gc();
 
     var reflector = document.getElementById("subframe").contentDocument.getElementById("plugin1").getReflector();
 
     var i, prop, randomnumber;
 
     for (i = 0; i < 20; ++i) {
-      randomnumber=Math.floor(Math.random()*1001);
+      randomnumber = Math.floor(Math.random() * 1001);
       prop = "prop" + randomnumber;
       is(reflector[prop], prop, "Property " + prop);
     }
 
     for (i = -10; i < 0; ++i) {
       is(reflector[i], String(i), "Property " + i);
       prop = "prop" + i;
       is(reflector[prop], prop, "Property " + prop);
     }
 
     for (i = 0; i < 10; ++i) {
       is(reflector[i], i, "Property " + i);
       prop = "prop" + i;
       is(reflector[prop], prop, "Property " + prop);
     }
 
-    is(reflector.a, 'a', "Property .a");
-    is(reflector['a'], 'a', "Property ['a']");
+    is(reflector.a, "a", "Property .a");
+    is(reflector.a, "a", "Property ['a']");
     reflector = null;
 
     SpecialPowers.gc();
 
     ++testsRun;
     if (testsRun == 3) {
       SimpleTest.finish();
-    }
-    else {
-      document.getElementById('subframe').contentWindow.location.reload(true);
+    } else {
+      document.getElementById("subframe").contentWindow.location.reload(true);
     }
   }
   </script>
 
   <iframe id="subframe" src="npruntime_identifiers_subpage.html" onload="doTest()"></iframe>
 
 </body>
 </html>
--- a/dom/plugins/test/mochitest/test_npruntime_npnevaluate.html
+++ b/dom/plugins/test/mochitest/test_npruntime_npnevaluate.html
@@ -10,85 +10,85 @@
 <body onload="runTests()">
   <script class="testbody" type="application/javascript">
   
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
   
   // global test function
   function testMe(arg) {
-    var result = arg+arg;
+    var result = arg + arg;
     for (var i = 1; i < arguments.length; i++) {
       result += arguments[i] + arguments[i];
     }
     return result;
   }
 
-  ////
+  // //
   // This test exercises NPN_Evaluate using the test plugin's
-  // npnEvaluateTest method.  This method calls NPN_Evaluate on 
+  // npnEvaluateTest method.  This method calls NPN_Evaluate on
   // a string argument passed to it, and returns the eval result.
   // The array below drives the tests; each array member has two
-  // members:  the first is a string to eval, and the second is 
+  // members:  the first is a string to eval, and the second is
   // the expected result of the eval.
   //
 
   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],
       ["new Object(3)", new Object(3)],
       ["new Array(1, 2, 3, 4)", [1, 2, 3, 4]],
-      ["document.getElementById('display')", 
+      ["document.getElementById('display')",
           document.getElementById("display")],
       ["encodeURI('a = b')", "a%20=%20b"],
-      ["document.getElementById('testdiv').innerHTML = 'Hello world!'", 
+      ["document.getElementById('testdiv').innerHTML = 'Hello world!'",
           "Hello world!"],
-      ["function test2() { var x = {a: '1', b: '2'}; return x; } test2();", 
-          {a: '1', b: '2'}],
+      ["function test2() { var x = {a: '1', b: '2'}; return x; } test2();",
+          {a: "1", b: "2"}],
       ["(function() { var ret; try { win = window.open(); win.document.writeln('wibble'); ret = 'no error' } catch(e) { ret = e.name; } win.close(); return ret; })()", "no error"],
     ];
 
     var plugin = document.getElementById("plugin1");
 
     // Test calling NPN_Evaluate from within plugin code.
     for (var test of tests) {
       var expected = test[1];
       var result = plugin.npnEvaluateTest(test[0]);
       // serialize the two values for easy comparison
       var json_expected = JSON.stringify(expected);
       var json_result = JSON.stringify(result);
       if (typeof(result) == "function")
           json_result = result.toString();
       if (typeof(expected) == "function")
           json_expected = expected.toString();
-      is(json_result, json_expected, 
+      is(json_result, json_expected,
           "npnEvaluateTest returned an unexpected value");
-      is(typeof(result), typeof(expected), 
+      is(typeof(result), typeof(expected),
           "npnEvaluateTest return value was of unexpected type");
-      var success = (json_result == json_expected && 
+      var success = (json_result == json_expected &&
           typeof(result) == typeof(expected));
       $("verbose").appendChild(
-          createEl('span',null, (success ? "pass" : "fail") + ": eval(" + test[0] + ")"));
+          createEl("span", null, (success ? "pass" : "fail") + ": eval(" + test[0] + ")"));
       $("verbose").appendChild(
-          createEl('span', null," == " + json_result + "(" + 
-          typeof(result) + "), expected " + json_expected + "(" + 
+          createEl("span", null, " == " + json_result + "(" +
+          typeof(result) + "), expected " + json_expected + "(" +
           typeof(expected) + ")"));
       $("verbose").appendChild(
-          createEl('br')
+          createEl("br")
           );
     }
-    
-    is(document.getElementById('testdiv').innerHTML, "Hello world!",
+  
+    is(document.getElementById("testdiv").innerHTML, "Hello world!",
       "innerHTML not set correctly via NPN_Evaluate");
-    
+  
     SimpleTest.finish();
   }
   </script>
 
   <p id="display"></p>
 
   <embed id="plugin1" type="application/x-test" width="400" height="100">
   </embed>
--- a/dom/plugins/test/mochitest/test_npruntime_npninvoke.html
+++ b/dom/plugins/test/mochitest/test_npruntime_npninvoke.html
@@ -5,19 +5,19 @@
           src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript" src="plugin-utils.js"></script>
   <link rel="stylesheet" type="text/css" 
         href="/tests/SimpleTest/test.css" />
 </head>
 <body onload="runTests()">
 
   <script class="testbody" type="application/javascript">
-  ////
+  // //
   // This test exercises NPN_Invoke by calling the plugin's npnInvokeTest
-  // method, which in turn invokes a script method with 1 or more parameters, 
+  // method, which in turn invokes a script method with 1 or more parameters,
   // and then compares the return vale with an expected value.  This is good
   // for verifying various NPVariant values and types moving between
   // the browser and the plugin.
   //
   
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
@@ -34,25 +34,25 @@
   }
   
   // Same as above but explicitly expects two arguments.
   function returnTwoArgs(arg1, arg2) {
     return [arg1, arg2];
   }
 
   // some objects and arrays used in the tests...
-  var obj = {"key1": "string", "key2": 0, "key3": true, "key4": undefined, 
+  var obj = {"key1": "string", "key2": 0, "key3": true, "key4": undefined,
         "key5": null, "key6": -551235.12552, "key7": false};
   var arr = ["string", 0, true, false, undefined, null, -1, 55512.1252];
-  var obj2 = {"key1": "string", "key2": 0, "key3": true, "key4": undefined, 
+  var obj2 = {"key1": "string", "key2": 0, "key3": true, "key4": undefined,
         "key5": null, "key6": -551235.12552, "key7": false, "array": arr};
   var arr2 = ["string", false, undefined, null, -1, 55512.1252,
         {"a": "apple", "b": true, "c": undefined}];
   
-  ////
+  // //
   // A list of tests to run.  Each member of the main array contains
   // two members:  the first contains the arguments passed to npnInvokeTest,
   // and the second is the expected result.
   //
   var tests = [
     // numeric values
     [["returnArgs", 0, 0], true],
     [["returnArgs", 1, 1], true],
@@ -89,34 +89,34 @@
     [["returnArgs", "test line2", "test\u0020line2"], true],
     // objects and arrays
     [["returnArgs", obj, obj], true],
     [["returnArgs", arr, arr], true],
     [["returnArgs", obj2, obj2], true],
     [["returnArgs", arr2, arr2], true],
     // multiple arguments
     [["returnArgs", [0, 1, 2], 0, 1, 2], true],
-    [["returnArgs", [5, "a", true, false, null], 
+    [["returnArgs", [5, "a", true, false, null],
         5, "a", true, false, null], true],
-    [["returnArgs", [-1500.583, "test string\n", 
-                     [5, 10, 15, 20], {"a": 1, "b": 2}], 
+    [["returnArgs", [-1500.583, "test string\n",
+                     [5, 10, 15, 20], {"a": 1, "b": 2}],
         -1500.583, "test string\n", [5, 10, 15, 20], {"a": 1, "b": 2}], true],
-    [["returnArgs", [undefined, 0, null, "yes"], 
+    [["returnArgs", [undefined, 0, null, "yes"],
         undefined, 0, null, "yes"], true],
-    [["returnArgs", [0, undefined, null, "yes"], 
+    [["returnArgs", [0, undefined, null, "yes"],
         0, undefined, null, "yes"], true],
     // too many/too few args
     [["returnTwoArgs", ["a", "b"], "a", "b", "c"], true],
     [["returnTwoArgs", ["a", undefined], "a"], true],
     [["returnTwoArgs", [undefined, undefined]], true],
   ];
- 
+
   function runTests() {
     var plugin = document.getElementById("plugin1");
-    
+  
     var result;
     for (var test of tests) {
       switch (test[0].length) {
         case 2:
           result = plugin.npnInvokeTest(test[0][0], test[0][1]);
           break;
         case 3:
           result = plugin.npnInvokeTest(test[0][0], test[0][1], test[0][2]);
@@ -136,22 +136,22 @@
           result = plugin.npnInvokeTest(test[0][0], test[0][1], test[0][2],
               test[0][3], test[0][4], test[0][5], test[0][6]);
           break;
         default:
           is(false, "bad number of test arguments");
       }
       is(result, test[1], "npnInvokeTestFailed: " + plugin.getError());
       $("verbose").appendChild(
-          createEl('span', null, ((result == test[1] ? "pass" : "fail") + ": " + test[0])));
+          createEl("span", null, ((result == test[1] ? "pass" : "fail") + ": " + test[0])));
       if (result != test[1])
         $("verbose").appendChild(createEl("span", null, (" " + plugin.getError())));
-      $("verbose").appendChild(createEl('br'));
+      $("verbose").appendChild(createEl("br"));
     }
-            
+  
     SimpleTest.finish();
   }
   </script>
 
   <p id="display"></p>
 
   <embed id="plugin1" type="application/x-test" width="400" height="100">
   </embed>
--- a/dom/plugins/test/mochitest/test_npruntime_npninvokedefault.html
+++ b/dom/plugins/test/mochitest/test_npruntime_npninvokedefault.html
@@ -10,29 +10,29 @@
 <body onload="runTests()">
   <script class="testbody" type="application/javascript">
   
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   // global test function
   function testMe(arg) {
-    var result = arg+arg;
+    var result = arg + arg;
     for (var i = 1; i < arguments.length; i++) {
       result += arguments[i] + arguments[i];
     }
     return result;
   }
 
-  ////
+  // //
   // This test exercises NPN_InvokeDefault using the test plugin's
   // npnInvokeDefaultTest method.  This method invokes an object
   // with a single parameter, and returns the result of the invocation.
-  // The test list below is used to drive the tests.  Each member of the 
-  // array contains three members: the object to invoke, an argument to 
+  // The test list below is used to drive the tests.  Each member of the
+  // array contains three members: the object to invoke, an argument to
   // invoke it with, and the expected result of the invocation.
   //
   var tests = [
     // Number object
     ["Number", 3, 3],
     ["Number", "3", 3],
     ["Number", "0x20", 32],
     ["Number", "three", Number.NaN],
@@ -56,39 +56,39 @@
     // 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)],
     ["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]], 
+    ["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"],
     ["String", "true", "true"],
     ["String", "null", "null"],
     ["String", "2 + 2", String("2 + 2")],
     ["String", ""],
     // global functions
     ["testMe", 3, 6],
-    ["testMe", "string", [1,2], "stringstring1,21,2"],
+    ["testMe", "string", [1, 2], "stringstring1,21,2"],
     ["testMe", "me", "meme"],
     ["testMe", undefined, Number.NaN],
     ["testMe", [1, 2], "1,21,2"],
     ["testMe", 3, 4, 14],
     ["isNaN", "junk", true],
     ["parseInt", "156", 156],
     ["encodeURI", "a = b", "a%20=%20b"],
   ];
- 
+
   function runTests() {
     var plugin = document.getElementById("plugin1");
 
     // Test calling NPN_InvokeDefault from within plugin code.
     for (var test of tests) {
       var result;
       var expected = test[test.length - 1];
       switch (test.length) {
@@ -97,52 +97,52 @@
           break;
         case 3:
           result = plugin.npnInvokeDefaultTest(test[0], test[1]);
           break;
         case 4:
           result = plugin.npnInvokeDefaultTest(test[0], test[1], test[2]);
           break;
       }
-      // serialize the two values for easy 
+      // serialize the two values for easy
       var json_expected = JSON.stringify(expected);
       var json_result = JSON.stringify(result);
       if (typeof(result) == "function")
           json_result = result.toString();
       if (typeof(test[2]) == "function")
           json_expected = expected.toString();
-      is(json_result, json_expected, 
+      is(json_result, json_expected,
           "npnInvokeDefault returned an unexpected value");
-      is(typeof(result), typeof(expected), 
+      is(typeof(result), typeof(expected),
           "npnInvokeDefaultTest return value was of unexpected type");
-      var success = (json_result == json_expected && 
+      var success = (json_result == json_expected &&
           typeof(result) == typeof(expected));
       $("verbose").appendChild(
-          createEl('span', null, ((success ? "pass" : "fail") + ": " + test[0] + "(")));
+          createEl("span", null, ((success ? "pass" : "fail") + ": " + test[0] + "(")));
       for (var i = 1; i < test.length - 1; i++) {
         $("verbose").appendChild(
-            createEl('span', null, (JSON.stringify(test[i]) + (i < test.length - 2 ? "," : ""))));
+            createEl("span", null, (JSON.stringify(test[i]) + (i < test.length - 2 ? "," : ""))));
       }
       $("verbose").appendChild(
-          createEl('span', null, (") == " + json_result + "(" + 
-          typeof(result) + "), expected " + json_expected + "(" + 
+          createEl("span", null, (") == " + json_result + "(" +
+          typeof(result) + "), expected " + json_expected + "(" +
           typeof(expected) + ")")));
-      $("verbose").appendChild(createEl('br'));
+      $("verbose").appendChild(createEl("br"));
     }
 
     let testObject = plugin.getInvokeDefaultObject();
 
     // Test calling the invokedefault method of plugin-defined object
-    is(testObject(), "Test Plug-in", 
+    is(testObject(), "Test Plug-in",
         "calling NPN_InvokeDefault on plugin-defined Object doesn't work");
-    is(testObject(1), "Test Plug-in;1", 
+    is(testObject(1), "Test Plug-in;1",
         "calling NPN_InvokeDefault on plugin-defined Object doesn't work");
-    is(testObject("test"), "Test Plug-in;test", 
+    is(testObject("test"), "Test Plug-in;test",
         "calling NPN_InvokeDefault on plugin-defined Object doesn't work");
-    is(testObject(undefined, -1, null), "Test Plug-in;undefined;-1;null", 
+    is(testObject(undefined, -1, null), "Test Plug-in;undefined;-1;null",
         "calling NPN_InvokeDefault on plugin-defined Object doesn't work");
   
     SimpleTest.finish();
   }
   </script>
 
   <p id="display"></p>
 
--- a/dom/plugins/test/mochitest/test_object.html
+++ b/dom/plugins/test/mochitest/test_object.html
@@ -24,17 +24,17 @@
       prettyModes[OBJLC.TYPE_LOADING] = "loading";
       prettyModes[OBJLC.TYPE_IMAGE] = "image";
       prettyModes[OBJLC.TYPE_PLUGIN] = "plugin";
       prettyModes[OBJLC.TYPE_DOCUMENT] = "document";
       prettyModes[OBJLC.TYPE_NULL] = "none";
 
       let body = document.body;
       // A single-pixel white png
-      let testPNG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3AoIFiETNqbNRQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAACklEQVQIHWP4DwABAQEANl9ngAAAAABJRU5ErkJggg==';
+      let testPNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3AoIFiETNqbNRQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAACklEQVQIHWP4DwABAQEANl9ngAAAAABJRU5ErkJggg==";
       // An empty, but valid, SVG
       let testSVG = 'data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"></svg>';
       // executeSoon wrapper to count pending callbacks
       let pendingCalls = 0;
       let afterPendingCalls = false;
 
       function runWhenDone(func) {
         if (!pendingCalls)
@@ -93,23 +93,23 @@
       function hasAttr(obj, attr) {
         return document.body.constructor.prototype.hasAttribute.call(obj, attr);
       }
       function removeAttr(obj, attr) {
         return document.body.constructor.prototype.removeAttribute.call(obj, attr);
       }
       function setDisplayed(obj, display) {
         if (display)
-          removeAttr(obj, 'style');
+          removeAttr(obj, "style");
         else
-          setAttr(obj, 'style', "display: none;");
+          setAttr(obj, "style", "display: none;");
       }
       function displayed(obj) {
         // Hacky, but that's all we use style for.
-        return !hasAttr(obj, 'style');
+        return !hasAttr(obj, "style");
       }
       function actualType(obj, state) {
         return state.getActualType.call(obj);
       }
       function getMode(obj, state) {
         return prettyModes[state.getDisplayedType.call(obj)];
       }
       function runningPlugin(obj, state) {
@@ -128,144 +128,144 @@
         if (attr && hasAttr(obj, attr)) {
           src(obj, state, getAttr(obj, attr));
         } else if (body.contains(obj)) {
           body.appendChild(obj);
         } else {
           // Out of document nodes without data attributes simply can't be
           // reloaded currently. Bug 767635
         }
-      };
+      }
 
-      // Make a list of combinations of sub-lists, e.g.:
-      // [ [a, b], [c, d] ]
-      // ->
-      // [ [a, c], [a, d], [b, c], [b, d] ]
-      function eachList() {
+// Make a list of combinations of sub-lists, e.g.:
+// [ [a, b], [c, d] ]
+// ->
+// [ [a, c], [a, d], [b, c], [b, d] ]
+function eachList() {
         let all = [];
         if (!arguments.length)
           return all;
         let list = Array.prototype.slice.call(arguments, 0);
         for (let c of list[0]) {
           if (list.length > 1) {
-            for (let x of eachList.apply(this,list.slice(1))) {
+            for (let x of eachList.apply(this, list.slice(1))) {
               all.push((c.length ? [c] : []).concat(x));
             }
           } else if (c.length) {
             all.push([c]);
           }
         }
         return all;
       }
 
       let states = {
-        svg: function(obj, state) {
-          removeAttr(obj, "type");
-          src(obj, state, testSVG);
-          state.noChannel = false;
-          state.expectedType = "image/svg";
-          // SVGs are actually image-like subdocuments
-          state.expectedMode = "document";
-        },
-        image: function(obj, state) {
-          removeAttr(obj, "type");
-          src(obj, state, testPNG);
-          state.noChannel = false;
-          state.expectedMode = "image";
-          state.expectedType = "image/png";
-        },
-        plugin: function(obj, state) {
-          removeAttr(obj, "type");
-          src(obj, state, "data:application/x-test,foo");
-          state.noChannel = false;
-          state.expectedType = "application/x-test";
-          state.expectedMode = "plugin";
-        },
-        pluginExtension: function(obj, state) {
-          src(obj, state, "./fake_plugin.tst");
-          state.expectedMode = "plugin";
-          state.pluginExtension = true;
-          state.noChannel = false;
-        },
-        document: function(obj, state) {
-          removeAttr(obj, "type");
-          src(obj, state, "data:text/plain,I am a document");
-          state.noChannel = false;
-          state.expectedType = "text/plain";
-          state.expectedMode = "document";
-        },
-        fallback: function(obj, state) {
-          removeAttr(obj, "type");
-          state.expectedType = "application/x-unknown";
-          state.expectedMode = "none";
-          state.noChannel = true;
-          src(obj, state, null);
-        },
-        addToDoc: function(obj, state) {
-          body.appendChild(obj);
-        },
-        removeFromDoc: function(obj, state) {
-          if (body.contains(obj))
-            body.removeChild(obj);
-        },
+        svg(obj, state) {
+    removeAttr(obj, "type");
+    src(obj, state, testSVG);
+    state.noChannel = false;
+    state.expectedType = "image/svg";
+    // SVGs are actually image-like subdocuments
+    state.expectedMode = "document";
+  },
+        image(obj, state) {
+    removeAttr(obj, "type");
+    src(obj, state, testPNG);
+    state.noChannel = false;
+    state.expectedMode = "image";
+    state.expectedType = "image/png";
+  },
+        plugin(obj, state) {
+    removeAttr(obj, "type");
+    src(obj, state, "data:application/x-test,foo");
+    state.noChannel = false;
+    state.expectedType = "application/x-test";
+    state.expectedMode = "plugin";
+  },
+        pluginExtension(obj, state) {
+    src(obj, state, "./fake_plugin.tst");
+    state.expectedMode = "plugin";
+    state.pluginExtension = true;
+    state.noChannel = false;
+  },
+        document(obj, state) {
+    removeAttr(obj, "type");
+    src(obj, state, "data:text/plain,I am a document");
+    state.noChannel = false;
+    state.expectedType = "text/plain";
+    state.expectedMode = "document";
+  },
+        fallback(obj, state) {
+    removeAttr(obj, "type");
+    state.expectedType = "application/x-unknown";
+    state.expectedMode = "none";
+    state.noChannel = true;
+    src(obj, state, null);
+  },
+        addToDoc(obj, state) {
+    body.appendChild(obj);
+  },
+        removeFromDoc(obj, state) {
+    if (body.contains(obj))
+      body.removeChild(obj);
+  },
         // Set the proper type
-        setType: function(obj, state) {
-          if (state.expectedType) {
-            state.badType = false;
-            setAttr(obj, 'type', state.expectedType);
-            forceReload(obj, state);
-          }
-        },
+        setType(obj, state) {
+    if (state.expectedType) {
+      state.badType = false;
+      setAttr(obj, "type", state.expectedType);
+      forceReload(obj, state);
+    }
+  },
         // Set an improper type
-        setWrongType: function(obj, state) {
-          // This should break no-channel-plugins but nothing else
-          state.badType = true;
-          setAttr(obj, 'type', "application/x-unknown");
-          forceReload(obj, state);
-        },
+        setWrongType(obj, state) {
+    // This should break no-channel-plugins but nothing else
+    state.badType = true;
+    setAttr(obj, "type", "application/x-unknown");
+    forceReload(obj, state);
+  },
         // Set a plugin type
-        setPluginType: function(obj, state) {
-          // If an object/embed has a type set to a plugin type, it should not
-          // use the channel type.
-          state.badType = false;
-          setAttr(obj, 'type', 'application/x-test');
-          state.expectedType = "application/x-test";
-          state.expectedMode = "plugin";
-          forceReload(obj, state);
-        },
-        noChannel: function(obj, state) {
-          src(obj, state, null);
-          state.noChannel = true;
-          state.pluginExtension = false;
-        },
-        displayNone: function(obj, state) {
-          setDisplayed(obj, false);
-        },
-        displayInherit: function(obj, state) {
-          setDisplayed(obj, true);
-        }
+        setPluginType(obj, state) {
+    // If an object/embed has a type set to a plugin type, it should not
+    // use the channel type.
+    state.badType = false;
+    setAttr(obj, "type", "application/x-test");
+    state.expectedType = "application/x-test";
+    state.expectedMode = "plugin";
+    forceReload(obj, state);
+  },
+        noChannel(obj, state) {
+    src(obj, state, null);
+    state.noChannel = true;
+    state.pluginExtension = false;
+  },
+        displayNone(obj, state) {
+    setDisplayed(obj, false);
+  },
+        displayInherit(obj, state) {
+    setDisplayed(obj, true);
+  },
       };
 
 
       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')) {
+        if (state.noChannel && !getAttr(obj, "type")) {
           // Some combinations of test both set no type and no channel. This is
           // worth testing with the various combinations, but shouldn't load.
           expectedMode = "none";
         }
 
         // Embed tags should always try to load a plugin by type or extension
         // before falling back to opening a channel. See bug 803159
         if (state.tagName == "embed" &&
-            (getAttr(obj, 'type') == "application/x-test" || state.pluginExtension)) {
+            (getAttr(obj, "type") == "application/x-test" || state.pluginExtension)) {
           state.noChannel = true;
         }
 
         // with state.loading, unless we're loading with no channel, these types
         // should still be in loading state pending a channel.
         if (state.loading && (expectedMode == "image" || expectedMode == "document" ||
                              (expectedMode == "plugin" && !state.initialPlugin && !state.noChannel))) {
           expectedMode = "loading";
@@ -282,17 +282,17 @@
         // render as such
         if (state.tagName == "embed" && expectedMode == "document" &&
             actualType(obj, state) != "image/svg+xml") {
           expectedMode = "none";
         }
 
         // Embeds with a plugin type should skip opening a channel prior to
         // loading, taking only type into account.
-        if (state.tagName == 'embed' && getAttr(obj, 'type') == 'application/x-test' &&
+        if (state.tagName == "embed" && getAttr(obj, "type") == "application/x-test" &&
             body.contains(obj)) {
           expectedMode = "plugin";
         }
 
         if (!body.contains(obj)
             && (!state.loading || expectedMode != "image")
             && (!state.initialPlugin || expectedMode != "plugin")) {
           // Images are handled by nsIImageLoadingContent so we dont track
@@ -313,198 +313,201 @@
         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();
           scripted = true;
-        } catch(e) {}
+        } 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;
           for (let oldp of state.oldPlugins) {
             // If this returns false or throws, it's not the same plugin
             try {
               didRespawn = !obj.checkObjectValue(oldp);
             } catch (e) {
               didRespawn = true;
             }
           }
-          is(didRespawn, true, "Plugin should have re-spawned since old state ("+state.oldPlugins.length+")");
+          is(didRespawn, true, "Plugin should have re-spawned since old state (" + state.oldPlugins.length + ")");
         }
       }
 
       let total = 0;
       let test_modes = {
         // Just apply from_state then to_state
         "immediate": function(obj, from_state, to_state, state) {
           for (let from of from_state)
             states[from](obj, state);
           for (let to of to_state)
             states[to](obj, state);
 
           // We don't spin the event loop between applying to_state and
           // running tests, so some types are still loading
           state.loading = true;
-          info("["+(++total)+"] Testing [ " + from_state + " ] -> [ " + to_state + " ] / " + state.tagName + " / immediate");
+          info("[" + (++total) + "] Testing [ " + from_state + " ] -> [ " + to_state + " ] / " + state.tagName + " / immediate");
           testObject(obj, state);
 
           if (body.contains(obj))
             body.removeChild(obj);
-
         },
         // Apply states, spin event loop, run tests.
         "cycle": function(obj, from_state, to_state, state) {
           for (let from of from_state)
             states[from](obj, state);
           for (let to of to_state)
             states[to](obj, state);
           // Because re-appending to the document creates a script blocker, but
           // plugins spawn asynchronously, we need to return to the event loop
           // twice to ensure the plugin has been given a chance to lazily spawn.
-          runSoon(function() { runSoon(function() {
-            info("["+(++total)+"] Testing [ " + from_state + " ] -> [ " + to_state + " ] / " + state.tagName + " / cycle");
+          runSoon(function() {
+ runSoon(function() {
+            info("[" + (++total) + "] Testing [ " + from_state + " ] -> [ " + to_state + " ] / " + state.tagName + " / cycle");
             testObject(obj, state);
 
             if (body.contains(obj))
               body.removeChild(obj);
-          }); });
+          });
+});
         },
         // Apply initial state, spin event loop, apply final state, spin event
         // loop again.
         "cycleboth": function(obj, from_state, to_state, state) {
           for (let from of from_state) {
             states[from](obj, state);
           }
           runSoon(function() {
             for (let to of to_state) {
               states[to](obj, state);
             }
             // Because re-appending to the document creates a script blocker,
             // but plugins spawn asynchronously, we need to return to the event
             // loop twice to ensure the plugin has been given a chance to lazily
             // spawn.
-            runSoon(function() { runSoon(function() {
-              info("["+(++total)+"] Testing [ " + from_state + " ] -> [ " + to_state + " ] / " + state.tagName + " / cycleboth");
+            runSoon(function() {
+ runSoon(function() {
+              info("[" + (++total) + "] Testing [ " + from_state + " ] -> [ " + to_state + " ] / " + state.tagName + " / cycleboth");
               testObject(obj, state);
 
               if (body.contains(obj))
                 body.removeChild(obj);
-            }); });
+            });
+});
           });
         },
         // Apply initial state, spin event loop, apply later state, test
         // immediately
         "cyclefirst": function(obj, from_state, to_state, state) {
           for (let from of from_state) {
             states[from](obj, state);
           }
           runSoon(function() {
             state.initialPlugin = runningPlugin(obj, state);
             for (let to of to_state) {
               states[to](obj, state);
             }
-            info("["+(++total)+"] Testing [ " + from_state + " ] -> [ " + to_state + " ] / " + state.tagName + " / cyclefirst");
+            info("[" + (++total) + "] Testing [ " + from_state + " ] -> [ " + to_state + " ] / " + state.tagName + " / cyclefirst");
             // We don't spin the event loop between applying to_state and
             // running tests, so some types are still loading
             state.loading = true;
             testObject(obj, state);
 
             if (body.contains(obj))
               body.removeChild(obj);
           });
         },
       };
 
       function test(testdat) {
         // FIXME bug 1291854: Change back to lets when the test is fixed.
-        for (var from_state of testdat['from_states']) {
-          for (var to_state of testdat['to_states']) {
-            for (var mode of testdat['test_modes']) {
-              for (var type of testdat['tag_types']) {
-                runSoon(function () {
+        for (var from_state of testdat.from_states) {
+          for (var to_state of testdat.to_states) {
+            for (var mode of testdat.test_modes) {
+              for (var type of testdat.tag_types) {
+                runSoon(function() {
                   let obj = document.createElement(type);
                   obj.width = 1; obj.height = 1;
                   let state = {};
                   state.noChannel = true;
                   state.tagName = type;
                   // Part of the test checks whether a plugin spawned or not,
                   // but touching the object prototype will attempt to
                   // synchronously spawn a plugin!  We use this terrible hack to
                   // get a privileged getter for the attributes we want to touch
                   // prior to applying any attributes.
                   // TODO when embed goes away we wont need to check for
                   //      QueryInterface any longer.
-                  var lookup_on = obj.QueryInterface ? obj.QueryInterface(OBJLC): obj;
-                  state.getDisplayedType = SpecialPowers.do_lookupGetter(lookup_on, 'displayedType');
-                  state.getHasRunningPlugin = SpecialPowers.do_lookupGetter(lookup_on, 'hasRunningPlugin');
-                  state.getActualType = SpecialPowers.do_lookupGetter(lookup_on, 'actualType');
+                  var lookup_on = obj.QueryInterface ? obj.QueryInterface(OBJLC) : obj;
+                  state.getDisplayedType = SpecialPowers.do_lookupGetter(lookup_on, "displayedType");
+                  state.getHasRunningPlugin = SpecialPowers.do_lookupGetter(lookup_on, "hasRunningPlugin");
+                  state.getActualType = SpecialPowers.do_lookupGetter(lookup_on, "actualType");
                   test_modes[mode](obj, from_state, to_state, state);
                 });
               }
             }
           }
         }
       }
 
       function onLoad() {
         // Generic tests
         test({
-          'tag_types': [ 'embed', 'object' ],
+          "tag_types": [ "embed", "object" ],
           // In all three modes
-          'test_modes': [ 'immediate', 'cycle', 'cyclefirst', 'cycleboth' ],
+          "test_modes": [ "immediate", "cycle", "cyclefirst", "cycleboth" ],
           // Starting from a blank tag in and out of the document, a loading
           // plugin, and no-channel plugin (initial types only really have
           // odd cases with plugins)
-          'from_states': [
-            [ 'addToDoc' ],
-            [ 'plugin' ],
-            [ 'plugin', 'addToDoc' ],
-            [ 'plugin', 'noChannel', 'setType', 'addToDoc' ],
+          "from_states": [
+            [ "addToDoc" ],
+            [ "plugin" ],
+            [ "plugin", "addToDoc" ],
+            [ "plugin", "noChannel", "setType", "addToDoc" ],
             [],
           ],
           // To various combinations of loaded objects
-          'to_states': eachList(
-            [ 'svg', 'image', 'plugin', 'document', '' ],
-            [ 'setType', 'setWrongType', 'setPluginType', '' ],
-            [ 'noChannel', '' ],
-            [ 'displayNone', 'displayInherit', '' ]
+          "to_states": eachList(
+            [ "svg", "image", "plugin", "document", "" ],
+            [ "setType", "setWrongType", "setPluginType", "" ],
+            [ "noChannel", "" ],
+            [ "displayNone", "displayInherit", "" ]
           )});
         // Special case test for embed tags with plugin-by-extension
         // TODO object tags should be tested here too -- they have slightly
         //      different behavior, but waiting on a file load requires a loaded
         //      event handler and wont work with just our event loop spinning.
         test({
-          'tag_types': [ 'embed' ],
-          'test_modes': [ 'immediate', 'cyclefirst', 'cycle', 'cycleboth' ],
-          'from_states': eachList(
-            [ 'svg', 'plugin', 'image', 'document' ],
-            [ 'addToDoc' ]
+          "tag_types": [ "embed" ],
+          "test_modes": [ "immediate", "cyclefirst", "cycle", "cycleboth" ],
+          "from_states": eachList(
+            [ "svg", "plugin", "image", "document" ],
+            [ "addToDoc" ]
           ),
           // Set extension along with valid ty
-          'to_states': [
-            [ 'pluginExtension' ]
+          "to_states": [
+            [ "pluginExtension" ],
           ]});
         // Test plugin add/remove from document with adding/removing frame, with
         // and without a channel.
         test({
-          'tag_types': [ 'embed', 'object' ], // Ideally we'd test object too, but this gets exponentially long.
-          'test_modes': [ 'immediate', 'cyclefirst', 'cycle' ],
-          'from_states': [ [ 'displayNone', 'plugin', 'addToDoc' ],
-                           [ 'displayNone', 'plugin', 'noChannel', 'addToDoc' ],
-                           [ 'plugin', 'noChannel', 'addToDoc' ],
-                           [ 'plugin', 'noChannel' ] ],
-          'to_states': eachList(
-            [ 'displayNone', '' ],
-            [ 'removeFromDoc' ],
-            [ 'image', 'displayNone', '' ],
-            [ 'image', 'displayNone', '' ],
-            [ 'addToDoc' ],
-            [ 'displayInherit' ]
+          "tag_types": [ "embed", "object" ], // Ideally we'd test object too, but this gets exponentially long.
+          "test_modes": [ "immediate", "cyclefirst", "cycle" ],
+          "from_states": [ [ "displayNone", "plugin", "addToDoc" ],
+                           [ "displayNone", "plugin", "noChannel", "addToDoc" ],
+                           [ "plugin", "noChannel", "addToDoc" ],
+                           [ "plugin", "noChannel" ] ],
+          "to_states": eachList(
+            [ "displayNone", "" ],
+            [ "removeFromDoc" ],
+            [ "image", "displayNone", "" ],
+            [ "image", "displayNone", "" ],
+            [ "addToDoc" ],
+            [ "displayInherit" ]
           )});
         runWhenDone(() => SimpleTest.finish());
       }
     </script>
--- a/dom/plugins/test/mochitest/test_painting.html
+++ b/dom/plugins/test/mochitest/test_painting.html
@@ -63,27 +63,27 @@ function show() {
 
   // Capturing an image (as in a reftest) would force a repaint and use
   // different paths for the image surface, so instead check the plugin's
   // paint count.
   waitForPaint(invalidate);
 }
 
 function invalidate() {
-  paintCountIs(clipped, 1, "partially clipped plugin painted once");  
-  
+  paintCountIs(clipped, 1, "partially clipped plugin painted once");
+
   clipped.setColor("FF00FF00"); // plugin invalidates
 
   waitForPaint(done);
 }
 
 function done() {
   paintCountIs(clipped, 2, "painted after invalidate");
 
-  SimpleTest.finish();  
+  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";
   var flush = paint_waiter.offsetHeight;
--- a/dom/plugins/test/mochitest/test_plugin_scroll_invalidation.html
+++ b/dom/plugins/test/mochitest/test_plugin_scroll_invalidation.html
@@ -41,17 +41,17 @@ function initialize() {
 
   waitForPaint(scrollAround);
 }
 
 function scrollAround() {
   var paints = getPaintCounts();
 
   for (var i = 0; i < paints.length; ++i) {
-    isnot(paints[i], 0, "embed " + scrolling_plugins[i].id + " is painted"); 
+    isnot(paints[i], 0, "embed " + scrolling_plugins[i].id + " is painted");
   }
 
   last_paint_counts = paints;
 
   scrolling.scrollBy(-5, 5);
   scrolling.scrollBy(5, 5);
   scrolling.scrollBy(5, -5);
   scrolling.scrollBy(-5, -5);
@@ -65,30 +65,30 @@ function scrollAround() {
   waitForPaint(done);
 }
 
 function done() {
   var paints = getPaintCounts();
   for (var i = 0; i < paints.length; ++i) {
     is(paints[i], last_paint_counts[i], "embed " + scrolling_plugins[i].id + " is not painted on scroll");
   }
-  SimpleTest.finish();  
+  SimpleTest.finish();
 }
 
 // Waits for the paint_waiter plugin to be repainted and then
 // calls 'func' to continue.
 function waitForPaint(func) {
   paint_waiter.last_paint_count = paint_waiter.getPaintCount();
 
   paint_waiter.style.left = scrolling.scrollX + "px";
   paint_waiter.style.top = scrolling.scrollY + "px";
 
   // Fiddle with the style in a way that should force some repainting
   paint_waiter.style.width =
-    (paint_waiter.getBoundingClientRect().width + 1) + "px"; 
+    (paint_waiter.getBoundingClientRect().width + 1) + "px";
   paint_waiter.style.height = "1px";
 
   function waitForPaintHelper() {
     if (paint_waiter.getPaintCount() != paint_waiter.last_paint_count) {
       setTimeout(func, 0);
       return;
     }
     setTimeout(waitForPaintHelper, 0);
--- a/dom/plugins/test/mochitest/test_pluginstream_err.html
+++ b/dom/plugins/test/mochitest/test_pluginstream_err.html
@@ -17,17 +17,17 @@ Tests for plugin stream error conditions
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=517078">
   Mozilla Bug 517078</a> - Plugin Stream Error Tests
 <p id="display"></p>
 <div id="content" style="display: none">
 
 </div>
 <div id="test">
 <script class="testbody" type="text/javascript">
-////
+// //
 // These tests verify that nothing "bad" happens when a plugin returns an
 // error from one of the NPP_ stream functions.  "Bad" is defined here
 // as the plugin being terminated, or NPP_ stream functions being
 // called inappropriately by the browser after the plugin has returned
 // a stream error.
 //
 
 function $(id) { return document.getElementById(id); }
@@ -38,57 +38,57 @@ setTestPluginEnabledState(SpecialPowers.
 
 
 var tests = [
   {
     "src": "loremipsum.txt",
     "streammode": "normal",
     "functiontofail": "npp_newstream",
     "failurecode": "1",
-    "frame": "testframe"
+    "frame": "testframe",
   },
   {
     "src": "loremipsum.txt",
     "streammode": "normal",
     "functiontofail": "npp_newstream",
     "failurecode": "3",
-    "frame": "testframe"
+    "frame": "testframe",
   },
   {
     "src": "loremipsum.txt",
     "streammode": "normal",
     "functiontofail": "npp_newstream",
     "failurecode": "5",
-    "frame": "testframe"
+    "frame": "testframe",
   },
   {
     "geturl": "loremipsum.txt",
     "streammode": "normal",
     "functiontofail": "npp_newstream",
     "failurecode": "1",
-    "frame": "testframe"
+    "frame": "testframe",
   },
   {
     "src": "loremipsum.txt",
     "streammode": "normal",
     "functiontofail": "npp_write",
-    "frame": "testframe"
+    "frame": "testframe",
   },
   {
     "src": "loremipsum.txt",
     "streammode": "asfile",
     "functiontofail": "npp_write",
-    "frame": "testframe"
+    "frame": "testframe",
   },
   {
     "src": "loremipsum.txt",
     "streammode": "normal",
     "functiontofail": "npp_destroystream",
     "failurecode": "1",
-    "frame": "testframe"
+    "frame": "testframe",
   },
 ];
 
 function iframeonload(evt) {
   // We have to use SpecialPowers because nptest.cpp prepends
   // data: whichs makes the frame cross origin with the including page.
   var wrappedDoc = SpecialPowers.wrap(evt.target).contentDocument;
   var contentLength = wrappedDoc.body.innerHTML.length;
--- a/dom/plugins/test/mochitest/test_pluginstream_referer.html
+++ b/dom/plugins/test/mochitest/test_pluginstream_referer.html
@@ -10,46 +10,45 @@
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   var pending = 3;
   function testDone() {
     --pending;
     if (0 == pending)
-      SimpleTest.finish()
+      SimpleTest.finish();
   }
 
   function runTests() {
-    var p = document.getElementById('plugin1');
-    var p2 = document.getElementById('plugin2');
+    var p = document.getElementById("plugin1");
+    var p2 = document.getElementById("plugin2");
 
-    ok(p.streamTest('plugin-stream-referer.sjs', false, null, null,
+    ok(p.streamTest("plugin-stream-referer.sjs", false, null, null,
                     function(r, t) {
                       is(r, 0, "GET plugin-stream-referer.sjs");
                       is(t, "Referer found: " + window.location,
                          "GET Referer correct");
                       testDone();
                     }, null, true), "referer GET");
 
-    ok(p.streamTest('plugin-stream-referer.sjs', true, "Dummy Data", null,
+    ok(p.streamTest("plugin-stream-referer.sjs", true, "Dummy Data", null,
                     function(r, t) {
                       is(r, 0, "POST plugin-stream-referer.sjs");
                       is(t, "No Referer found", "POST Referer absent");
                       testDone();
                     }, null, true), "referer POST");
 
-    ok(p2.streamTest('plugin-stream-referer.sjs', false, null, null,
+    ok(p2.streamTest("plugin-stream-referer.sjs", false, null, null,
                      function(r, t) {
                        is(r, 0, "GET plugin-stream-referer.sjs (2)");
                        var expectedreferer = String(window.location).replace("test_pluginstream_referer.html", "loremipsum.xtest");
                        is(t, "Referer found: " + expectedreferer,
                           "GET Referer correct with plugin src");
                        testDone();
                      }, null, true), "referer GET (2)");
-                            
   }
   </script>
 
   <p id="display"></p>
 
   <embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
   <embed id="plugin2" type="application/x-test" src="loremipsum.xtest" width="200" height="200"></embed>
--- a/dom/plugins/test/mochitest/test_pluginstream_src_dynamic.html
+++ b/dom/plugins/test/mochitest/test_pluginstream_src_dynamic.html
@@ -25,19 +25,19 @@
    - NPN_GetURL, using a frame, so that the stream content should 
    - be displayed in the frame in the browser.
    -
    - We create the object element dynamically, which in some cases has caused us to deliver the data=""
    - stream twice. This verifies that we only deliver the data="" stream once.
    -->
 
   <script type="text/javascript">
-    var e = document.createElement('object');
-    e.setAttribute('data', 'loremipsum.xtest');
-    e.setAttribute('type', 'application/x-test');
-    e.setAttribute('streammode', 'normal');
-    e.setAttribute('streamchunksize', '100');
-    e.setAttribute('frame', 'testframe');
-    e.setAttribute('style', 'width: 400px; height: 100px;');
+    var e = document.createElement("object");
+    e.setAttribute("data", "loremipsum.xtest");
+    e.setAttribute("type", "application/x-test");
+    e.setAttribute("streammode", "normal");
+    e.setAttribute("streamchunksize", "100");
+    e.setAttribute("frame", "testframe");
+    e.setAttribute("style", "width: 400px; height: 100px;");
     document.body.appendChild(e);
   </script>
 </body>
 </html>
--- a/dom/plugins/test/mochitest/test_pluginstream_src_referer.html
+++ b/dom/plugins/test/mochitest/test_pluginstream_src_referer.html
@@ -9,17 +9,17 @@
 <body>
   <p id="display"></p>
 
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   function frameLoaded() {
-    var testframe = document.getElementById('pluginframe');
+    var testframe = document.getElementById("pluginframe");
     // We have to use SpecialPowers because nptest.cpp prepends
     // data: whichs makes the frame cross origin with the including page.
     var wrappedDoc = SpecialPowers.wrap(testframe).contentDocument;
     var content = wrappedDoc.body.innerHTML;
     if (!content.length)
       return;
 
     is(content, "Referer found: " + window.location);
--- a/dom/plugins/test/mochitest/test_positioning.html
+++ b/dom/plugins/test/mochitest/test_positioning.html
@@ -17,17 +17,17 @@
 
   <script type="application/javascript">
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   var p = null;
 
   function startTest() {
-    p = document.getElementById('theplugin');
+    p = document.getElementById("theplugin");
 
     // Wait for the plugin to have painted once
     var interval = setInterval(function() {
       if (!p.getPaintCount())
         return;
 
       clearInterval(interval);
       doScroll();
--- a/dom/plugins/test/mochitest/test_propertyAndMethod.html
+++ b/dom/plugins/test/mochitest/test_propertyAndMethod.html
@@ -6,17 +6,17 @@
     <script type="text/javascript" src="plugin-utils.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   </head>
 
   <body onload="run()">
 
     <script class="testbody" type="application/javascript">
       if (typeof Object.getPrototypeOf !== "function") {
-        if (typeof "test".__proto__ === "object") {
+        if (typeof"test".__proto__ === "object") {
           Object.getPrototypeOf = function(object) {
             return object.__proto__;
           };
         } else {
           Object.getPrototypeOf = function(object) {
             // May break if the constructor has been tampered with
             return object.constructor.prototype;
           };
--- 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');
+    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_streamNotify.html
+++ b/dom/plugins/test/mochitest/test_streamNotify.html
@@ -6,27 +6,27 @@
 <body onload="runTests()">
   <script class="testbody" type="application/javascript">
   SimpleTest.waitForExplicitFinish();
   SimpleTest.requestFlakyTimeout("untriaged");
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   var pending = 5;
   function testDone() {
-    dump("testDone: " + pending + "\n")
+    dump("testDone: " + pending + "\n");
     --pending;
 
     // Wait for a bit so that any unexpected notifications from the
     // malformed data or null-post tests are received.
     if (0 == pending)
       window.setTimeout(SimpleTest.finish, 2000);
   }
 
   function runTests() {
-    var p = document.getElementById('plugin1');
+    var p = document.getElementById("plugin1");
 
     ok(p.streamTest("loremipsum.txt", false, null, null,
                     function(r, t) {
                       is(r, 0, "GET loremipsum.txt");
                       is(t.substr(0, 11), "Lorem ipsum",
                          "GET loremipsum.txt correct");
                       testDone();
                     }, null, true), "streamTest GET");
--- a/dom/plugins/test/mochitest/test_streamatclose.html
+++ b/dom/plugins/test/mochitest/test_streamatclose.html
@@ -13,17 +13,17 @@
   SimpleTest.requestFlakyTimeout("untriaged");
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   var urlnotified = false;
 
   var p = null;
 
   function startTest() {
-    p = document.getElementById('embedtest');
+    p = document.getElementById("embedtest");
     ok(p.streamTest("neverending.sjs", false, null, null,
                     function(r, t) {
                       is(r, 2, "Stream should have failed");
                       urlnotified = true;
                     }, null, true), "neverending.sjs started successfully");
 
     setTimeout(removePlugin, 500);
   }
--- a/dom/plugins/test/mochitest/test_stringHandling.html
+++ b/dom/plugins/test/mochitest/test_stringHandling.html
@@ -11,17 +11,17 @@
 <body onload="runTests()">
   <script class="testbody" type="application/javascript">
     SimpleTest.waitForExplicitFinish();
     setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
     function runTests() {
       try {
         var plugin = document.getElementById("plugin1");
-        var badData = 'foo ' + '\x00'.repeat(260000);
+        var badData = "foo " + "\x00".repeat(260000);
         var ret = plugin.echoString(badData);
         ok(true, "Did not crash.");
         is(ret, badData, "Returned string should equal what we passed in.");
       } catch (e) {
         ok(false, "Failed to call plugin.echoString() properly.");
       } finally {
         SimpleTest.finish();
       }
--- a/dom/plugins/test/mochitest/test_visibility.html
+++ b/dom/plugins/test/mochitest/test_visibility.html
@@ -30,41 +30,41 @@
       ok(false, "Plugin should not paint until it is visible!");
     };
 
     ok(!p.isVisible(), "Plugin should not be visible.");
     paintCountIs(p, 0, "Plugin should not have painted.");
 
     didPaint = part2;
 
-    p.style.visibility = 'visible';
+    p.style.visibility = "visible";
   }
 
   function part2() {
     ok(p.isVisible(), "Plugin should now be visible.");
     paintCountIs(p, 1, "Plugin should have painted once.");
 
     didPaint = part3;
 
-    p.setColor('FF0000FF'); // this causes an invalidate/repaint
+    p.setColor("FF0000FF"); // this causes an invalidate/repaint
   }
 
   const kTimeout = 5000; // 5 seconds
   var part4GiveUp;
   var part4Interval;
 
   function part3() {
     ok(p.isVisible(), "Plugin should still be visible.");
     paintCountIs(p, 2, "Plugin should have painted twice.");
 
     didPaint = function() {
       ok(false, "Plugin should not paint when it is invisible.");
     };
 
-    p.style.visibility = 'hidden';
+    p.style.visibility = "hidden";
 
     part4GiveUp = Date.now() + kTimeout;
     part4Interval = setInterval(part4, 100);
   }
 
   function part4() {
     if (p.isVisible()) {
       if (Date.now() < part4GiveUp)
@@ -73,17 +73,17 @@
       ok(false, "Plugin never became invisible in part4.");
       SimpleTest.finish();
       return;
     }
 
     clearInterval(part4Interval);
 
     ok(true, "Plugin became invisible again.");
-    p.setColor('FF00FF00');
+    p.setColor("FF00FF00");
     setTimeout(SimpleTest.finish, 500);
     // wait to make sure we don't actually paint
   }
 
   function inPaint() {
     // We're actually in the middle of painting the plugin so don't do anything
     // complex here, for the sake of cases where async plugin painting isn't
     // enabled yet
@@ -91,10 +91,10 @@
     // Don't run that didPaint callback again
     didPaint = function() {};
   }
   </script>
 
   <embed id="theplugin" class="hidden" type="application/x-test" drawmode="solid" color="FFFF0000" paintscript="inPaint()"></embed>
   
   <script type="application/javascript">
-  var p = document.getElementById('theplugin');
+  var p = document.getElementById("theplugin");
   </script>
--- a/dom/plugins/test/mochitest/test_windowless_flash.html
+++ b/dom/plugins/test/mochitest/test_windowless_flash.html
@@ -7,19 +7,19 @@
 </head>
 <body onload="runTests()">
   <script type="application/javascript" src="plugin-utils.js"></script>
   <script type="text/javascript">
   SimpleTest.waitForExplicitFinish();
   SpecialPowers.setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   function runTests() {
-    var p1 = document.getElementById('plugin1');
-    var p2 = document.getElementById('plugin2');
-    var p3 = document.getElementById('plugin3');
+    var p1 = document.getElementById("plugin1");
+    var p2 = document.getElementById("plugin2");
+    var p3 = document.getElementById("plugin3");
     is(p1.hasWidget(), false, "Flash is always windowless mode even if wmode=window");
     is(p2.hasWidget(), false, "Flash is always windowless mode even if wmode=anything");
     is(p3.hasWidget(), false, "Flash is always windowless mode even if no wmode");
     SimpleTest.finish();
   }
 
   </script>
   <p id="display"></p>
--- a/dom/plugins/test/mochitest/test_windowless_ime.html
+++ b/dom/plugins/test/mochitest/test_windowless_ime.html
@@ -16,20 +16,20 @@ function runTests() {
 
   plugin.focus();
   // FYI: "compositionstart" will be dispatched automatically.
   let data = "composition";
   synthesizeCompositionChange({
     composition: {
       string: data,
       clauses: [
-        { length: data.length, attr: COMPOSITION_ATTR_RAW_CLAUSE }
-      ]
+        { length: data.length, attr: COMPOSITION_ATTR_RAW_CLAUSE },
+      ],
     },
-    caret: {start: data.length, length: 0}
+    caret: {start: data.length, length: 0},
   });
   is(plugin.getLastCompositionText(), data, "can get composition string");
   synthesizeComposition({ type: "compositioncommit", data: "" });
 
   synthesizeComposition({ type: "compositionstart", data: "" });
   is(plugin.getLastCompositionText(), "", "can get empty composition string");
   synthesizeComposition({ type: "compositioncommit", data: "" });
   SimpleTest.finish();
--- a/dom/plugins/test/mochitest/test_x11_error_crash.html
+++ b/dom/plugins/test/mochitest/test_x11_error_crash.html
@@ -8,20 +8,19 @@
   SimpleTest.waitForExplicitFinish();
   SimpleTest.requestFlakyTimeout(
     "crashAndGetCrashServiceRecord() polls for async crash recording");
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   window.frameLoaded = function frameLoaded_toCrash() {
     SimpleTest.expectChildProcessCrash();
 
-    crashAndGetCrashServiceRecord("triggerXError", function (cm, crash) {
+    crashAndGetCrashServiceRecord("triggerXError", function(cm, crash) {
       var isPluginCrash = crash.isOfType(cm.PROCESS_TYPE_PLUGIN, cm.CRASH_TYPE_CRASH);
       ok(isPluginCrash, "Record should be a plugin crash");
       if (!isPluginCrash) {
         dump("Crash type: " + crash.type + "\n");
       }
       SimpleTest.finish();
     });
-
-  }
+  };
   </script>
   <iframe id="iframe1" src="crashing_subpage.html" width="600" height="600"></iframe>
--- a/dom/plugins/test/mochitest/test_zero_opacity.html
+++ b/dom/plugins/test/mochitest/test_zero_opacity.html
@@ -9,17 +9,17 @@
 <body onload="startTest()">
   <script type="application/javascript">
   SimpleTest.waitForExplicitFinish();
   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
 
   var p = null;
 
   function startTest() {
-    p = document.getElementById('theplugin');
+    p = document.getElementById("theplugin");
     if (!p.hasWidget()) {
       todo(false, "This test is only relevant for windowed plugins");
       SimpleTest.finish();
       return;
     }
 
     // Wait for the plugin to have painted once.
     var interval = setInterval(function() {
@@ -30,16 +30,16 @@
       doTest();
       SimpleTest.finish();
     }, 100);
   }
 
   function doTest() {
     is(p.getClipRegionRectCount(), 1, "getClipRegionRectCount should be a single rect");
     var dpr = window.devicePixelRatio;
-    is(p.getClipRegionRectEdge(0,2) - p.getClipRegionRectEdge(0,0), 100 * dpr, "width of clip region rect");
-    is(p.getClipRegionRectEdge(0,3) - p.getClipRegionRectEdge(0,1), 50 * dpr, "height of clip region rect");
+    is(p.getClipRegionRectEdge(0, 2) - p.getClipRegionRectEdge(0, 0), 100 * dpr, "width of clip region rect");
+    is(p.getClipRegionRectEdge(0, 3) - p.getClipRegionRectEdge(0, 1), 50 * dpr, "height of clip region rect");
   }
   </script>
 
   <p id="display"></p>
 
   <embed id="theplugin" type="application/x-test" width="100" height="50" style="opacity:0" wmode="window"></embed>