Bug 1532941 - Enable ESLint for uriloader (automatic changes). r=Standard8,qdot
authorSyeda Asra Arshia Qadri <asra.qadri@gmail.com>
Thu, 14 Mar 2019 11:19:44 +0000
changeset 521883 9e322c3c5db7941730308e3022222a8904081b99
parent 521882 6ccfa8614ddda99124d4b08bfd2cd886ff88e202
child 521884 c1dfac003eb7d621d9244c4232e9fce25f0d2b41
push id10870
push usernbeleuzu@mozilla.com
push dateFri, 15 Mar 2019 20:00:07 +0000
treeherdermozilla-beta@c594aee5b7a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8, qdot
bugs1532941
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 1532941 - Enable ESLint for uriloader (automatic changes). r=Standard8,qdot Differential Revision: https://phabricator.services.mozilla.com/D22308
uriloader/exthandler/HandlerService.js
uriloader/exthandler/tests/mochitest/browser_auto_close_window.js
uriloader/exthandler/tests/mochitest/browser_web_protocol_handlers.js
uriloader/exthandler/tests/mochitest/handlerApp.xhtml
uriloader/exthandler/tests/mochitest/handlerApps.js
uriloader/exthandler/tests/mochitest/head.js
uriloader/exthandler/tests/mochitest/test_unknown_ext_protocol_handlers.html
uriloader/exthandler/tests/mochitest/test_unsafeBidiChars.xhtml
uriloader/exthandler/tests/mochitest/test_web_protocol_handlers.html
uriloader/exthandler/tests/mochitest/unsafeBidi_chromeScript.js
uriloader/exthandler/tests/unit/head.js
uriloader/exthandler/tests/unit/test_getTypeFromExtension_with_empty_Content_Type.js
uriloader/exthandler/tests/unit/test_handlerService.js
uriloader/exthandler/tests/unit/test_handlerService_store.js
uriloader/exthandler/tests/unit/test_punycodeURIs.js
--- a/uriloader/exthandler/HandlerService.js
+++ b/uriloader/exthandler/HandlerService.js
@@ -24,17 +24,17 @@ function HandlerService() {
 }
 
 HandlerService.prototype = {
 
   classID: Components.ID("{220cc253-b60f-41f6-b9cf-fdcb325f970f}"),
   QueryInterface: ChromeUtils.generateQI([
     Ci.nsISupportsWeakReference,
     Ci.nsIHandlerService,
-    Ci.nsIObserver
+    Ci.nsIObserver,
   ]),
 
   __store: null,
   get _store() {
     if (!this.__store) {
       this.__store = new JSONFile({
         path: OS.Path.join(OS.Constants.Path.profileDir, "handlers.json"),
         dataPostProcessor: this._dataPostProcessor.bind(this),
@@ -106,17 +106,16 @@ HandlerService.prototype = {
   _injectDefaultProtocolHandlers() {
     let schemesPrefBranch = Services.prefs.getBranch("gecko.handlerService.schemes.");
     let schemePrefList = schemesPrefBranch.getChildList("");
 
     let schemes = {};
 
     // read all the scheme prefs into a hash
     for (let schemePrefName of schemePrefList) {
-
       let [scheme, handlerNumber, attribute] = schemePrefName.split(".");
 
       try {
         let attrData =
           schemesPrefBranch.getComplexValue(schemePrefName,
                                             Ci.nsIPrefLocalizedString).data;
         if (!(scheme in schemes)) {
           schemes[scheme] = {};
@@ -135,17 +134,17 @@ HandlerService.prototype = {
 
       // cache the possible handlers to avoid extra xpconnect traversals.
       let possibleHandlers = protoInfo.possibleApplicationHandlers;
 
       for (let handlerNumber of Object.keys(schemes[scheme])) {
         let handlerApp = this.handlerAppFromSerializable(schemes[scheme][handlerNumber]);
         // If there is already a handler registered with the same template
         // URL, the newly added one will be ignored when saving.
-        possibleHandlers.appendElement(handlerApp, false);
+        possibleHandlers.appendElement(handlerApp);
       }
 
       this.store(protoInfo);
     }
   },
 
   /**
    * Execute any migrations. Migrations are defined here for any changes or removals for
@@ -259,27 +258,27 @@ HandlerService.prototype = {
       //
       // Note: our caller still needs to yield periodically when iterating
       // the enumerator and accessing handler properties to avoid monopolizing
       // the main thread.
       //
       let handler = new Proxy(
         {
           QueryInterface: ChromeUtils.generateQI([Ci.nsIHandlerInfo]),
-          type: type,
+          type,
           get _handlerInfo() {
             delete this._handlerInfo;
             return this._handlerInfo = gExternalProtocolService.getProtocolHandlerInfo(type);
           },
         },
         {
-          get: function(target, name) {
+          get(target, name) {
             return target[name] || target._handlerInfo[name];
           },
-          set: function(target, name, value) {
+          set(target, name, value) {
             target._handlerInfo[name] = value;
           },
         },
       );
       handlers.appendElement(handler);
     }
     return handlers.enumerate(Ci.nsIHandlerInfo);
   },
--- a/uriloader/exthandler/tests/mochitest/browser_auto_close_window.js
+++ b/uriloader/exthandler/tests/mochitest/browser_auto_close_window.js
@@ -15,22 +15,22 @@ const MOCK_HELPERAPP_DIALOG_CID =
 let registrar = Components.manager
                           .QueryInterface(Ci.nsIComponentRegistrar);
 let curDialogResolve = null;
 
 function HelperAppLauncherDialog() {
 }
 
 HelperAppLauncherDialog.prototype = {
-  show: function(aLauncher, aWindowContext, aReason) {
+  show(aLauncher, aWindowContext, aReason) {
     ok(true, "Showing the helper app dialog");
     curDialogResolve(aWindowContext);
     executeSoon(() => { aLauncher.cancel(Cr.NS_ERROR_ABORT); });
   },
-  QueryInterface: ChromeUtils.generateQI([Ci.nsIHelperAppLauncherDialog])
+  QueryInterface: ChromeUtils.generateQI([Ci.nsIHelperAppLauncherDialog]),
 };
 
 function promiseHelperAppDialog() {
   return new Promise((resolve) => {
     curDialogResolve = resolve;
   });
 }
 
--- a/uriloader/exthandler/tests/mochitest/browser_web_protocol_handlers.js
+++ b/uriloader/exthandler/tests/mochitest/browser_web_protocol_handlers.js
@@ -24,17 +24,17 @@ add_task(async function() {
   is(protoInfo.preferredAction, protoInfo.useHelperApp,
      "using a helper application is the preferred action");
   ok(!protoInfo.preferredApplicationHandler, "no preferred handler is set");
   let handlers = protoInfo.possibleApplicationHandlers;
   is(1, handlers.length, "only one handler registered for web+testprotocol");
   let handler = handlers.queryElementAt(0, Ci.nsIHandlerApp);
   ok(handler instanceof Ci.nsIWebHandlerApp, "the handler is a web handler");
   is(handler.uriTemplate, "https://example.com/foobar?uri=%s",
-     "correct url template")
+     "correct url template");
   protoInfo.preferredApplicationHandler = handler;
   protoInfo.alwaysAskBeforeHandling = false;
   const handlerSvc = Cc["@mozilla.org/uriloader/handler-service;1"].
                        getService(Ci.nsIHandlerService);
   handlerSvc.store(protoInfo);
 
   // Middle-click a testprotocol link and check the new tab is correct
   let link = "#link";
--- a/uriloader/exthandler/tests/mochitest/handlerApp.xhtml
+++ b/uriloader/exthandler/tests/mochitest/handlerApp.xhtml
@@ -5,25 +5,24 @@
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body onload="onLoad()">
 Pseudo Web Handler App
 
 <script class="testbody" type="text/javascript">
 <![CDATA[
 function onLoad() {
-
   // if we have a window.opener, this must be the windowContext
   // instance of this test.  check that we got the URI right and clean up.
   if (window.opener) {
-    window.opener.is(location.search, 
-                     "?uri=" + encodeURIComponent(window.opener.testURI), 
+    window.opener.is(location.search,
+                     "?uri=" + encodeURIComponent(window.opener.testURI),
                      "uri passed to web-handler app");
     window.opener.SimpleTest.finish();
-  } 
+  }
 
   window.close();
 }
 ]]>
 </script>
 
 </body>
 </html>
--- a/uriloader/exthandler/tests/mochitest/handlerApps.js
+++ b/uriloader/exthandler/tests/mochitest/handlerApps.js
@@ -3,63 +3,61 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // handlerApp.xhtml grabs this for verification purposes via window.opener
 var testURI = "webcal://127.0.0.1/rheeeeet.html";
 
 const Cc = SpecialPowers.Cc;
 
 function test() {
-
   // set up the web handler object
   var webHandler = Cc["@mozilla.org/uriloader/web-handler-app;1"].
     createInstance(SpecialPowers.Ci.nsIWebHandlerApp);
   webHandler.name = "Test Web Handler App";
   webHandler.uriTemplate =
-      "https://example.com/tests/uriloader/exthandler/tests/mochitest/" + 
+      "https://example.com/tests/uriloader/exthandler/tests/mochitest/" +
       "handlerApp.xhtml?uri=%s";
-  
+
   // set up the uri to test with
   var ioService = Cc["@mozilla.org/network/io-service;1"].
     getService(SpecialPowers.Ci.nsIIOService);
   var uri = ioService.newURI(testURI);
 
   // create a window, and launch the handler in it
   var newWindow = window.open("", "handlerWindow", "height=300,width=300");
   var windowContext = SpecialPowers.wrap(newWindow).docShell;
- 
+
   webHandler.launchWithURI(uri, windowContext);
 
   // if we get this far without an exception, we've at least partly passed
   // (remaining check in handlerApp.xhtml)
   ok(true, "webHandler launchWithURI (existing window/tab) started");
 
   // make the web browser launch in its own window/tab
   webHandler.launchWithURI(uri);
-  
+
   // if we get this far without an exception, we've passed
   ok(true, "webHandler launchWithURI (new window/tab) test started");
 
   // set up the local handler object
   var localHandler = Cc["@mozilla.org/uriloader/local-handler-app;1"].
     createInstance(SpecialPowers.Ci.nsILocalHandlerApp);
   localHandler.name = "Test Local Handler App";
-  
+
   // get a local app that we know will be there and do something sane
   var osString = Cc["@mozilla.org/xre/app-info;1"].
                  getService(SpecialPowers.Ci.nsIXULRuntime).OS;
 
   var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
                getService(SpecialPowers.Ci.nsIDirectoryServiceProvider);
   if (osString == "WINNT") {
     var windowsDir = dirSvc.getFile("WinD", {});
     var exe = windowsDir.clone().QueryInterface(SpecialPowers.Ci.nsIFile);
     exe.appendRelativePath("SYSTEM32\\HOSTNAME.EXE");
-
-  } else if (osString == "Darwin") { 
+  } else if (osString == "Darwin") {
     var localAppsDir = dirSvc.getFile("LocApp", {});
     exe = localAppsDir.clone();
     exe.append("iCal.app"); // lingers after the tests finish, but this seems
                             // seems better than explicitly killing it, since
                             // developers who run the tests locally may well
                             // information in their running copy of iCal
 
     if (navigator.userAgent.match(/ SeaMonkey\//)) {
@@ -80,28 +78,27 @@ function test() {
   }
 
   localHandler.executable = exe;
   localHandler.launchWithURI(ioService.newURI(testURI));
 
   // if we get this far without an exception, we've passed
   ok(true, "localHandler launchWithURI test");
 
-  // if we ever decide that killing iCal is the right thing to do, change 
+  // if we ever decide that killing iCal is the right thing to do, change
   // the if statement below from "NOTDarwin" to "Darwin"
   if (osString == "NOTDarwin") {
-
     var killall = Cc["@mozilla.org/file/local;1"].
                   createInstance(SpecialPowers.Ci.nsIFile);
     killall.initWithPath("/usr/bin/killall");
-  
+
     var process = Cc["@mozilla.org/process/util;1"].
                   createInstance(SpecialPowers.Ci.nsIProcess);
     process.init(killall);
-    
-    var args = ['iCal'];
+
+    var args = ["iCal"];
     process.run(false, args, args.length);
   }
 
   SimpleTest.waitForExplicitFinish();
 }
 
 test();
--- a/uriloader/exthandler/tests/mochitest/head.js
+++ b/uriloader/exthandler/tests/mochitest/head.js
@@ -36,17 +36,17 @@ function createMockedObjects(createHandl
     let mockedHandlerApp = createMockedHandlerApp();
     internalMockedMIME.description = mockedHandlerApp.detailedDescription;
     internalMockedMIME.possibleApplicationHandlers.appendElement(mockedHandlerApp);
     internalMockedMIME.preferredApplicationHandler = mockedHandlerApp;
   }
 
   // Proxy for the mocked MIME info for faking the read-only attributes
   let mockedMIME = new Proxy(internalMockedMIME, {
-    get: function (target, property) {
+    get(target, property) {
       switch (property) {
       case "hasDefaultHandler":
         return true;
       case "defaultDescription":
         return "Default description";
       default:
         return target[property];
       }
@@ -63,17 +63,17 @@ function createMockedObjects(createHandl
     cancel() {},
     launchWithApplication() {},
     setWebProgressListener() {},
     saveDestinationAvailable() {},
     contentLength: 42,
     targetFile: null, // never read
     // PRTime is microseconds since epoch, Date.now() returns milliseconds:
     timeDownloadStarted: Date.now() * 1000,
-    QueryInterface: ChromeUtils.generateQI([Ci.nsICancelable, Ci.nsIHelperAppLauncher])
+    QueryInterface: ChromeUtils.generateQI([Ci.nsICancelable, Ci.nsIHelperAppLauncher]),
   };
 
   registerCleanupFunction(function() {
     // remove the mocked mime info from database.
     let mockHandlerInfo = gMimeSvc.getFromTypeAndExtension("text/x-test-handler", null);
     if (gHandlerSvc.exists(mockHandlerInfo)) {
       gHandlerSvc.remove(mockHandlerInfo);
     }
--- a/uriloader/exthandler/tests/mochitest/test_unknown_ext_protocol_handlers.html
+++ b/uriloader/exthandler/tests/mochitest/test_unknown_ext_protocol_handlers.html
@@ -17,12 +17,12 @@ window.onload = () => {
   try {
     testFrame.contentWindow.location.href = "unknownextproto:";
     ok(true, "There is no error reporting for unknown external protocol navigation.");
   } catch (e) {
     ok(false, "There should be no error reporting for unknown external protocol navigation.");
   }
 
   SimpleTest.finish();
-}
+};
 </script>
 </body>
 </html>
--- a/uriloader/exthandler/tests/mochitest/test_unsafeBidiChars.xhtml
+++ b/uriloader/exthandler/tests/mochitest/test_unsafeBidiChars.xhtml
@@ -11,17 +11,17 @@
 <script type="text/javascript">
 <![CDATA[
 
 var unsafeBidiChars = [
   "\xe2\x80\xaa", // LRE
   "\xe2\x80\xab", // RLE
   "\xe2\x80\xac", // PDF
   "\xe2\x80\xad", // LRO
-  "\xe2\x80\xae"  // RLO
+  "\xe2\x80\xae",  // RLO
 ];
 
 var tests = [
   "{1}.test",
   "{1}File.test",
   "Fi{1}le.test",
   "File{1}.test",
   "File.{1}test",
@@ -30,17 +30,17 @@ var tests = [
   "File.{1}",
 ];
 
 function replace(name, x) {
   return name.replace(/\{1\}/, x);
 }
 
 function sanitize(name) {
-  return replace(name, '_');
+  return replace(name, "_");
 }
 
 const INSECURE_REGISTER_PREF = "dom.registerProtocolHandler.insecure.enabled";
 
 add_task(async function() {
   SpecialPowers.setBoolPref(INSECURE_REGISTER_PREF, false);
   let url = SimpleTest.getTestFileURL("unsafeBidi_chromeScript.js");
   let chromeScript = SpecialPowers.loadChromeScript(url);
--- a/uriloader/exthandler/tests/mochitest/test_web_protocol_handlers.html
+++ b/uriloader/exthandler/tests/mochitest/test_web_protocol_handlers.html
@@ -10,17 +10,17 @@
 <p id="display"></p>
 <iframe id="test"></iframe>
 <script type="text/javascript">
 add_task(async function() {
   await SpecialPowers.pushPrefEnv({
     set: [
       ["dom.registerContentHandler.enabled", true],
       ["dom.registerProtocolHandler.insecure.enabled", false],
-    ]
+    ],
   });
 
   let result = "registerProtocolHandler" in navigator;
   ok(!result, "Insecure registerProtocolHandler is undefined");
 });
 </script>
 </body>
 </html>
--- a/uriloader/exthandler/tests/mochitest/unsafeBidi_chromeScript.js
+++ b/uriloader/exthandler/tests/mochitest/unsafeBidi_chromeScript.js
@@ -4,20 +4,20 @@ const HELPERAPP_DIALOG_CONTRACT = "@mozi
 const HELPERAPP_DIALOG_CID =
   Components.ID(Cc[HELPERAPP_DIALOG_CONTRACT].number);
 
 const FAKE_CID = Cc["@mozilla.org/uuid-generator;1"].
                    getService(Ci.nsIUUIDGenerator).generateUUID();
 
 function HelperAppLauncherDialog() {}
 HelperAppLauncherDialog.prototype = {
-  show: function(aLauncher, aWindowContext, aReason) {
+  show(aLauncher, aWindowContext, aReason) {
     sendAsyncMessage("suggestedFileName", aLauncher.suggestedFileName);
   },
-  QueryInterface: ChromeUtils.generateQI([Ci.nsIHelperAppLauncherDialog])
+  QueryInterface: ChromeUtils.generateQI([Ci.nsIHelperAppLauncherDialog]),
 };
 
 var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
 registrar.registerFactory(FAKE_CID, "", HELPERAPP_DIALOG_CONTRACT,
                           XPCOMUtils._getFactory(HelperAppLauncherDialog));
 
 addMessageListener("unregister", function() {
   registrar.registerFactory(HELPERAPP_DIALOG_CID, "",
--- a/uriloader/exthandler/tests/unit/head.js
+++ b/uriloader/exthandler/tests/unit/head.js
@@ -32,17 +32,17 @@ let jsonPath = OS.Path.join(OS.Constants
  */
 let unloadHandlerStore = async function() {
   // If this function is called before the nsIHandlerService instance has been
   // initialized for the first time, the observer below will not be registered.
   // We have to force initialization to prevent the function from stalling.
   gHandlerService;
 
   let promise = TestUtils.topicObserved("handlersvc-json-replace-complete");
-  Services.obs.notifyObservers(null, "handlersvc-json-replace", null);
+  Services.obs.notifyObservers(null, "handlersvc-json-replace");
   await promise;
 };
 
 /**
  * Unloads the data store and deletes it.
  */
 let deleteHandlerStore = async function() {
   await unloadHandlerStore();
--- a/uriloader/exthandler/tests/unit/test_getTypeFromExtension_with_empty_Content_Type.js
+++ b/uriloader/exthandler/tests/unit/test_getTypeFromExtension_with_empty_Content_Type.js
@@ -32,17 +32,17 @@ function run_test() {
    */
   function MockWindowsRegKey(aWrappedObject) {
     this._wrappedObject = aWrappedObject;
 
     // This function creates a forwarding function for wrappedObject
     function makeForwardingFunction(functionName) {
       return function() {
         return aWrappedObject[functionName].apply(aWrappedObject, arguments);
-      }
+      };
     }
 
     // Forward all the functions that are not explicitly overridden
     for (var propertyName in aWrappedObject) {
       if (!(propertyName in this)) {
         if (typeof aWrappedObject[propertyName] == "function") {
           this[propertyName] = makeForwardingFunction(propertyName);
         } else {
@@ -54,37 +54,37 @@ function run_test() {
 
   MockWindowsRegKey.prototype = {
     // --- Overridden nsISupports interface functions ---
 
     QueryInterface: ChromeUtils.generateQI([Ci.nsIWindowsRegKey]),
 
     // --- Overridden nsIWindowsRegKey interface functions ---
 
-    open: function(aRootKey, aRelPath, aMode) {
+    open(aRootKey, aRelPath, aMode) {
       // Remember the provided root key and path
       this._rootKey = aRootKey;
       this._relPath = aRelPath;
 
       // Create the actual registry key
       return this._wrappedObject.open(aRootKey, aRelPath, aMode);
     },
 
-    openChild: function(aRelPath, aMode) {
+    openChild(aRelPath, aMode) {
       // Open the child key and wrap it
       var innerKey = this._wrappedObject.openChild(aRelPath, aMode);
       var key = new MockWindowsRegKey(innerKey);
 
       // Set the properties of the child key and return it
       key._rootKey = this._rootKey;
       key._relPath = this._relPath + aRelPath;
       return key;
     },
 
-    createChild: function(aRelPath, aMode) {
+    createChild(aRelPath, aMode) {
       // Create the child key and wrap it
       var innerKey = this._wrappedObject.createChild(aRelPath, aMode);
       var key = new MockWindowsRegKey(innerKey);
 
       // Set the properties of the child key and return it
       key._rootKey = this._rootKey;
       key._relPath = this._relPath + aRelPath;
       return key;
@@ -93,52 +93,52 @@ function run_test() {
     get childCount() {
       return this._wrappedObject.childCount;
     },
 
     get valueCount() {
       return this._wrappedObject.valueCount;
     },
 
-    readStringValue: function(aName) {
+    readStringValue(aName) {
       // If this is the key under test, return a fake value
       if (this._rootKey == Ci.nsIWindowsRegKey.ROOT_KEY_CLASSES_ROOT &&
           this._relPath.toLowerCase() == ".txt" &&
           aName.toLowerCase() == "content type") {
         return "";
       }
 
       // Return the real value in the registry
       return this._wrappedObject.readStringValue(aName);
-    }
+    },
   };
 
   // --- Mock nsIWindowsRegKey factory ---
 
   var componentRegistrar = Components.manager.
                            QueryInterface(Ci.nsIComponentRegistrar);
 
   var originalWindowsRegKeyCID;
   var mockWindowsRegKeyFactory;
 
   const kMockCID = Components.ID("{9b23dfe9-296b-4740-ba1c-d39c9a16e55e}");
   const kWindowsRegKeyContractID = "@mozilla.org/windows-registry-key;1";
   const kWindowsRegKeyClassName = "nsWindowsRegKey";
 
   function registerMockWindowsRegKeyFactory() {
     mockWindowsRegKeyFactory = {
-      createInstance: function(aOuter, aIid) {
+      createInstance(aOuter, aIid) {
         if (aOuter != null)
           throw Cr.NS_ERROR_NO_AGGREGATION;
 
         var innerKey = originalWindowsRegKeyFactory.createInstance(null, aIid);
         var key = new MockWindowsRegKey(innerKey);
 
         return key.QueryInterface(aIid);
-      }
+      },
     };
 
     // Preserve the original factory
     originalWindowsRegKeyCID = Cc[kWindowsRegKeyContractID].number;
 
     // Register the mock factory
     componentRegistrar.registerFactory(
       kMockCID,
--- a/uriloader/exthandler/tests/unit/test_handlerService.js
+++ b/uriloader/exthandler/tests/unit/test_handlerService.js
@@ -1,36 +1,36 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 function run_test() {
-  //**************************************************************************//
+  //* *************************************************************************//
   // Constants
 
   const handlerSvc = Cc["@mozilla.org/uriloader/handler-service;1"].
                      getService(Ci.nsIHandlerService);
 
   const mimeSvc = Cc["@mozilla.org/mime;1"].
                   getService(Ci.nsIMIMEService);
 
   const protoSvc = Cc["@mozilla.org/uriloader/external-protocol-service;1"].
                    getService(Ci.nsIExternalProtocolService);
-  
+
   const prefSvc = Cc["@mozilla.org/preferences-service;1"].
                   getService(Ci.nsIPrefService);
-                  
+
   const ioService = Cc["@mozilla.org/network/io-service;1"].
                     getService(Ci.nsIIOService);
 
   const env = Cc["@mozilla.org/process/environment;1"].
               getService(Ci.nsIEnvironment);
 
   const rootPrefBranch = prefSvc.getBranch("");
-  
+
   let noMailto = false;
   if (mozinfo.os == "win") {
     // Check mailto handler from registry.
     // If registry entry is nothing, no mailto handler
     let regSvc = Cc["@mozilla.org/windows-registry-key;1"].
                  createInstance(Ci.nsIWindowsRegKey);
     try {
       regSvc.open(regSvc.ROOT_KEY_CLASSES_ROOT,
@@ -51,28 +51,28 @@ function run_test() {
     try {
       gIOSvc.getAppForURIScheme("mailto");
       noMailto = false;
     } catch (ex) {
       noMailto = true;
     }
   }
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // Sample Data
 
   // It doesn't matter whether or not this nsIFile is actually executable,
   // only that it has a path and exists.  Since we don't know any executable
   // that exists on all platforms (except possibly the application being
   // tested, but there doesn't seem to be a way to get a reference to that
   // from the directory service), we use the temporary directory itself.
   var executable = Services.dirsvc.get("TmpD", Ci.nsIFile);
   // XXX We could, of course, create an actual executable in the directory:
-  //executable.append("localhandler");
-  //if (!executable.exists())
+  // executable.append("localhandler");
+  // if (!executable.exists())
   //  executable.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o755);
 
   var localHandler = Cc["@mozilla.org/uriloader/local-handler-app;1"].
                      createInstance(Ci.nsILocalHandlerApp);
   localHandler.name = "Local Handler";
   localHandler.executable = executable;
 
   var webHandler = Cc["@mozilla.org/uriloader/web-handler-app;1"].
@@ -80,17 +80,17 @@ function run_test() {
   webHandler.name = "Web Handler";
   webHandler.uriTemplate = "http://www.example.com/?%s";
 
   // FIXME: these tests create and manipulate enough variables that it would
   // make sense to move each test into its own scope so we don't run the risk
   // of one test stomping on another's data.
 
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // Test Default Properties
 
   // Get a handler info for a MIME type that neither the application nor
   // the OS knows about and make sure its properties are set to the proper
   // default values.
 
   var handlerInfo = mimeSvc.getFromTypeAndExtension("nonexistent/type", null);
 
@@ -111,46 +111,46 @@ function run_test() {
   // These properties are initialized to default values by the service,
   // so we might as well make sure they're initialized to the right defaults.
   Assert.equal(handlerInfo.description, "");
   Assert.equal(handlerInfo.hasDefaultHandler, false);
   Assert.equal(handlerInfo.defaultDescription, "");
 
   // test some default protocol info properties
   var haveDefaultHandlersVersion = false;
-  try { 
+  try {
     // If we have a defaultHandlersVersion pref, then assume that we're in the
     // firefox tree and that we'll also have default handlers.
     // Bug 395131 has been filed to make this test work more generically
     // by providing our own prefs for this test rather than this icky
     // special casing.
     rootPrefBranch.getCharPref("gecko.handlerService.defaultHandlersVersion");
     haveDefaultHandlersVersion = true;
   } catch (ex) {}
 
-  const kExternalWarningDefault = 
+  const kExternalWarningDefault =
     "network.protocol-handler.warn-external-default";
   prefSvc.setBoolPref(kExternalWarningDefault, true);
 
   // XXX add more thorough protocol info property checking
-  
+
   // no OS default handler exists
   var protoInfo = protoSvc.getProtocolHandlerInfo("x-moz-rheet");
   Assert.equal(protoInfo.preferredAction, protoInfo.alwaysAsk);
   Assert.ok(protoInfo.alwaysAskBeforeHandling);
-  
-  // OS default exists, injected default does not exist, 
+
+  // OS default exists, injected default does not exist,
   // explicit warning pref: false
   const kExternalWarningPrefPrefix = "network.protocol-handler.warn-external.";
   prefSvc.setBoolPref(kExternalWarningPrefPrefix + "http", false);
   protoInfo = protoSvc.getProtocolHandlerInfo("http");
   Assert.equal(0, protoInfo.possibleApplicationHandlers.length);
   Assert.ok(!protoInfo.alwaysAskBeforeHandling);
-  
-  // OS default exists, injected default does not exist, 
+
+  // OS default exists, injected default does not exist,
   // explicit warning pref: true
   prefSvc.setBoolPref(kExternalWarningPrefPrefix + "http", true);
   protoInfo = protoSvc.getProtocolHandlerInfo("http");
   // OS handler isn't included in possibleApplicationHandlers, so length is 0
   // Once they become instances of nsILocalHandlerApp, this number will need
   // to change.
   Assert.equal(0, protoInfo.possibleApplicationHandlers.length);
   Assert.ok(protoInfo.alwaysAskBeforeHandling);
@@ -178,17 +178,16 @@ function run_test() {
     // alwaysAskBeforeHandling is expected to be false here, because although
     // the pref is true, the value in RDF is false. The injected mailto handler
     // carried over the default pref value, and so when we set the pref above
     // to true it's ignored.
     if (noMailto)
       Assert.ok(protoInfo.alwaysAskBeforeHandling);
     else
       Assert.ok(!protoInfo.alwaysAskBeforeHandling);
-
   } else {
     Assert.equal(0, protoInfo.possibleApplicationHandlers.length);
     Assert.ok(protoInfo.alwaysAskBeforeHandling);
   }
 
   if (haveDefaultHandlersVersion) {
     // Now set the value stored in RDF to true, and the pref to false, to make
     // sure we still get the right value. (Basically, same thing as above but
@@ -197,17 +196,17 @@ function run_test() {
     protoInfo.alwaysAskBeforeHandling = true;
     handlerSvc.store(protoInfo);
     protoInfo = protoSvc.getProtocolHandlerInfo("mailto");
     Assert.equal(2, protoInfo.possibleApplicationHandlers.length);
     Assert.ok(protoInfo.alwaysAskBeforeHandling);
   }
 
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // Test Round-Trip Data Integrity
 
   // Test round-trip data integrity by setting the properties of the handler
   // info object to different values, telling the handler service to store the
   // object, and then retrieving a new info object for the same type and making
   // sure its properties are identical.
 
   handlerInfo.preferredAction = Ci.nsIHandlerInfo.useHelperApp;
@@ -333,17 +332,17 @@ function run_test() {
   Assert.equal(possibleHandlersInfo.possibleApplicationHandlers.length, 1);
 
   // Make sure the handler is the one we didn't remove.
   webPossibleHandler = possibleHandlersInfo.possibleApplicationHandlers.
                        queryElementAt(0, Ci.nsIWebHandlerApp);
   Assert.equal(webPossibleHandler.name, webHandler.name);
   Assert.ok(webPossibleHandler.equals(webHandler));
 
-  //////////////////////////////////////////////////////
+  // ////////////////////////////////////////////////////
   // handler info command line parameters and equality
   var localApp = Cc["@mozilla.org/uriloader/local-handler-app;1"].
                  createInstance(Ci.nsILocalHandlerApp);
   var handlerApp = localApp.QueryInterface(Ci.nsIHandlerApp);
 
   Assert.ok(handlerApp.equals(localApp));
 
   localApp.executable = executable;
@@ -356,17 +355,17 @@ function run_test() {
   Assert.ok(localApp.parameterExists("-test1"));
   Assert.ok(localApp.parameterExists("-test2"));
   Assert.ok(!localApp.parameterExists("-false"));
   localApp.clearParameters();
   Assert.equal(0, localApp.parameterCount);
 
   var localApp2 = Cc["@mozilla.org/uriloader/local-handler-app;1"].
                   createInstance(Ci.nsILocalHandlerApp);
-  
+
   localApp2.executable = executable;
 
   localApp.clearParameters();
   Assert.ok(localApp.equals(localApp2));
 
   // equal:
   // cut -d 1 -f 2
   // cut -d 1 -f 2
@@ -390,27 +389,27 @@ function run_test() {
   localApp.appendParameter("-test2");
   localApp.appendParameter("-test3");
   localApp2.appendParameter("-test2");
   localApp2.appendParameter("-test1");
   localApp2.appendParameter("-test3");
   Assert.ok(!localApp2.equals(localApp));
 
   var str;
-  str = localApp.getParameter(0)
+  str = localApp.getParameter(0);
   Assert.equal(str, "-test1");
-  str = localApp.getParameter(1)
+  str = localApp.getParameter(1);
   Assert.equal(str, "-test2");
-  str = localApp.getParameter(2)
+  str = localApp.getParameter(2);
   Assert.equal(str, "-test3");
 
   // FIXME: test round trip integrity for a protocol.
   // FIXME: test round trip integrity for a handler info with a web handler.
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // getTypeFromExtension tests
 
   // test nonexistent extension
   var lolType = handlerSvc.getTypeFromExtension("lolcat");
   Assert.equal(lolType, "");
 
 
   // add a handler for the extension
@@ -428,14 +427,14 @@ function run_test() {
   Assert.ok(handlerSvc.exists(lolHandler));
 
   // test now-existent extension
   lolType = handlerSvc.getTypeFromExtension("lolcat");
   Assert.equal(lolType, "application/lolcat");
 
   // test mailcap entries with needsterminal are ignored on non-Windows non-Mac.
   if (mozinfo.os != "win" && mozinfo.os != "mac") {
-    env.set('PERSONAL_MAILCAP', do_get_file('mailcap').path);
+    env.set("PERSONAL_MAILCAP", do_get_file("mailcap").path);
     handlerInfo = mimeSvc.getFromTypeAndExtension("text/plain", null);
     Assert.equal(handlerInfo.preferredAction, Ci.nsIHandlerInfo.useSystemDefault);
     Assert.equal(handlerInfo.defaultDescription, "sed");
   }
 }
--- a/uriloader/exthandler/tests/unit/test_handlerService_store.js
+++ b/uriloader/exthandler/tests/unit/test_handlerService_store.js
@@ -87,20 +87,20 @@ function assertAllHandlerInfosMatchTestD
     alwaysAskBeforeHandling: true,
     preferredApplicationHandler: {
       name: "Example Default Handler",
       uriTemplate: "https://www.example.com/?url=%s",
     },
     possibleApplicationHandlers: [{
       name: "Example Default Handler",
       uriTemplate: "https://www.example.com/?url=%s",
-    },{
+    }, {
       name: "Example Possible Handler One",
       uriTemplate: "http://www.example.com/?id=1&url=%s",
-    },{
+    }, {
       name: "Example Possible Handler Two",
       uriTemplate: "http://www.example.com/?id=2&url=%s",
     }],
     fileExtensions: [
       "example_two",
       "example_three",
     ],
   });
@@ -121,20 +121,20 @@ function assertAllHandlerInfosMatchTestD
     alwaysAskBeforeHandling: true,
     preferredApplicationHandler: {
       name: "Example Default Handler",
       uriTemplate: "https://www.example.com/?url=%s",
     },
     possibleApplicationHandlers: [{
       name: "Example Default Handler",
       uriTemplate: "https://www.example.com/?url=%s",
-    },{
+    }, {
       name: "Example Possible Handler One",
       uriTemplate: "http://www.example.com/?id=1&url=%s",
-    },{
+    }, {
       name: "Example Possible Handler Two",
       uriTemplate: "http://www.example.com/?id=2&url=%s",
     }],
   });
 
   HandlerServiceTestUtils.assertHandlerInfoMatches(handlerInfos.shift(), {
     type: "examplescheme.usesystemdefault",
     preferredAction: Ci.nsIHandlerInfo.useSystemDefault,
@@ -461,17 +461,17 @@ add_task(async function test_store_delet
   let actualHandlerInfo =
       HandlerServiceTestUtils.getHandlerInfo("example/type.savetodisk");
   HandlerServiceTestUtils.assertHandlerInfoMatches(actualHandlerInfo, {
     type: "example/type.savetodisk",
     preferredAction: Ci.nsIHandlerInfo.saveToDisk,
     alwaysAskBeforeHandling: false,
     fileExtensions: [
       "example_two",
-      "example_three"
+      "example_three",
     ],
   });
 });
 
 /**
  * Tests the "overrideType" argument of "fillHandlerInfo".
  */
 add_task(async function test_fillHandlerInfo_overrideType() {
@@ -532,17 +532,17 @@ function assertAllHandlerInfosMatchDefau
   }
 
   HandlerServiceTestUtils.assertHandlerInfoMatches(handlerInfos.shift(), {
     type: "mailto",
     preferredActionOSDependent: true,
     possibleApplicationHandlers: [{
       name: "Yahoo! Mail",
       uriTemplate: "https://compose.mail.yahoo.com/?To=%s",
-    },{
+    }, {
       name: "Gmail",
       uriTemplate: "https://mail.google.com/mail/?extsrc=mailto&url=%s",
     }],
   });
 
   Assert.equal(handlerInfos.length, 0);
 }
 
--- a/uriloader/exthandler/tests/unit/test_punycodeURIs.js
+++ b/uriloader/exthandler/tests/unit/test_punycodeURIs.js
@@ -17,18 +17,17 @@ function checkFile() {
   // This is where we expect the output
   var tempFile = tempDir.clone();
   tempFile.append(kOutputFile);
 
   if (!tempFile.exists()) {
     if (gCheckExistsAttempts >= kMaxCheckExistAttempts) {
       do_throw("Expected File " + tempFile.path + " does not exist after " +
                  kMaxCheckExistAttempts + " seconds");
-    }
-    else {
+    } else {
       ++gCheckExistsAttempts;
       // Wait a bit longer then try again
       do_timeout(1000, checkFile);
       return;
     }
   }
 
   // Now read it
@@ -59,17 +58,17 @@ function checkFile() {
   if (data.substring(0, 7) != "-psn_0_")
     Assert.equal(data, kExpectedURI);
 
   do_test_finished();
 }
 
 function run_test() {
   if (mozinfo.os == "mac") {
-    dump("INFO | test_punycodeURIs.js | Skipping test on mac, bug 599475")
+    dump("INFO | test_punycodeURIs.js | Skipping test on mac, bug 599475");
     return;
   }
 
   // set up the uri to test with
   var ioService =
     Cc["@mozilla.org/network/io-service;1"]
       .getService(Ci.nsIIOService);
 
@@ -102,17 +101,17 @@ function run_test() {
   // The Write Argument file needs to know where its libraries are, so
   // just force the path variable
   // For mac
   var greDir = Services.dirsvc.get("GreD", Ci.nsIFile);
 
   envSvc.set("DYLD_LIBRARY_PATH", greDir.path);
   // For Linux
   envSvc.set("LD_LIBRARY_PATH", greDir.path);
-  //XXX: handle windows
+  // XXX: handle windows
 
   // Now tell it where we want the file.
   envSvc.set("WRITE_ARGUMENT_FILE", outFile.path);
 
   var uri = ioService.newURI(kTestURI);
 
   // Just check we've got these matching, if we haven't there's a problem
   // with ascii spec or our test case.