Bug 1561435 - Format extensions/, a=automatic-formatting
authorVictor Porof <vporof@mozilla.com>
Fri, 05 Jul 2019 10:46:07 +0200
changeset 481382 599bcfdc8eee2a5c6df4bfebdf5dd94c31d6b501
parent 481381 05c53825de05f73ef88c89d7b9696cd69e49b7d5
child 481383 1982faa9eafa193e25814a6f328386292c8f285c
push id36243
push uservporof@mozilla.com
push dateFri, 05 Jul 2019 14:04:25 +0000
treeherdermozilla-central@041abaa4aa85 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatic-formatting
bugs1561435
milestone69.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 1561435 - Format extensions/, a=automatic-formatting # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D35902
.eslintrc.js
.prettierignore
extensions/permissions/test/browser_permmgr_sync.js
extensions/permissions/test/browser_permmgr_viewsrc.js
extensions/permissions/test/unit/head.js
extensions/permissions/test/unit/test_permmanager_cleardata.js
extensions/permissions/test/unit/test_permmanager_default_pref.js
extensions/permissions/test/unit/test_permmanager_defaults.js
extensions/permissions/test/unit/test_permmanager_expiration.js
extensions/permissions/test/unit/test_permmanager_getAllForURI.js
extensions/permissions/test/unit/test_permmanager_getAllWithTypePrefix.js
extensions/permissions/test/unit/test_permmanager_getPermissionObject.js
extensions/permissions/test/unit/test_permmanager_idn.js
extensions/permissions/test/unit/test_permmanager_load_invalid_entries.js
extensions/permissions/test/unit/test_permmanager_local_files.js
extensions/permissions/test/unit/test_permmanager_matches.js
extensions/permissions/test/unit/test_permmanager_matchesuri.js
extensions/permissions/test/unit/test_permmanager_migrate_4-7.js
extensions/permissions/test/unit/test_permmanager_migrate_4-7_no_history.js
extensions/permissions/test/unit/test_permmanager_migrate_5-7a.js
extensions/permissions/test/unit/test_permmanager_migrate_5-7b.js
extensions/permissions/test/unit/test_permmanager_migrate_6-7a.js
extensions/permissions/test/unit/test_permmanager_migrate_6-7b.js
extensions/permissions/test/unit/test_permmanager_migrate_7-8.js
extensions/permissions/test/unit/test_permmanager_migrate_9-10.js
extensions/permissions/test/unit/test_permmanager_notifications.js
extensions/permissions/test/unit/test_permmanager_removeall.js
extensions/permissions/test/unit/test_permmanager_removebytype.js
extensions/permissions/test/unit/test_permmanager_removebytypesince.js
extensions/permissions/test/unit/test_permmanager_removepermission.js
extensions/permissions/test/unit/test_permmanager_removesince.js
extensions/permissions/test/unit/test_permmanager_subdomains.js
extensions/pref/autoconfig/src/prefcalls.js
extensions/pref/autoconfig/test/unit/test_autoconfig.js
extensions/pref/autoconfig/test/unit/test_autoconfig_nonascii.js
extensions/spellcheck/hunspell/tests/unit/test_hunspell.js
extensions/spellcheck/hunspell/tests/unit/test_hunspell_unicode_paths.js
extensions/spellcheck/tests/mochitest/helper_bug1170484.js
extensions/universalchardet/tests/CharsetDetectionTests.js
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -40,17 +40,16 @@ module.exports = {
     "plugin:mozilla/recommended"
   ],
   "plugins": [
     "mozilla"
   ],
   "overrides": [{
       "files": [
         "devtools/**",
-        "extensions/**",
         "gfx/**",
         "gradle/**",
         "hal/**",
         "image/**",
         "intl/**",
         "ipc/**",
         "js/**",
         "layout/**",
--- a/.prettierignore
+++ b/.prettierignore
@@ -35,17 +35,16 @@ security/manager/ssl/security-prefs.js
 services/common/services-common.js
 services/sync/services-sync.js
 services/sync/tests/unit/prefs_test_prefs_store.js
 testing/marionette/prefs/marionette.js
 toolkit/components/telemetry/datareporting-prefs.js
 toolkit/components/telemetry/healthreport-prefs.js
 
 # Ignore all top-level directories for now.
-extensions/**
 gfx/**
 gradle/**
 hal/**
 image/**
 intl/**
 ipc/**
 js/**
 layout/**
--- a/extensions/permissions/test/browser_permmgr_sync.js
+++ b/extensions/permissions/test/browser_permmgr_sync.js
@@ -1,15 +1,21 @@
 function addPerm(aURI, aName) {
-  Services.perms.add(Services.io.newURI(aURI), aName, Services.perms.ALLOW_ACTION);
+  Services.perms.add(
+    Services.io.newURI(aURI),
+    aName,
+    Services.perms.ALLOW_ACTION
+  );
 }
 
 function hasPerm(aURI, aName) {
-  return Services.perms.testPermission(Services.io.newURI(aURI), aName)
-    == Services.perms.ALLOW_ACTION;
+  return (
+    Services.perms.testPermission(Services.io.newURI(aURI), aName) ==
+    Services.perms.ALLOW_ACTION
+  );
 }
 
 add_task(async function() {
   // Make sure that we get a new process for the tab which we create. This is
   // important, becuase we wanto to assert information about the initial state
   // of the local permissions cache.
   //
   // We use the same approach here as was used in the e10s-multi localStorage
@@ -19,152 +25,310 @@ add_task(async function() {
   // Bug 1345990 tracks implementing a better tool for ensuring this.
   let keepAliveCount = 0;
   try {
     keepAliveCount = SpecialPowers.getIntPref("dom.ipc.keepProcessesAlive.web");
   } catch (ex) {
     // Then zero is correct.
   }
   let safeProcessCount = keepAliveCount + 2;
-  info("dom.ipc.keepProcessesAlive.web is " + keepAliveCount + ", boosting " +
-       "process count temporarily to " + safeProcessCount);
+  info(
+    "dom.ipc.keepProcessesAlive.web is " +
+      keepAliveCount +
+      ", boosting " +
+      "process count temporarily to " +
+      safeProcessCount
+  );
   await SpecialPowers.pushPrefEnv({
     set: [
       ["dom.ipc.processCount", safeProcessCount],
-      ["dom.ipc.processCount.web", safeProcessCount]
-    ]
+      ["dom.ipc.processCount.web", safeProcessCount],
+    ],
   });
 
   addPerm("http://example.com", "perm1");
   addPerm("http://foo.bar.example.com", "perm2");
   addPerm("about:home", "perm3");
   addPerm("https://example.com", "perm4");
   // NOTE: This permission is a preload permission, so it should be avaliable in the content process from startup.
   addPerm("https://somerandomwebsite.com", "document");
 
-  await BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, async function(aBrowser) {
-    await ContentTask.spawn(aBrowser, null, async function() {
-      // Before the load http URIs shouldn't have been sent down yet
-      is(Services.perms.testPermission(Services.io.newURI("http://example.com"),
-                                       "perm1"),
-         Services.perms.UNKNOWN_ACTION, "perm1-1");
-      is(Services.perms.testPermission(Services.io.newURI("http://foo.bar.example.com"),
-                                       "perm2"),
-         Services.perms.UNKNOWN_ACTION, "perm2-1");
-      is(Services.perms.testPermission(Services.io.newURI("about:home"),
-                                       "perm3"),
-         Services.perms.ALLOW_ACTION, "perm3-1");
-      is(Services.perms.testPermission(Services.io.newURI("https://example.com"),
-                                       "perm4"),
-         Services.perms.UNKNOWN_ACTION, "perm4-1");
-      is(Services.perms.testPermission(Services.io.newURI("https://somerandomwebsite.com"),
-                                       "document"),
-         Services.perms.ALLOW_ACTION, "document-1");
+  await BrowserTestUtils.withNewTab(
+    { gBrowser, url: "about:blank" },
+    async function(aBrowser) {
+      await ContentTask.spawn(aBrowser, null, async function() {
+        // Before the load http URIs shouldn't have been sent down yet
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("http://example.com"),
+            "perm1"
+          ),
+          Services.perms.UNKNOWN_ACTION,
+          "perm1-1"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("http://foo.bar.example.com"),
+            "perm2"
+          ),
+          Services.perms.UNKNOWN_ACTION,
+          "perm2-1"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("about:home"),
+            "perm3"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "perm3-1"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("https://example.com"),
+            "perm4"
+          ),
+          Services.perms.UNKNOWN_ACTION,
+          "perm4-1"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("https://somerandomwebsite.com"),
+            "document"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "document-1"
+        );
 
-      // Perform a load of example.com
-      await new Promise(resolve => {
-        let iframe = content.document.createElement('iframe');
-        iframe.setAttribute('src', 'http://example.com');
-        iframe.onload = resolve;
-        content.document.body.appendChild(iframe);
+        // Perform a load of example.com
+        await new Promise(resolve => {
+          let iframe = content.document.createElement("iframe");
+          iframe.setAttribute("src", "http://example.com");
+          iframe.onload = resolve;
+          content.document.body.appendChild(iframe);
+        });
+
+        // After the load finishes, we should know about example.com, but not foo.bar.example.com
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("http://example.com"),
+            "perm1"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "perm1-2"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("http://foo.bar.example.com"),
+            "perm2"
+          ),
+          Services.perms.UNKNOWN_ACTION,
+          "perm2-2"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("about:home"),
+            "perm3"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "perm3-2"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("https://example.com"),
+            "perm4"
+          ),
+          Services.perms.UNKNOWN_ACTION,
+          "perm4-2"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("https://somerandomwebsite.com"),
+            "document"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "document-2"
+        );
       });
 
-      // After the load finishes, we should know about example.com, but not foo.bar.example.com
-      is(Services.perms.testPermission(Services.io.newURI("http://example.com"),
-                                       "perm1"),
-         Services.perms.ALLOW_ACTION, "perm1-2");
-      is(Services.perms.testPermission(Services.io.newURI("http://foo.bar.example.com"),
-                                       "perm2"),
-         Services.perms.UNKNOWN_ACTION, "perm2-2");
-      is(Services.perms.testPermission(Services.io.newURI("about:home"),
-                                       "perm3"),
-         Services.perms.ALLOW_ACTION, "perm3-2");
-      is(Services.perms.testPermission(Services.io.newURI("https://example.com"),
-                                       "perm4"),
-         Services.perms.UNKNOWN_ACTION, "perm4-2");
-      is(Services.perms.testPermission(Services.io.newURI("https://somerandomwebsite.com"),
-                                       "document"),
-         Services.perms.ALLOW_ACTION, "document-2");
-    });
+      addPerm("http://example.com", "newperm1");
+      addPerm("http://foo.bar.example.com", "newperm2");
+      addPerm("about:home", "newperm3");
+      addPerm("https://example.com", "newperm4");
+      addPerm("https://someotherrandomwebsite.com", "document");
 
-    addPerm("http://example.com", "newperm1");
-    addPerm("http://foo.bar.example.com", "newperm2");
-    addPerm("about:home", "newperm3");
-    addPerm("https://example.com", "newperm4");
-    addPerm("https://someotherrandomwebsite.com", "document");
+      await ContentTask.spawn(aBrowser, null, async function() {
+        // The new permissions should be avaliable, but only for
+        // http://example.com, and about:home
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("http://example.com"),
+            "perm1"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "perm1-3"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("http://example.com"),
+            "newperm1"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "newperm1-3"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("http://foo.bar.example.com"),
+            "perm2"
+          ),
+          Services.perms.UNKNOWN_ACTION,
+          "perm2-3"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("http://foo.bar.example.com"),
+            "newperm2"
+          ),
+          Services.perms.UNKNOWN_ACTION,
+          "newperm2-3"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("about:home"),
+            "perm3"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "perm3-3"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("about:home"),
+            "newperm3"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "newperm3-3"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("https://example.com"),
+            "perm4"
+          ),
+          Services.perms.UNKNOWN_ACTION,
+          "perm4-3"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("https://example.com"),
+            "newperm4"
+          ),
+          Services.perms.UNKNOWN_ACTION,
+          "newperm4-3"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("https://somerandomwebsite.com"),
+            "document"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "document-3"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("https://someotherrandomwebsite.com"),
+            "document"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "otherdocument-3"
+        );
 
-    await ContentTask.spawn(aBrowser, null, async function() {
-      // The new permissions should be avaliable, but only for
-      // http://example.com, and about:home
-      is(Services.perms.testPermission(Services.io.newURI("http://example.com"),
-                                       "perm1"),
-         Services.perms.ALLOW_ACTION, "perm1-3");
-      is(Services.perms.testPermission(Services.io.newURI("http://example.com"),
-                                       "newperm1"),
-         Services.perms.ALLOW_ACTION, "newperm1-3");
-      is(Services.perms.testPermission(Services.io.newURI("http://foo.bar.example.com"),
-                                       "perm2"),
-         Services.perms.UNKNOWN_ACTION, "perm2-3");
-      is(Services.perms.testPermission(Services.io.newURI("http://foo.bar.example.com"),
-                                       "newperm2"),
-         Services.perms.UNKNOWN_ACTION, "newperm2-3");
-      is(Services.perms.testPermission(Services.io.newURI("about:home"),
-                                       "perm3"),
-         Services.perms.ALLOW_ACTION, "perm3-3");
-      is(Services.perms.testPermission(Services.io.newURI("about:home"),
-                                       "newperm3"),
-         Services.perms.ALLOW_ACTION, "newperm3-3");
-      is(Services.perms.testPermission(Services.io.newURI("https://example.com"),
-                                       "perm4"),
-         Services.perms.UNKNOWN_ACTION, "perm4-3");
-      is(Services.perms.testPermission(Services.io.newURI("https://example.com"),
-                                       "newperm4"),
-         Services.perms.UNKNOWN_ACTION, "newperm4-3");
-      is(Services.perms.testPermission(Services.io.newURI("https://somerandomwebsite.com"),
-                                       "document"),
-         Services.perms.ALLOW_ACTION, "document-3");
-      is(Services.perms.testPermission(Services.io.newURI("https://someotherrandomwebsite.com"),
-                                       "document"),
-         Services.perms.ALLOW_ACTION, "otherdocument-3");
+        // Loading a subdomain now, on https
+        await new Promise(resolve => {
+          let iframe = content.document.createElement("iframe");
+          iframe.setAttribute("src", "https://sub1.test1.example.com");
+          iframe.onload = resolve;
+          content.document.body.appendChild(iframe);
+        });
 
-      // Loading a subdomain now, on https
-      await new Promise(resolve => {
-        let iframe = content.document.createElement('iframe');
-        iframe.setAttribute('src', 'https://sub1.test1.example.com');
-        iframe.onload = resolve;
-        content.document.body.appendChild(iframe);
+        // Now that the https subdomain has loaded, we want to make sure that the
+        // permissions are also avaliable for its parent domain, https://example.com!
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("http://example.com"),
+            "perm1"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "perm1-4"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("http://example.com"),
+            "newperm1"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "newperm1-4"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("http://foo.bar.example.com"),
+            "perm2"
+          ),
+          Services.perms.UNKNOWN_ACTION,
+          "perm2-4"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("http://foo.bar.example.com"),
+            "newperm2"
+          ),
+          Services.perms.UNKNOWN_ACTION,
+          "newperm2-4"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("about:home"),
+            "perm3"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "perm3-4"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("about:home"),
+            "newperm3"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "newperm3-4"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("https://example.com"),
+            "perm4"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "perm4-4"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("https://example.com"),
+            "newperm4"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "newperm4-4"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("https://somerandomwebsite.com"),
+            "document"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "document-4"
+        );
+        is(
+          Services.perms.testPermission(
+            Services.io.newURI("https://someotherrandomwebsite.com"),
+            "document"
+          ),
+          Services.perms.ALLOW_ACTION,
+          "otherdocument-4"
+        );
       });
-
-      // Now that the https subdomain has loaded, we want to make sure that the
-      // permissions are also avaliable for its parent domain, https://example.com!
-      is(Services.perms.testPermission(Services.io.newURI("http://example.com"),
-                                       "perm1"),
-         Services.perms.ALLOW_ACTION, "perm1-4");
-      is(Services.perms.testPermission(Services.io.newURI("http://example.com"),
-                                       "newperm1"),
-         Services.perms.ALLOW_ACTION, "newperm1-4");
-      is(Services.perms.testPermission(Services.io.newURI("http://foo.bar.example.com"),
-                                       "perm2"),
-         Services.perms.UNKNOWN_ACTION, "perm2-4");
-      is(Services.perms.testPermission(Services.io.newURI("http://foo.bar.example.com"),
-                                       "newperm2"),
-         Services.perms.UNKNOWN_ACTION, "newperm2-4");
-      is(Services.perms.testPermission(Services.io.newURI("about:home"),
-                                       "perm3"),
-         Services.perms.ALLOW_ACTION, "perm3-4");
-      is(Services.perms.testPermission(Services.io.newURI("about:home"),
-                                       "newperm3"),
-         Services.perms.ALLOW_ACTION, "newperm3-4");
-      is(Services.perms.testPermission(Services.io.newURI("https://example.com"),
-                                       "perm4"),
-         Services.perms.ALLOW_ACTION, "perm4-4");
-      is(Services.perms.testPermission(Services.io.newURI("https://example.com"),
-                                       "newperm4"),
-         Services.perms.ALLOW_ACTION, "newperm4-4");
-      is(Services.perms.testPermission(Services.io.newURI("https://somerandomwebsite.com"),
-                                       "document"),
-         Services.perms.ALLOW_ACTION, "document-4");
-      is(Services.perms.testPermission(Services.io.newURI("https://someotherrandomwebsite.com"),
-                                       "document"),
-         Services.perms.ALLOW_ACTION, "otherdocument-4");
-    });
-  });
+    }
+  );
 });
--- a/extensions/permissions/test/browser_permmgr_viewsrc.js
+++ b/extensions/permissions/test/browser_permmgr_viewsrc.js
@@ -1,19 +1,27 @@
 add_task(async function() {
   // Add a permission for example.com, start a new content process, and make
   // sure that the permission has been sent down.
-  Services.perms.add(Services.io.newURI("http://example.com"),
-                     "viewsourceTestingPerm",
-                     Services.perms.ALLOW_ACTION);
+  Services.perms.add(
+    Services.io.newURI("http://example.com"),
+    "viewsourceTestingPerm",
+    Services.perms.ALLOW_ACTION
+  );
 
-  let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser,
-                                                        "view-source:http://example.com",
-                                                        /* waitForLoad */ true,
-                                                        /* waitForStateStop */ false,
-                                                        /* forceNewProcess */ true);
+  let tab = await BrowserTestUtils.openNewForegroundTab(
+    gBrowser,
+    "view-source:http://example.com",
+    /* waitForLoad */ true,
+    /* waitForStateStop */ false,
+    /* forceNewProcess */ true
+  );
   await ContentTask.spawn(tab.linkedBrowser, null, async function() {
-    is(Services.perms.testPermission(Services.io.newURI("http://example.com"),
-                                     "viewsourceTestingPerm"),
-       Services.perms.ALLOW_ACTION);
+    is(
+      Services.perms.testPermission(
+        Services.io.newURI("http://example.com"),
+        "viewsourceTestingPerm"
+      ),
+      Services.perms.ALLOW_ACTION
+    );
   });
   BrowserTestUtils.removeTab(tab);
 });
--- a/extensions/permissions/test/unit/head.js
+++ b/extensions/permissions/test/unit/head.js
@@ -1,14 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 
 // Helper to step a generator function and catch a StopIteration exception.
 function do_run_generator(generator) {
   try {
     generator.next();
   } catch (e) {
     do_throw("caught exception " + e, Components.stack.caller);
   }
@@ -25,9 +25,8 @@ function do_finish_generator_test(genera
 function do_count_enumerator(enumerator) {
   let i = 0;
   for (let item of enumerator) {
     void item;
     ++i;
   }
   return i;
 }
-
--- a/extensions/permissions/test/unit/test_permmanager_cleardata.js
+++ b/extensions/permissions/test/unit/test_permmanager_cleardata.js
@@ -1,66 +1,94 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 var pm;
 
 // Create a principal based on the { origin, originAttributes }.
-function createPrincipal(aOrigin, aOriginAttributes)
-{
-  return Services.scriptSecurityManager.createCodebasePrincipal(NetUtil.newURI(aOrigin), aOriginAttributes);
+function createPrincipal(aOrigin, aOriginAttributes) {
+  return Services.scriptSecurityManager.createCodebasePrincipal(
+    NetUtil.newURI(aOrigin),
+    aOriginAttributes
+  );
 }
 
 // Return the data required by 'clear-origin-attributes-data' notification.
-function getData(aPattern)
-{
+function getData(aPattern) {
   return JSON.stringify(aPattern);
 }
 
 // Use aEntries to create principals, add permissions to them and check that they have them.
 // Then, it is notifying 'clear-origin-attributes-data' with the given aData and check if the permissions
 // of principals[i] matches the permission in aResults[i].
-function test(aEntries, aData, aResults)
-{
+function test(aEntries, aData, aResults) {
   let principals = [];
 
   for (entry of aEntries) {
     principals.push(createPrincipal(entry.origin, entry.originAttributes));
   }
 
   for (principal of principals) {
-    Assert.equal(pm.testPermissionFromPrincipal(principal, "test/clear-origin"), pm.UNKNOWN_ACTION);
-    pm.addFromPrincipal(principal, "test/clear-origin", pm.ALLOW_ACTION, pm.EXPIRE_NEVER, 0);
-    Assert.equal(pm.testPermissionFromPrincipal(principal, "test/clear-origin"), pm.ALLOW_ACTION);
+    Assert.equal(
+      pm.testPermissionFromPrincipal(principal, "test/clear-origin"),
+      pm.UNKNOWN_ACTION
+    );
+    pm.addFromPrincipal(
+      principal,
+      "test/clear-origin",
+      pm.ALLOW_ACTION,
+      pm.EXPIRE_NEVER,
+      0
+    );
+    Assert.equal(
+      pm.testPermissionFromPrincipal(principal, "test/clear-origin"),
+      pm.ALLOW_ACTION
+    );
   }
 
-  Services.obs.notifyObservers(null, 'clear-origin-attributes-data', aData);
+  Services.obs.notifyObservers(null, "clear-origin-attributes-data", aData);
 
   var length = aEntries.length;
-  for (let i=0; i<length; ++i) {
-    Assert.equal(pm.testPermissionFromPrincipal(principals[i], 'test/clear-origin'), aResults[i]);
+  for (let i = 0; i < length; ++i) {
+    Assert.equal(
+      pm.testPermissionFromPrincipal(principals[i], "test/clear-origin"),
+      aResults[i]
+    );
 
     // Remove allowed actions.
     if (aResults[i] == pm.ALLOW_ACTION) {
-      pm.removeFromPrincipal(principals[i], 'test/clear-origin');
+      pm.removeFromPrincipal(principals[i], "test/clear-origin");
     }
   }
 }
 
-function run_test()
-{
+function run_test() {
   do_get_profile();
 
-  pm = Cc["@mozilla.org/permissionmanager;1"]
-         .getService(Ci.nsIPermissionManager);
+  pm = Cc["@mozilla.org/permissionmanager;1"].getService(
+    Ci.nsIPermissionManager
+  );
 
   let entries = [
-    { origin: 'http://example.com', originAttributes: {} },
-    { origin: 'http://example.com', originAttributes: { inIsolatedMozBrowser: true } },
+    { origin: "http://example.com", originAttributes: {} },
+    {
+      origin: "http://example.com",
+      originAttributes: { inIsolatedMozBrowser: true },
+    },
   ];
 
   // In that case, all permissions should be removed.
-  test(entries, getData({}), [ pm.UNKNOWN_ACTION, pm.UNKNOWN_ACTION, pm.ALLOW_ACTION, pm.ALLOW_ACTION ]);
+  test(entries, getData({}), [
+    pm.UNKNOWN_ACTION,
+    pm.UNKNOWN_ACTION,
+    pm.ALLOW_ACTION,
+    pm.ALLOW_ACTION,
+  ]);
 
   // In that case, only the permissions related to a browserElement should be removed.
   // All the other permissions should stay.
-  test(entries, getData({ inIsolatedMozBrowser: true}), [ pm.ALLOW_ACTION, pm.UNKNOWN_ACTION, pm.ALLOW_ACTION, pm.ALLOW_ACTION ]);
+  test(entries, getData({ inIsolatedMozBrowser: true }), [
+    pm.ALLOW_ACTION,
+    pm.UNKNOWN_ACTION,
+    pm.ALLOW_ACTION,
+    pm.ALLOW_ACTION,
+  ]);
 }
--- a/extensions/permissions/test/unit/test_permmanager_default_pref.js
+++ b/extensions/permissions/test/unit/test_permmanager_default_pref.js
@@ -1,37 +1,69 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
   let uri = Services.io.newURI("https://example.org");
 
   // Check that without a pref the default return value is UNKNOWN.
-  Assert.equal(Services.perms.testPermission(uri, "camera"), Services.perms.UNKNOWN_ACTION);
+  Assert.equal(
+    Services.perms.testPermission(uri, "camera"),
+    Services.perms.UNKNOWN_ACTION
+  );
 
   // Check that the default return value changed after setting the pref.
-  Services.prefs.setIntPref("permissions.default.camera", Services.perms.DENY_ACTION);
-  Assert.equal(Services.perms.testPermission(uri, "camera"), Services.perms.DENY_ACTION);
+  Services.prefs.setIntPref(
+    "permissions.default.camera",
+    Services.perms.DENY_ACTION
+  );
+  Assert.equal(
+    Services.perms.testPermission(uri, "camera"),
+    Services.perms.DENY_ACTION
+  );
 
   // Check that functions that do not directly return a permission value still
   // consider the permission as being set to its default.
-  Assert.equal(null, Services.perms.getPermissionObjectForURI(uri, "camera", false));
+  Assert.equal(
+    null,
+    Services.perms.getPermissionObjectForURI(uri, "camera", false)
+  );
 
   // Check that other permissions still return UNKNOWN.
-  Assert.equal(Services.perms.testPermission(uri, "geo"), Services.perms.UNKNOWN_ACTION);
+  Assert.equal(
+    Services.perms.testPermission(uri, "geo"),
+    Services.perms.UNKNOWN_ACTION
+  );
 
   // Check that the default return value changed after changing the pref.
-  Services.prefs.setIntPref("permissions.default.camera", Services.perms.ALLOW_ACTION);
-  Assert.equal(Services.perms.testPermission(uri, "camera"), Services.perms.ALLOW_ACTION);
+  Services.prefs.setIntPref(
+    "permissions.default.camera",
+    Services.perms.ALLOW_ACTION
+  );
+  Assert.equal(
+    Services.perms.testPermission(uri, "camera"),
+    Services.perms.ALLOW_ACTION
+  );
 
   // Check that the preference is ignored if there is a value.
   Services.perms.add(uri, "camera", Services.perms.DENY_ACTION);
-  Assert.equal(Services.perms.testPermission(uri, "camera"), Services.perms.DENY_ACTION);
-  Assert.ok(Services.perms.getPermissionObjectForURI(uri, "camera", false) != null);
+  Assert.equal(
+    Services.perms.testPermission(uri, "camera"),
+    Services.perms.DENY_ACTION
+  );
+  Assert.ok(
+    Services.perms.getPermissionObjectForURI(uri, "camera", false) != null
+  );
 
   // The preference should be honored again, after resetting the permissions.
   Services.perms.removeAll();
-  Assert.equal(Services.perms.testPermission(uri, "camera"), Services.perms.ALLOW_ACTION);
+  Assert.equal(
+    Services.perms.testPermission(uri, "camera"),
+    Services.perms.ALLOW_ACTION
+  );
 
   // Should be UNKNOWN after clearing the pref.
   Services.prefs.clearUserPref("permissions.default.camera");
-  Assert.equal(Services.perms.testPermission(uri, "camera"), Services.perms.UNKNOWN_ACTION);
+  Assert.equal(
+    Services.perms.testPermission(uri, "camera"),
+    Services.perms.UNKNOWN_ACTION
+  );
 }
--- a/extensions/permissions/test/unit/test_permmanager_defaults.js
+++ b/extensions/permissions/test/unit/test_permmanager_defaults.js
@@ -18,273 +18,410 @@ add_task(async function do_test() {
   // setup a profile.
   do_get_profile();
 
   // create a file in the temp directory with the defaults.
   let file = do_get_tempdir();
   file.append("test_default_permissions");
 
   // write our test data to it.
-  let ostream = Cc["@mozilla.org/network/file-output-stream;1"].
-                createInstance(Ci.nsIFileOutputStream);
+  let ostream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(
+    Ci.nsIFileOutputStream
+  );
   ostream.init(file, -1, 0o666, 0);
-  let conv = Cc["@mozilla.org/intl/converter-output-stream;1"].
-             createInstance(Ci.nsIConverterOutputStream);
+  let conv = Cc["@mozilla.org/intl/converter-output-stream;1"].createInstance(
+    Ci.nsIConverterOutputStream
+  );
   conv.init(ostream, "UTF-8");
 
   conv.writeString("# this is a comment\n");
   conv.writeString("\n"); // a blank line!
-  conv.writeString("host\t" + TEST_PERMISSION + "\t1\t" + TEST_ORIGIN.host + "\n");
-  conv.writeString("host\t" + TEST_PERMISSION + "\t1\t" + TEST_ORIGIN_2.host + "\n");
-  conv.writeString("origin\t" + TEST_PERMISSION + "\t1\t" + TEST_ORIGIN_3.spec + "\n");
-  conv.writeString("origin\t" + TEST_PERMISSION + "\t1\t" + TEST_ORIGIN.spec + "^inBrowser=1\n");
+  conv.writeString(
+    "host\t" + TEST_PERMISSION + "\t1\t" + TEST_ORIGIN.host + "\n"
+  );
+  conv.writeString(
+    "host\t" + TEST_PERMISSION + "\t1\t" + TEST_ORIGIN_2.host + "\n"
+  );
+  conv.writeString(
+    "origin\t" + TEST_PERMISSION + "\t1\t" + TEST_ORIGIN_3.spec + "\n"
+  );
+  conv.writeString(
+    "origin\t" + TEST_PERMISSION + "\t1\t" + TEST_ORIGIN.spec + "^inBrowser=1\n"
+  );
   ostream.close();
 
   // Set the preference used by the permission manager so the file is read.
-  Services.prefs.setCharPref("permissions.manager.defaultsUrl", "file://" + file.path);
+  Services.prefs.setCharPref(
+    "permissions.manager.defaultsUrl",
+    "file://" + file.path
+  );
 
   // This will force the permission-manager to reload the data.
   Services.obs.notifyObservers(null, "testonly-reload-permissions-from-disk");
 
-  let pm = Cc["@mozilla.org/permissionmanager;1"].
-           getService(Ci.nsIPermissionManager);
+  let pm = Cc["@mozilla.org/permissionmanager;1"].getService(
+    Ci.nsIPermissionManager
+  );
 
   // test the default permission was applied.
-  let principal = Services.scriptSecurityManager.createCodebasePrincipal(TEST_ORIGIN, {});
-  let principalHttps = Services.scriptSecurityManager.createCodebasePrincipal(TEST_ORIGIN_HTTPS, {});
-  let principal2 = Services.scriptSecurityManager.createCodebasePrincipal(TEST_ORIGIN_2, {});
-  let principal3 = Services.scriptSecurityManager.createCodebasePrincipal(TEST_ORIGIN_3, {});
+  let principal = Services.scriptSecurityManager.createCodebasePrincipal(
+    TEST_ORIGIN,
+    {}
+  );
+  let principalHttps = Services.scriptSecurityManager.createCodebasePrincipal(
+    TEST_ORIGIN_HTTPS,
+    {}
+  );
+  let principal2 = Services.scriptSecurityManager.createCodebasePrincipal(
+    TEST_ORIGIN_2,
+    {}
+  );
+  let principal3 = Services.scriptSecurityManager.createCodebasePrincipal(
+    TEST_ORIGIN_3,
+    {}
+  );
 
-  let attrs = {inIsolatedMozBrowser: true};
-  let principal4 = Services.scriptSecurityManager.createCodebasePrincipal(TEST_ORIGIN, attrs);
-  let principal5 = Services.scriptSecurityManager.createCodebasePrincipal(TEST_ORIGIN_3, attrs);
+  let attrs = { inIsolatedMozBrowser: true };
+  let principal4 = Services.scriptSecurityManager.createCodebasePrincipal(
+    TEST_ORIGIN,
+    attrs
+  );
+  let principal5 = Services.scriptSecurityManager.createCodebasePrincipal(
+    TEST_ORIGIN_3,
+    attrs
+  );
 
-  attrs = {userContextId: 1};
-  let principal6 = Services.scriptSecurityManager.createCodebasePrincipal(TEST_ORIGIN, attrs);
-  attrs = {firstPartyDomain: "cnn.com"};
-  let principal7 = Services.scriptSecurityManager.createCodebasePrincipal(TEST_ORIGIN, attrs);
-  attrs = {userContextId: 1, firstPartyDomain: "cnn.com"};
-  let principal8 = Services.scriptSecurityManager.createCodebasePrincipal(TEST_ORIGIN, attrs);
+  attrs = { userContextId: 1 };
+  let principal6 = Services.scriptSecurityManager.createCodebasePrincipal(
+    TEST_ORIGIN,
+    attrs
+  );
+  attrs = { firstPartyDomain: "cnn.com" };
+  let principal7 = Services.scriptSecurityManager.createCodebasePrincipal(
+    TEST_ORIGIN,
+    attrs
+  );
+  attrs = { userContextId: 1, firstPartyDomain: "cnn.com" };
+  let principal8 = Services.scriptSecurityManager.createCodebasePrincipal(
+    TEST_ORIGIN,
+    attrs
+  );
 
-  Assert.equal(Ci.nsIPermissionManager.ALLOW_ACTION,
-               pm.testPermissionFromPrincipal(principal, TEST_PERMISSION));
-  Assert.equal(Ci.nsIPermissionManager.ALLOW_ACTION,
-               pm.testPermissionFromPrincipal(principalHttps, TEST_PERMISSION));
-  Assert.equal(Ci.nsIPermissionManager.ALLOW_ACTION,
-               pm.testPermissionFromPrincipal(principal3, TEST_PERMISSION));
-  Assert.equal(Ci.nsIPermissionManager.ALLOW_ACTION,
-               pm.testPermissionFromPrincipal(principal4, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.ALLOW_ACTION,
+    pm.testPermissionFromPrincipal(principal, TEST_PERMISSION)
+  );
+  Assert.equal(
+    Ci.nsIPermissionManager.ALLOW_ACTION,
+    pm.testPermissionFromPrincipal(principalHttps, TEST_PERMISSION)
+  );
+  Assert.equal(
+    Ci.nsIPermissionManager.ALLOW_ACTION,
+    pm.testPermissionFromPrincipal(principal3, TEST_PERMISSION)
+  );
+  Assert.equal(
+    Ci.nsIPermissionManager.ALLOW_ACTION,
+    pm.testPermissionFromPrincipal(principal4, TEST_PERMISSION)
+  );
 
   // Didn't add
-  Assert.equal(Ci.nsIPermissionManager.UNKNOWN_ACTION,
-               pm.testPermissionFromPrincipal(principal5, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.UNKNOWN_ACTION,
+    pm.testPermissionFromPrincipal(principal5, TEST_PERMISSION)
+  );
 
   // the permission should exist in the enumerator.
-  Assert.equal(Ci.nsIPermissionManager.ALLOW_ACTION, findCapabilityViaEnum(TEST_ORIGIN));
-  Assert.equal(Ci.nsIPermissionManager.ALLOW_ACTION, findCapabilityViaEnum(TEST_ORIGIN_3));
+  Assert.equal(
+    Ci.nsIPermissionManager.ALLOW_ACTION,
+    findCapabilityViaEnum(TEST_ORIGIN)
+  );
+  Assert.equal(
+    Ci.nsIPermissionManager.ALLOW_ACTION,
+    findCapabilityViaEnum(TEST_ORIGIN_3)
+  );
 
   // but should not have been written to the DB
   await checkCapabilityViaDB(null);
 
   // remove all should not throw and the default should remain
   pm.removeAll();
 
-  Assert.equal(Ci.nsIPermissionManager.ALLOW_ACTION,
-               pm.testPermissionFromPrincipal(principal, TEST_PERMISSION));
-  Assert.equal(Ci.nsIPermissionManager.ALLOW_ACTION,
-               pm.testPermissionFromPrincipal(principal3, TEST_PERMISSION));
-  Assert.equal(Ci.nsIPermissionManager.ALLOW_ACTION,
-               pm.testPermissionFromPrincipal(principal4, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.ALLOW_ACTION,
+    pm.testPermissionFromPrincipal(principal, TEST_PERMISSION)
+  );
+  Assert.equal(
+    Ci.nsIPermissionManager.ALLOW_ACTION,
+    pm.testPermissionFromPrincipal(principal3, TEST_PERMISSION)
+  );
+  Assert.equal(
+    Ci.nsIPermissionManager.ALLOW_ACTION,
+    pm.testPermissionFromPrincipal(principal4, TEST_PERMISSION)
+  );
   // make sure principals with userContextId use the same permissions
-  Assert.equal(Ci.nsIPermissionManager.ALLOW_ACTION,
-               pm.testPermissionFromPrincipal(principal6, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.ALLOW_ACTION,
+    pm.testPermissionFromPrincipal(principal6, TEST_PERMISSION)
+  );
   // make sure principals with a firstPartyDomain use different permissions
-  Assert.equal(Ci.nsIPermissionManager.UNKNOWN_ACTION,
-               pm.testPermissionFromPrincipal(principal7, TEST_PERMISSION));
-  Assert.equal(Ci.nsIPermissionManager.UNKNOWN_ACTION,
-               pm.testPermissionFromPrincipal(principal8, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.UNKNOWN_ACTION,
+    pm.testPermissionFromPrincipal(principal7, TEST_PERMISSION)
+  );
+  Assert.equal(
+    Ci.nsIPermissionManager.UNKNOWN_ACTION,
+    pm.testPermissionFromPrincipal(principal8, TEST_PERMISSION)
+  );
 
   // Asking for this permission to be removed should result in that permission
   // having UNKNOWN_ACTION
   pm.removeFromPrincipal(principal, TEST_PERMISSION);
-  Assert.equal(Ci.nsIPermissionManager.UNKNOWN_ACTION,
-               pm.testPermissionFromPrincipal(principal, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.UNKNOWN_ACTION,
+    pm.testPermissionFromPrincipal(principal, TEST_PERMISSION)
+  );
   // make sure principals with userContextId or firstPartyDomain use the same permissions
-  Assert.equal(Ci.nsIPermissionManager.UNKNOWN_ACTION,
-               pm.testPermissionFromPrincipal(principal6, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.UNKNOWN_ACTION,
+    pm.testPermissionFromPrincipal(principal6, TEST_PERMISSION)
+  );
   // and we should have this UNKNOWN_ACTION reflected in the DB
   await checkCapabilityViaDB(Ci.nsIPermissionManager.UNKNOWN_ACTION);
   // but the permission should *not* appear in the enumerator.
   Assert.equal(null, findCapabilityViaEnum());
 
   // and a subsequent RemoveAll should restore the default
   pm.removeAll();
 
-  Assert.equal(Ci.nsIPermissionManager.ALLOW_ACTION,
-               pm.testPermissionFromPrincipal(principal, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.ALLOW_ACTION,
+    pm.testPermissionFromPrincipal(principal, TEST_PERMISSION)
+  );
   // make sure principals with userContextId use the same permissions
-  Assert.equal(Ci.nsIPermissionManager.ALLOW_ACTION,
-               pm.testPermissionFromPrincipal(principal6, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.ALLOW_ACTION,
+    pm.testPermissionFromPrincipal(principal6, TEST_PERMISSION)
+  );
   // make sure principals with firstPartyDomain use different permissions
-  Assert.equal(Ci.nsIPermissionManager.UNKNOWN_ACTION,
-               pm.testPermissionFromPrincipal(principal7, TEST_PERMISSION));
-  Assert.equal(Ci.nsIPermissionManager.UNKNOWN_ACTION,
-               pm.testPermissionFromPrincipal(principal8, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.UNKNOWN_ACTION,
+    pm.testPermissionFromPrincipal(principal7, TEST_PERMISSION)
+  );
+  Assert.equal(
+    Ci.nsIPermissionManager.UNKNOWN_ACTION,
+    pm.testPermissionFromPrincipal(principal8, TEST_PERMISSION)
+  );
   // and allow it to again be seen in the enumerator.
   Assert.equal(Ci.nsIPermissionManager.ALLOW_ACTION, findCapabilityViaEnum());
 
   // now explicitly add a permission - this too should override the default.
-  pm.addFromPrincipal(principal, TEST_PERMISSION, Ci.nsIPermissionManager.DENY_ACTION);
+  pm.addFromPrincipal(
+    principal,
+    TEST_PERMISSION,
+    Ci.nsIPermissionManager.DENY_ACTION
+  );
 
   // it should be reflected in a permission check, in the enumerator and the DB
-  Assert.equal(Ci.nsIPermissionManager.DENY_ACTION,
-               pm.testPermissionFromPrincipal(principal, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.DENY_ACTION,
+    pm.testPermissionFromPrincipal(principal, TEST_PERMISSION)
+  );
   // make sure principals with userContextId use the same permissions
-  Assert.equal(Ci.nsIPermissionManager.DENY_ACTION,
-               pm.testPermissionFromPrincipal(principal6, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.DENY_ACTION,
+    pm.testPermissionFromPrincipal(principal6, TEST_PERMISSION)
+  );
   // make sure principals with firstPartyDomain use different permissions
-  Assert.equal(Ci.nsIPermissionManager.UNKNOWN_ACTION,
-               pm.testPermissionFromPrincipal(principal7, TEST_PERMISSION));
-  Assert.equal(Ci.nsIPermissionManager.UNKNOWN_ACTION,
-               pm.testPermissionFromPrincipal(principal8, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.UNKNOWN_ACTION,
+    pm.testPermissionFromPrincipal(principal7, TEST_PERMISSION)
+  );
+  Assert.equal(
+    Ci.nsIPermissionManager.UNKNOWN_ACTION,
+    pm.testPermissionFromPrincipal(principal8, TEST_PERMISSION)
+  );
   Assert.equal(Ci.nsIPermissionManager.DENY_ACTION, findCapabilityViaEnum());
   await checkCapabilityViaDB(Ci.nsIPermissionManager.DENY_ACTION);
 
   // explicitly add a different permission - in this case we are no longer
   // replacing the default, but instead replacing the replacement!
-  pm.addFromPrincipal(principal, TEST_PERMISSION, Ci.nsIPermissionManager.PROMPT_ACTION);
+  pm.addFromPrincipal(
+    principal,
+    TEST_PERMISSION,
+    Ci.nsIPermissionManager.PROMPT_ACTION
+  );
 
   // it should be reflected in a permission check, in the enumerator and the DB
-  Assert.equal(Ci.nsIPermissionManager.PROMPT_ACTION,
-               pm.testPermissionFromPrincipal(principal, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.PROMPT_ACTION,
+    pm.testPermissionFromPrincipal(principal, TEST_PERMISSION)
+  );
   // make sure principals with userContextId use the same permissions
-  Assert.equal(Ci.nsIPermissionManager.PROMPT_ACTION,
-               pm.testPermissionFromPrincipal(principal6, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.PROMPT_ACTION,
+    pm.testPermissionFromPrincipal(principal6, TEST_PERMISSION)
+  );
   // make sure principals with firstPartyDomain use different permissions
-  Assert.equal(Ci.nsIPermissionManager.UNKNOWN_ACTION,
-               pm.testPermissionFromPrincipal(principal7, TEST_PERMISSION));
-  Assert.equal(Ci.nsIPermissionManager.UNKNOWN_ACTION,
-               pm.testPermissionFromPrincipal(principal8, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.UNKNOWN_ACTION,
+    pm.testPermissionFromPrincipal(principal7, TEST_PERMISSION)
+  );
+  Assert.equal(
+    Ci.nsIPermissionManager.UNKNOWN_ACTION,
+    pm.testPermissionFromPrincipal(principal8, TEST_PERMISSION)
+  );
   Assert.equal(Ci.nsIPermissionManager.PROMPT_ACTION, findCapabilityViaEnum());
   await checkCapabilityViaDB(Ci.nsIPermissionManager.PROMPT_ACTION);
 
   // --------------------------------------------------------------
   // check default permissions and removeAllSince work as expected.
   pm.removeAll(); // ensure only defaults are there.
 
   // default for both principals is allow.
-  Assert.equal(Ci.nsIPermissionManager.ALLOW_ACTION,
-               pm.testPermissionFromPrincipal(principal, TEST_PERMISSION));
-  Assert.equal(Ci.nsIPermissionManager.ALLOW_ACTION,
-               pm.testPermissionFromPrincipal(principal2, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.ALLOW_ACTION,
+    pm.testPermissionFromPrincipal(principal, TEST_PERMISSION)
+  );
+  Assert.equal(
+    Ci.nsIPermissionManager.ALLOW_ACTION,
+    pm.testPermissionFromPrincipal(principal2, TEST_PERMISSION)
+  );
 
   // Add a default override for TEST_ORIGIN_2 - this one should *not* be
   // restored in removeAllSince()
-  pm.addFromPrincipal(principal2, TEST_PERMISSION, Ci.nsIPermissionManager.DENY_ACTION);
-  Assert.equal(Ci.nsIPermissionManager.DENY_ACTION,
-               pm.testPermissionFromPrincipal(principal2, TEST_PERMISSION));
+  pm.addFromPrincipal(
+    principal2,
+    TEST_PERMISSION,
+    Ci.nsIPermissionManager.DENY_ACTION
+  );
+  Assert.equal(
+    Ci.nsIPermissionManager.DENY_ACTION,
+    pm.testPermissionFromPrincipal(principal2, TEST_PERMISSION)
+  );
   await promiseTimeout(20);
 
   let since = Number(Date.now());
   await promiseTimeout(20);
 
   // explicitly add a permission which overrides the default for the first
   // principal - this one *should* be removed by removeAllSince.
-  pm.addFromPrincipal(principal, TEST_PERMISSION, Ci.nsIPermissionManager.DENY_ACTION);
-  Assert.equal(Ci.nsIPermissionManager.DENY_ACTION,
-               pm.testPermissionFromPrincipal(principal, TEST_PERMISSION));
+  pm.addFromPrincipal(
+    principal,
+    TEST_PERMISSION,
+    Ci.nsIPermissionManager.DENY_ACTION
+  );
+  Assert.equal(
+    Ci.nsIPermissionManager.DENY_ACTION,
+    pm.testPermissionFromPrincipal(principal, TEST_PERMISSION)
+  );
 
   // do a removeAllSince.
   pm.removeAllSince(since);
 
   // the default for the first principal should re-appear as we modified it
   // later then |since|
-  Assert.equal(Ci.nsIPermissionManager.ALLOW_ACTION,
-               pm.testPermissionFromPrincipal(principal, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.ALLOW_ACTION,
+    pm.testPermissionFromPrincipal(principal, TEST_PERMISSION)
+  );
 
   // but the permission for principal2 should remain as we added that before |since|.
-  Assert.equal(Ci.nsIPermissionManager.DENY_ACTION,
-               pm.testPermissionFromPrincipal(principal2, TEST_PERMISSION));
+  Assert.equal(
+    Ci.nsIPermissionManager.DENY_ACTION,
+    pm.testPermissionFromPrincipal(principal2, TEST_PERMISSION)
+  );
 
   // remove the temp file we created.
   file.remove(false);
 });
 
 // use an enumerator to find the requested permission.  Returns the permission
 // value (ie, the "capability" in nsIPermission parlance) or null if it can't
 // be found.
 function findCapabilityViaEnum(origin = TEST_ORIGIN, type = TEST_PERMISSION) {
   let result = undefined;
   for (let perm of Services.perms.enumerator) {
-    if (perm.matchesURI(origin, true) &&
-        perm.type == type) {
+    if (perm.matchesURI(origin, true) && perm.type == type) {
       if (result !== undefined) {
         // we've already found one previously - that's bad!
         do_throw("enumerator found multiple entries");
       }
       result = perm.capability;
     }
   }
   return result || null;
 }
 
 // A function to check the DB has the specified capability.  As the permission
 // manager uses async DB operations without a completion callback, the
 // distinct possibility exists that our checking of the DB will happen before
 // the permission manager update has completed - so we just retry a few times.
 // Returns a promise.
-function checkCapabilityViaDB(expected, origin = TEST_ORIGIN, type = TEST_PERMISSION) {
+function checkCapabilityViaDB(
+  expected,
+  origin = TEST_ORIGIN,
+  type = TEST_PERMISSION
+) {
   return new Promise(resolve => {
     let count = 0;
     let max = 20;
     let do_check = () => {
       let got = findCapabilityViaDB(origin, type);
       if (got == expected) {
         // the do_check_eq() below will succeed - which is what we want.
         Assert.equal(got, expected, "The database has the expected value");
         resolve();
         return;
       }
       // value isn't correct - see if we've retried enough
       if (count++ == max) {
         // the do_check_eq() below will fail - which is what we want.
-        Assert.equal(got, expected, "The database wasn't updated with the expected value");
+        Assert.equal(
+          got,
+          expected,
+          "The database wasn't updated with the expected value"
+        );
         resolve();
         return;
       }
       // we can retry...
       do_timeout(100, do_check);
-    }
+    };
     do_check();
   });
 }
 
 // use the DB to find the requested permission.   Returns the permission
 // value (ie, the "capability" in nsIPermission parlance) or null if it can't
 // be found.
 function findCapabilityViaDB(origin = TEST_ORIGIN, type = TEST_PERMISSION) {
-  let principal = Services.scriptSecurityManager.createCodebasePrincipal(origin, {});
+  let principal = Services.scriptSecurityManager.createCodebasePrincipal(
+    origin,
+    {}
+  );
   let originStr = principal.origin;
 
   let file = Services.dirsvc.get("ProfD", Ci.nsIFile);
   file.append("permissions.sqlite");
 
-  let storage = Cc["@mozilla.org/storage/service;1"]
-                  .getService(Ci.mozIStorageService);
+  let storage = Cc["@mozilla.org/storage/service;1"].getService(
+    Ci.mozIStorageService
+  );
 
   let connection = storage.openDatabase(file);
 
   let query = connection.createStatement(
-      "SELECT permission FROM moz_perms WHERE origin = :origin AND type = :type");
+    "SELECT permission FROM moz_perms WHERE origin = :origin AND type = :type"
+  );
   query.bindByName("origin", originStr);
   query.bindByName("type", type);
 
   if (!query.executeStep()) {
     // no row
     return null;
   }
   let result = query.getInt32(0);
   if (query.executeStep()) {
     // this is bad - we never expect more than 1 row here.
-    do_throw("More than 1 row found!")
+    do_throw("More than 1 row found!");
   }
   return result;
 }
--- a/extensions/permissions/test/unit/test_permmanager_expiration.js
+++ b/extensions/permissions/test/unit/test_permmanager_expiration.js
@@ -5,78 +5,196 @@
 
 var test_generator = do_run_test();
 
 function run_test() {
   do_test_pending();
   test_generator.next();
 }
 
-function continue_test()
-{
+function continue_test() {
   do_run_generator(test_generator);
 }
 
 function* do_run_test() {
   // Set up a profile.
   let profile = do_get_profile();
 
   let pm = Services.perms;
   let permURI = NetUtil.newURI("http://example.com");
-  let principal = Services.scriptSecurityManager.createCodebasePrincipal(permURI, {});
+  let principal = Services.scriptSecurityManager.createCodebasePrincipal(
+    permURI,
+    {}
+  );
 
   let now = Number(Date.now());
 
   // add a permission with *now* expiration
-  pm.addFromPrincipal(principal, "test/expiration-perm-exp", 1, pm.EXPIRE_TIME, now);
-  pm.addFromPrincipal(principal, "test/expiration-session-exp", 1, pm.EXPIRE_SESSION, now);
+  pm.addFromPrincipal(
+    principal,
+    "test/expiration-perm-exp",
+    1,
+    pm.EXPIRE_TIME,
+    now
+  );
+  pm.addFromPrincipal(
+    principal,
+    "test/expiration-session-exp",
+    1,
+    pm.EXPIRE_SESSION,
+    now
+  );
 
   // add a permission with future expiration (100 milliseconds)
-  pm.addFromPrincipal(principal, "test/expiration-perm-exp2", 1, pm.EXPIRE_TIME, now + 100);
-  pm.addFromPrincipal(principal, "test/expiration-session-exp2", 1, pm.EXPIRE_SESSION, now + 100);
+  pm.addFromPrincipal(
+    principal,
+    "test/expiration-perm-exp2",
+    1,
+    pm.EXPIRE_TIME,
+    now + 100
+  );
+  pm.addFromPrincipal(
+    principal,
+    "test/expiration-session-exp2",
+    1,
+    pm.EXPIRE_SESSION,
+    now + 100
+  );
 
   // add a permission with future expiration (1000 seconds)
-  pm.addFromPrincipal(principal, "test/expiration-perm-exp3", 1, pm.EXPIRE_TIME, now + 1e6);
-  pm.addFromPrincipal(principal, "test/expiration-session-exp3", 1, pm.EXPIRE_SESSION, now + 1e6);
+  pm.addFromPrincipal(
+    principal,
+    "test/expiration-perm-exp3",
+    1,
+    pm.EXPIRE_TIME,
+    now + 1e6
+  );
+  pm.addFromPrincipal(
+    principal,
+    "test/expiration-session-exp3",
+    1,
+    pm.EXPIRE_SESSION,
+    now + 1e6
+  );
 
   // add a permission without expiration
-  pm.addFromPrincipal(principal, "test/expiration-perm-nexp", 1, pm.EXPIRE_NEVER, 0);
+  pm.addFromPrincipal(
+    principal,
+    "test/expiration-perm-nexp",
+    1,
+    pm.EXPIRE_NEVER,
+    0
+  );
 
   // add a permission for renewal
-  pm.addFromPrincipal(principal, "test/expiration-perm-renewable", 1, pm.EXPIRE_TIME, now + 100);
-  pm.addFromPrincipal(principal, "test/expiration-session-renewable", 1, pm.EXPIRE_SESSION, now + 100);
+  pm.addFromPrincipal(
+    principal,
+    "test/expiration-perm-renewable",
+    1,
+    pm.EXPIRE_TIME,
+    now + 100
+  );
+  pm.addFromPrincipal(
+    principal,
+    "test/expiration-session-renewable",
+    1,
+    pm.EXPIRE_SESSION,
+    now + 100
+  );
 
   // And immediately renew them with longer timeouts
-  pm.updateExpireTime(principal, "test/expiration-perm-renewable", true, now + 100, now + 1e6);
-  pm.updateExpireTime(principal, "test/expiration-session-renewable", true, now + 1e6, now + 100);
+  pm.updateExpireTime(
+    principal,
+    "test/expiration-perm-renewable",
+    true,
+    now + 100,
+    now + 1e6
+  );
+  pm.updateExpireTime(
+    principal,
+    "test/expiration-session-renewable",
+    true,
+    now + 1e6,
+    now + 100
+  );
 
   // check that the second two haven't expired yet
-  Assert.equal(1, pm.testPermissionFromPrincipal(principal, "test/expiration-perm-exp3"));
-  Assert.equal(1, pm.testPermissionFromPrincipal(principal, "test/expiration-session-exp3"));
-  Assert.equal(1, pm.testPermissionFromPrincipal(principal, "test/expiration-perm-nexp"));
-  Assert.equal(1, pm.testPermissionFromPrincipal(principal, "test/expiration-perm-renewable"));
-  Assert.equal(1, pm.testPermissionFromPrincipal(principal, "test/expiration-session-renewable"));
+  Assert.equal(
+    1,
+    pm.testPermissionFromPrincipal(principal, "test/expiration-perm-exp3")
+  );
+  Assert.equal(
+    1,
+    pm.testPermissionFromPrincipal(principal, "test/expiration-session-exp3")
+  );
+  Assert.equal(
+    1,
+    pm.testPermissionFromPrincipal(principal, "test/expiration-perm-nexp")
+  );
+  Assert.equal(
+    1,
+    pm.testPermissionFromPrincipal(principal, "test/expiration-perm-renewable")
+  );
+  Assert.equal(
+    1,
+    pm.testPermissionFromPrincipal(
+      principal,
+      "test/expiration-session-renewable"
+    )
+  );
 
   // ... and the first one has
   do_timeout(10, continue_test);
   yield;
-  Assert.equal(0, pm.testPermissionFromPrincipal(principal, "test/expiration-perm-exp"));
-  Assert.equal(0, pm.testPermissionFromPrincipal(principal, "test/expiration-session-exp"));
+  Assert.equal(
+    0,
+    pm.testPermissionFromPrincipal(principal, "test/expiration-perm-exp")
+  );
+  Assert.equal(
+    0,
+    pm.testPermissionFromPrincipal(principal, "test/expiration-session-exp")
+  );
 
   // ... and that the short-term one will
   do_timeout(200, continue_test);
   yield;
-  Assert.equal(0, pm.testPermissionFromPrincipal(principal, "test/expiration-perm-exp2"));
-  Assert.equal(0, pm.testPermissionFromPrincipal(principal, "test/expiration-session-exp2"));
+  Assert.equal(
+    0,
+    pm.testPermissionFromPrincipal(principal, "test/expiration-perm-exp2")
+  );
+  Assert.equal(
+    0,
+    pm.testPermissionFromPrincipal(principal, "test/expiration-session-exp2")
+  );
 
   // Check that .getPermission returns a matching result
-  Assert.equal(null, pm.getPermissionObject(principal, "test/expiration-perm-exp", false));
-  Assert.equal(null, pm.getPermissionObject(principal, "test/expiration-session-exp", false));
-  Assert.equal(null, pm.getPermissionObject(principal, "test/expiration-perm-exp2", false));
-  Assert.equal(null, pm.getPermissionObject(principal, "test/expiration-session-exp2", false));
+  Assert.equal(
+    null,
+    pm.getPermissionObject(principal, "test/expiration-perm-exp", false)
+  );
+  Assert.equal(
+    null,
+    pm.getPermissionObject(principal, "test/expiration-session-exp", false)
+  );
+  Assert.equal(
+    null,
+    pm.getPermissionObject(principal, "test/expiration-perm-exp2", false)
+  );
+  Assert.equal(
+    null,
+    pm.getPermissionObject(principal, "test/expiration-session-exp2", false)
+  );
 
   // Check that the renewable permissions actually got renewed
-  Assert.equal(1, pm.testPermissionFromPrincipal(principal, "test/expiration-perm-renewable"));
-  Assert.equal(1, pm.testPermissionFromPrincipal(principal, "test/expiration-session-renewable"));
+  Assert.equal(
+    1,
+    pm.testPermissionFromPrincipal(principal, "test/expiration-perm-renewable")
+  );
+  Assert.equal(
+    1,
+    pm.testPermissionFromPrincipal(
+      principal,
+      "test/expiration-session-renewable"
+    )
+  );
 
   do_finish_generator_test(test_generator);
 }
-
--- a/extensions/permissions/test/unit/test_permmanager_getAllForURI.js
+++ b/extensions/permissions/test/unit/test_permmanager_getAllForURI.js
@@ -1,78 +1,73 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function check_enumerator(uri, permissions) {
-  let pm = Cc["@mozilla.org/permissionmanager;1"]
-           .getService(Ci.nsIPermissionManager);
+  let pm = Cc["@mozilla.org/permissionmanager;1"].getService(
+    Ci.nsIPermissionManager
+  );
 
   let enumerator = pm.getAllForURI(uri);
   for ([type, capability] of permissions) {
     let perm = enumerator.getNext();
     Assert.ok(perm != null);
     Assert.ok(perm.principal.URI.equals(uri));
     Assert.equal(perm.type, type);
     Assert.equal(perm.capability, capability);
     Assert.equal(perm.expireType, pm.EXPIRE_NEVER);
   }
   Assert.ok(!enumerator.hasMoreElements());
 }
 
 function run_test() {
-  let pm = Cc["@mozilla.org/permissionmanager;1"]
-           .getService(Ci.nsIPermissionManager);
+  let pm = Cc["@mozilla.org/permissionmanager;1"].getService(
+    Ci.nsIPermissionManager
+  );
 
   let uri = NetUtil.newURI("http://example.com");
   let sub = NetUtil.newURI("http://sub.example.com");
 
-  check_enumerator(uri, [ ]);
+  check_enumerator(uri, []);
 
   pm.add(uri, "test/getallforuri", pm.ALLOW_ACTION);
-  check_enumerator(uri, [
-    [ "test/getallforuri", pm.ALLOW_ACTION ]
-  ]);
+  check_enumerator(uri, [["test/getallforuri", pm.ALLOW_ACTION]]);
 
   // check that uris are matched exactly
-  check_enumerator(sub, [ ]);
+  check_enumerator(sub, []);
 
   pm.add(sub, "test/getallforuri", pm.PROMPT_ACTION);
   pm.add(sub, "test/getallforuri2", pm.DENY_ACTION);
 
   check_enumerator(sub, [
-    [ "test/getallforuri", pm.PROMPT_ACTION ],
-    [ "test/getallforuri2", pm.DENY_ACTION ]
+    ["test/getallforuri", pm.PROMPT_ACTION],
+    ["test/getallforuri2", pm.DENY_ACTION],
   ]);
 
   // check that the original uri list has not changed
-  check_enumerator(uri, [
-    [ "test/getallforuri", pm.ALLOW_ACTION ]
-  ]);
+  check_enumerator(uri, [["test/getallforuri", pm.ALLOW_ACTION]]);
 
   // check that UNKNOWN_ACTION permissions are ignored
   pm.add(uri, "test/getallforuri2", pm.UNKNOWN_ACTION);
   pm.add(uri, "test/getallforuri3", pm.DENY_ACTION);
 
   check_enumerator(uri, [
-    [ "test/getallforuri", pm.ALLOW_ACTION ],
-    [ "test/getallforuri3", pm.DENY_ACTION ]
+    ["test/getallforuri", pm.ALLOW_ACTION],
+    ["test/getallforuri3", pm.DENY_ACTION],
   ]);
 
   // check that permission updates are reflected
   pm.add(uri, "test/getallforuri", pm.PROMPT_ACTION);
 
   check_enumerator(uri, [
-    [ "test/getallforuri", pm.PROMPT_ACTION ],
-    [ "test/getallforuri3", pm.DENY_ACTION ]
+    ["test/getallforuri", pm.PROMPT_ACTION],
+    ["test/getallforuri3", pm.DENY_ACTION],
   ]);
 
   // check that permission removals are reflected
   pm.remove(uri, "test/getallforuri");
 
-  check_enumerator(uri, [
-    [ "test/getallforuri3", pm.DENY_ACTION ]
-  ]);
+  check_enumerator(uri, [["test/getallforuri3", pm.DENY_ACTION]]);
 
   pm.removeAll();
-  check_enumerator(uri, [ ]);
-  check_enumerator(sub, [ ]);
+  check_enumerator(uri, []);
+  check_enumerator(sub, []);
 }
-
--- a/extensions/permissions/test/unit/test_permmanager_getAllWithTypePrefix.js
+++ b/extensions/permissions/test/unit/test_permmanager_getAllWithTypePrefix.js
@@ -1,69 +1,70 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function check_enumerator(prefix, permissions) {
-  let pm = Cc["@mozilla.org/permissionmanager;1"]
-           .getService(Ci.nsIPermissionManager);
+  let pm = Cc["@mozilla.org/permissionmanager;1"].getService(
+    Ci.nsIPermissionManager
+  );
 
   let array = pm.getAllWithTypePrefix(prefix);
   for (let [uri, type, capability] of permissions) {
     let perm = array.shift();
     Assert.ok(perm != null);
     Assert.ok(perm.principal.URI.equals(uri));
     Assert.equal(perm.type, type);
     Assert.equal(perm.capability, capability);
     Assert.equal(perm.expireType, pm.EXPIRE_NEVER);
   }
   Assert.equal(array.length, 0);
 }
 
 function run_test() {
-  let pm = Cc["@mozilla.org/permissionmanager;1"]
-           .getService(Ci.nsIPermissionManager);
+  let pm = Cc["@mozilla.org/permissionmanager;1"].getService(
+    Ci.nsIPermissionManager
+  );
 
   let uri = NetUtil.newURI("http://example.com");
   let sub = NetUtil.newURI("http://sub.example.com");
 
-  check_enumerator("test/", [ ]);
+  check_enumerator("test/", []);
 
   pm.add(uri, "test/getallwithtypeprefix", pm.ALLOW_ACTION);
   pm.add(sub, "other-test/getallwithtypeprefix", pm.PROMPT_ACTION);
   check_enumerator("test/", [
-    [ uri, "test/getallwithtypeprefix", pm.ALLOW_ACTION ],
+    [uri, "test/getallwithtypeprefix", pm.ALLOW_ACTION],
   ]);
 
   pm.add(sub, "test/getallwithtypeprefix", pm.PROMPT_ACTION);
   check_enumerator("test/", [
-    [ sub, "test/getallwithtypeprefix", pm.PROMPT_ACTION ],
-    [ uri, "test/getallwithtypeprefix", pm.ALLOW_ACTION ],
+    [sub, "test/getallwithtypeprefix", pm.PROMPT_ACTION],
+    [uri, "test/getallwithtypeprefix", pm.ALLOW_ACTION],
   ]);
 
   check_enumerator("test/getallwithtypeprefix", [
-    [ sub, "test/getallwithtypeprefix", pm.PROMPT_ACTION ],
-    [ uri, "test/getallwithtypeprefix", pm.ALLOW_ACTION ],
+    [sub, "test/getallwithtypeprefix", pm.PROMPT_ACTION],
+    [uri, "test/getallwithtypeprefix", pm.ALLOW_ACTION],
   ]);
 
   // check that UNKNOWN_ACTION permissions are ignored
   pm.add(uri, "test/getallwithtypeprefix2", pm.UNKNOWN_ACTION);
   check_enumerator("test/", [
-    [ sub, "test/getallwithtypeprefix", pm.PROMPT_ACTION ],
-    [ uri, "test/getallwithtypeprefix", pm.ALLOW_ACTION ],
+    [sub, "test/getallwithtypeprefix", pm.PROMPT_ACTION],
+    [uri, "test/getallwithtypeprefix", pm.ALLOW_ACTION],
   ]);
 
   // check that permission updates are reflected
   pm.add(uri, "test/getallwithtypeprefix", pm.PROMPT_ACTION);
   check_enumerator("test/", [
-    [ sub, "test/getallwithtypeprefix", pm.PROMPT_ACTION ],
-    [ uri, "test/getallwithtypeprefix", pm.PROMPT_ACTION ],
+    [sub, "test/getallwithtypeprefix", pm.PROMPT_ACTION],
+    [uri, "test/getallwithtypeprefix", pm.PROMPT_ACTION],
   ]);
 
   // check that permission removals are reflected
   pm.remove(uri, "test/getallwithtypeprefix");
   check_enumerator("test/", [
-    [ sub, "test/getallwithtypeprefix", pm.PROMPT_ACTION ],
+    [sub, "test/getallwithtypeprefix", pm.PROMPT_ACTION],
   ]);
 
   pm.removeAll();
-  check_enumerator("test/", [ ]);
+  check_enumerator("test/", []);
 }
-
--- a/extensions/permissions/test/unit/test_permmanager_getPermissionObject.js
+++ b/extensions/permissions/test/unit/test_permmanager_getPermissionObject.js
@@ -1,29 +1,34 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function getPrincipalFromURI(aURI) {
-  let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
-              .getService(Ci.nsIScriptSecurityManager);
+  let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(
+    Ci.nsIScriptSecurityManager
+  );
   let uri = NetUtil.newURI(aURI);
   return ssm.createCodebasePrincipal(uri, {});
 }
 
 function getSystemPrincipal() {
   return Cc["@mozilla.org/scriptsecuritymanager;1"]
-           .getService(Ci.nsIScriptSecurityManager)
-           .getSystemPrincipal();
+    .getService(Ci.nsIScriptSecurityManager)
+    .getSystemPrincipal();
 }
 
 function run_test() {
-  var pm = Cc["@mozilla.org/permissionmanager;1"].
-           getService(Ci.nsIPermissionManager);
+  var pm = Cc["@mozilla.org/permissionmanager;1"].getService(
+    Ci.nsIPermissionManager
+  );
 
-  Assert.equal(null, pm.getPermissionObject(getSystemPrincipal(), "test/pobject", false));
+  Assert.equal(
+    null,
+    pm.getPermissionObject(getSystemPrincipal(), "test/pobject", false)
+  );
 
   let principal = getPrincipalFromURI("http://example.com");
   let subPrincipal = getPrincipalFromURI("http://sub.example.com");
   let subSubPrincipal = getPrincipalFromURI("http://sub.sub.example.com");
 
   Assert.equal(null, pm.getPermissionObject(principal, "test/pobject", false));
   Assert.equal(null, pm.getPermissionObject(principal, "test/pobject", true));
 
@@ -48,17 +53,22 @@ function run_test() {
   Assert.equal(subPerm.capability, pm.ALLOW_ACTION);
 
   subPerm = pm.getPermissionObject(subSubPrincipal, "test/pobject", true);
   Assert.equal(null, subPerm);
   subPerm = pm.getPermissionObject(subSubPrincipal, "test/pobject", false);
   Assert.ok(subPerm != null);
   Assert.equal(subPerm.principal.origin, "http://example.com");
 
-  pm.addFromPrincipal(principal, "test/pobject", pm.DENY_ACTION, pm.EXPIRE_SESSION);
+  pm.addFromPrincipal(
+    principal,
+    "test/pobject",
+    pm.DENY_ACTION,
+    pm.EXPIRE_SESSION
+  );
 
   // make sure permission objects are not dynamic
   Assert.equal(rootPerm.capability, pm.ALLOW_ACTION);
 
   // but do update on change
   rootPerm = pm.getPermissionObject(principal, "test/pobject", true);
   Assert.equal(rootPerm.capability, pm.DENY_ACTION);
   Assert.equal(rootPerm.expireType, pm.EXPIRE_SESSION);
--- a/extensions/permissions/test/unit/test_permmanager_idn.js
+++ b/extensions/permissions/test/unit/test_permmanager_idn.js
@@ -1,49 +1,78 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function getPrincipalFromDomain(aDomain) {
-  let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
-              .getService(Ci.nsIScriptSecurityManager);
+  let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(
+    Ci.nsIScriptSecurityManager
+  );
   let uri = NetUtil.newURI("http://" + aDomain);
   return ssm.createCodebasePrincipal(uri, {});
 }
 
 function run_test() {
   let profile = do_get_profile();
   let pm = Services.perms;
-  let perm = 'test-idn';
+  let perm = "test-idn";
 
   // We create three principal linked to IDN.
   // One with just a domain, one with a subdomain and one with the TLD
   // containing a UTF-8 character.
   let mainDomainPrincipal = getPrincipalFromDomain("fôû.com");
   let subDomainPrincipal = getPrincipalFromDomain("fôô.bàr.com");
   let tldPrincipal = getPrincipalFromDomain("fôû.bàr.côm");
 
   // We add those to the permission manager.
   pm.addFromPrincipal(mainDomainPrincipal, perm, pm.ALLOW_ACTION, 0, 0);
   pm.addFromPrincipal(subDomainPrincipal, perm, pm.ALLOW_ACTION, 0, 0);
   pm.addFromPrincipal(tldPrincipal, perm, pm.ALLOW_ACTION, 0, 0);
 
   // They should obviously be there now..
-  Assert.equal(pm.testPermissionFromPrincipal(mainDomainPrincipal, perm), pm.ALLOW_ACTION);
-  Assert.equal(pm.testPermissionFromPrincipal(subDomainPrincipal, perm), pm.ALLOW_ACTION);
-  Assert.equal(pm.testPermissionFromPrincipal(tldPrincipal, perm), pm.ALLOW_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(mainDomainPrincipal, perm),
+    pm.ALLOW_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(subDomainPrincipal, perm),
+    pm.ALLOW_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(tldPrincipal, perm),
+    pm.ALLOW_ACTION
+  );
 
   // We do the same thing with the puny-encoded versions of the IDN.
-  let punyMainDomainPrincipal = getPrincipalFromDomain('xn--f-xgav.com');
-  let punySubDomainPrincipal = getPrincipalFromDomain('xn--f-xgaa.xn--br-jia.com');
-  let punyTldPrincipal = getPrincipalFromDomain('xn--f-xgav.xn--br-jia.xn--cm-8ja');
+  let punyMainDomainPrincipal = getPrincipalFromDomain("xn--f-xgav.com");
+  let punySubDomainPrincipal = getPrincipalFromDomain(
+    "xn--f-xgaa.xn--br-jia.com"
+  );
+  let punyTldPrincipal = getPrincipalFromDomain(
+    "xn--f-xgav.xn--br-jia.xn--cm-8ja"
+  );
 
   // Those principals should have the permission granted too.
-  Assert.equal(pm.testPermissionFromPrincipal(punyMainDomainPrincipal, perm), pm.ALLOW_ACTION);
-  Assert.equal(pm.testPermissionFromPrincipal(punySubDomainPrincipal, perm), pm.ALLOW_ACTION);
-  Assert.equal(pm.testPermissionFromPrincipal(punyTldPrincipal, perm), pm.ALLOW_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(punyMainDomainPrincipal, perm),
+    pm.ALLOW_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(punySubDomainPrincipal, perm),
+    pm.ALLOW_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(punyTldPrincipal, perm),
+    pm.ALLOW_ACTION
+  );
 
   // However, those two principals shouldn't be allowed because they are like
   // the IDN but without the UT8-8 characters.
   let witnessPrincipal = getPrincipalFromDomain("foo.com");
-  Assert.equal(pm.testPermissionFromPrincipal(witnessPrincipal, perm), pm.UNKNOWN_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(witnessPrincipal, perm),
+    pm.UNKNOWN_ACTION
+  );
   witnessPrincipal = getPrincipalFromDomain("foo.bar.com");
-  Assert.equal(pm.testPermissionFromPrincipal(witnessPrincipal, perm), pm.UNKNOWN_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(witnessPrincipal, perm),
+    pm.UNKNOWN_ACTION
+  );
 }
--- a/extensions/permissions/test/unit/test_permmanager_load_invalid_entries.js
+++ b/extensions/permissions/test/unit/test_permmanager_load_invalid_entries.js
@@ -5,138 +5,255 @@ var DEBUG_TEST = false;
 
 function run_test() {
   // Setup a profile directory.
   var dir = do_get_profile();
   // Get the db file.
   var file = dir.clone();
   file.append("permissions.sqlite");
 
-  var storage = Cc["@mozilla.org/storage/service;1"]
-                  .getService(Ci.mozIStorageService);
+  var storage = Cc["@mozilla.org/storage/service;1"].getService(
+    Ci.mozIStorageService
+  );
 
   // Create database.
   var connection = storage.openDatabase(file);
   // The file should now exist.
   Assert.ok(file.exists());
 
   connection.schemaVersion = 3;
-  connection.executeSimpleSQL(
-    "DROP TABLE moz_hosts");
+  connection.executeSimpleSQL("DROP TABLE moz_hosts");
   connection.executeSimpleSQL(
     "CREATE TABLE moz_hosts (" +
       " id INTEGER PRIMARY KEY" +
       ",host TEXT" +
       ",type TEXT" +
       ",permission INTEGER" +
       ",expireType INTEGER" +
       ",expireTime INTEGER" +
       ",appId INTEGER" +
       ",isInBrowserElement INTEGER" +
-    ")");
+      ")"
+  );
 
   // Now we can inject garbadge in the database.
   var garbadge = [
     // Regular entry.
-    { host: '42', type: '0', permission: 1, expireType: 0, expireTime: 0,
-      isInBrowserElement: 0 },
+    {
+      host: "42",
+      type: "0",
+      permission: 1,
+      expireType: 0,
+      expireTime: 0,
+      isInBrowserElement: 0,
+    },
 
     // Special values in host (some being invalid).
-    { host: 'scheme:file', type: '1', permission: 0, expireType: 0,
-      expireTime: 0, isInBrowserElement: 0 },
-    { host: '192.168.0.1', type: '2', permission: 0, expireType: 0,
-      expireTime: 0, isInBrowserElement: 0 },
-    { host: '2001:0db8:0000:0000:0000:ff00:0042:8329', type: '3', permission: 0,
-      expireType: 0, expireTime: 0, isInBrowserElement: 0 },
-    { host: '::1', type: '4', permission: 0, expireType: 0, expireTime: 0,
-      isInBrowserElement: 0 },
+    {
+      host: "scheme:file",
+      type: "1",
+      permission: 0,
+      expireType: 0,
+      expireTime: 0,
+      isInBrowserElement: 0,
+    },
+    {
+      host: "192.168.0.1",
+      type: "2",
+      permission: 0,
+      expireType: 0,
+      expireTime: 0,
+      isInBrowserElement: 0,
+    },
+    {
+      host: "2001:0db8:0000:0000:0000:ff00:0042:8329",
+      type: "3",
+      permission: 0,
+      expireType: 0,
+      expireTime: 0,
+      isInBrowserElement: 0,
+    },
+    {
+      host: "::1",
+      type: "4",
+      permission: 0,
+      expireType: 0,
+      expireTime: 0,
+      isInBrowserElement: 0,
+    },
 
     // Permission is UNKNOWN_ACTION.
-    { host: '42', type: '5', permission: Ci.nsIPermissionManager.UNKNOWN_ACTION,
-      expireType: 0, expireTime: 0, isInBrowserElement: 0 },
+    {
+      host: "42",
+      type: "5",
+      permission: Ci.nsIPermissionManager.UNKNOWN_ACTION,
+      expireType: 0,
+      expireTime: 0,
+      isInBrowserElement: 0,
+    },
 
     // Permission is out of range.
-    { host: '42', type: '6', permission: 100, expireType: 0, expireTime: 0,
-      isInBrowserElement: 0 },
-    { host: '42', type: '7', permission: -100, expireType: 0, expireTime: 0,
-      isInBrowserElement: 0 },
+    {
+      host: "42",
+      type: "6",
+      permission: 100,
+      expireType: 0,
+      expireTime: 0,
+      isInBrowserElement: 0,
+    },
+    {
+      host: "42",
+      type: "7",
+      permission: -100,
+      expireType: 0,
+      expireTime: 0,
+      isInBrowserElement: 0,
+    },
 
     // ExpireType is out of range.
-    { host: '42', type: '8', permission: 1, expireType: -100, expireTime: 0,
-      isInBrowserElement: 0 },
-    { host: '42', type: '9', permission: 1, expireType: 100, expireTime: 0,
-      isInBrowserElement: 0 },
+    {
+      host: "42",
+      type: "8",
+      permission: 1,
+      expireType: -100,
+      expireTime: 0,
+      isInBrowserElement: 0,
+    },
+    {
+      host: "42",
+      type: "9",
+      permission: 1,
+      expireType: 100,
+      expireTime: 0,
+      isInBrowserElement: 0,
+    },
 
     // ExpireTime is at 0 with ExpireType = Time.
-    { host: '42', type: '10', permission: 1,
-      expireType: Ci.nsIPermissionManager.EXPIRE_TIME, expireTime: 0,
-      isInBrowserElement: 0 },
+    {
+      host: "42",
+      type: "10",
+      permission: 1,
+      expireType: Ci.nsIPermissionManager.EXPIRE_TIME,
+      expireTime: 0,
+      isInBrowserElement: 0,
+    },
 
     // ExpireTime has a value with ExpireType != Time
-    { host: '42', type: '11', permission: 1,
-      expireType: Ci.nsIPermissionManager.EXPIRE_SESSION, expireTime: 1000,
-      isInBrowserElement: 0 },
-    { host: '42', type: '12', permission: 1,
-      expireType: Ci.nsIPermissionManager.EXPIRE_NEVER, expireTime: 1000,
-      isInBrowserElement: 0 },
+    {
+      host: "42",
+      type: "11",
+      permission: 1,
+      expireType: Ci.nsIPermissionManager.EXPIRE_SESSION,
+      expireTime: 1000,
+      isInBrowserElement: 0,
+    },
+    {
+      host: "42",
+      type: "12",
+      permission: 1,
+      expireType: Ci.nsIPermissionManager.EXPIRE_NEVER,
+      expireTime: 1000,
+      isInBrowserElement: 0,
+    },
 
     // ExpireTime is negative.
-    { host: '42', type: '13', permission: 1,
-      expireType: Ci.nsIPermissionManager.EXPIRE_TIME, expireTime: -1,
-      isInBrowserElement: 0 },
+    {
+      host: "42",
+      type: "13",
+      permission: 1,
+      expireType: Ci.nsIPermissionManager.EXPIRE_TIME,
+      expireTime: -1,
+      isInBrowserElement: 0,
+    },
 
     // IsInBrowserElement is negative or higher than 1.
-    { host: '42', type: '15', permission: 1, expireType: 0, expireTime: 0,
-      isInBrowserElement: -1 },
-    { host: '42', type: '16', permission: 1, expireType: 0, expireTime: 0,
-      isInBrowserElement: 10 },
+    {
+      host: "42",
+      type: "15",
+      permission: 1,
+      expireType: 0,
+      expireTime: 0,
+      isInBrowserElement: -1,
+    },
+    {
+      host: "42",
+      type: "16",
+      permission: 1,
+      expireType: 0,
+      expireTime: 0,
+      isInBrowserElement: 10,
+    },
 
     // This insertion should be the last one. It is used to make sure we always
     // load it regardless of the previous entries validities.
-    { host: 'example.org', type: 'test-load-invalid-entries',
-      permission: Ci.nsIPermissionManager.ALLOW_ACTION, expireType: 0,
-      expireTime: 0, isInBrowserElement: 0 },
+    {
+      host: "example.org",
+      type: "test-load-invalid-entries",
+      permission: Ci.nsIPermissionManager.ALLOW_ACTION,
+      expireType: 0,
+      expireTime: 0,
+      isInBrowserElement: 0,
+    },
   ];
 
-  for (var i=0; i<garbadge.length; ++i) {
+  for (var i = 0; i < garbadge.length; ++i) {
     if (DEBUG_TEST) {
       dump("\n value #" + i + "\n\n");
     }
     var data = garbadge[i];
     connection.executeSimpleSQL(
       "INSERT INTO moz_hosts " +
-      " (id, host, type, permission, expireType, expireTime, isInBrowserElement, appId) " +
-      "VALUES (" + i + ", '" + data.host + "', '" + data.type + "', "
-                 + data.permission + ", " + data.expireType + ", "
-                 + data.expireTime + ", " + data.isInBrowserElement + ", 0)"
+        " (id, host, type, permission, expireType, expireTime, isInBrowserElement, appId) " +
+        "VALUES (" +
+        i +
+        ", '" +
+        data.host +
+        "', '" +
+        data.type +
+        "', " +
+        data.permission +
+        ", " +
+        data.expireType +
+        ", " +
+        data.expireTime +
+        ", " +
+        data.isInBrowserElement +
+        ", 0)"
     );
   }
 
   // This will force the permission-manager to reload the data.
   Services.obs.notifyObservers(null, "testonly-reload-permissions-from-disk");
 
   let earliestNow = Number(Date.now());
   // Initialize the permission manager service
-  var pm = Cc["@mozilla.org/permissionmanager;1"]
-             .getService(Ci.nsIPermissionManager);
+  var pm = Cc["@mozilla.org/permissionmanager;1"].getService(
+    Ci.nsIPermissionManager
+  );
   let latestNow = Number(Date.now());
 
   // The schema should be upgraded to 10, and a 'modificationTime' column should
   // exist with all records having a value of 0.
   Assert.equal(connection.schemaVersion, 10);
 
-  let select = connection.createStatement("SELECT modificationTime FROM moz_perms")
+  let select = connection.createStatement(
+    "SELECT modificationTime FROM moz_perms"
+  );
   let numMigrated = 0;
   while (select.executeStep()) {
     let thisModTime = select.getInt64(0);
     Assert.ok(thisModTime == 0, "new modifiedTime field is correct");
     numMigrated += 1;
   }
   // check we found at least 1 record that was migrated.
   Assert.ok(numMigrated > 0, "we found at least 1 record that was migrated");
 
   // This permission should always be there.
-  let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
-              .getService(Ci.nsIScriptSecurityManager);
+  let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(
+    Ci.nsIScriptSecurityManager
+  );
   let uri = NetUtil.newURI("http://example.org");
   let principal = ssm.createCodebasePrincipal(uri, {});
-  Assert.equal(pm.testPermissionFromPrincipal(principal, 'test-load-invalid-entries'), Ci.nsIPermissionManager.ALLOW_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(principal, "test-load-invalid-entries"),
+    Ci.nsIPermissionManager.ALLOW_ACTION
+  );
 }
--- a/extensions/permissions/test/unit/test_permmanager_local_files.js
+++ b/extensions/permissions/test/unit/test_permmanager_local_files.js
@@ -1,43 +1,74 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Test that permissions work for file:// URIs (aka local files).
 
-function getPrincipalFromURIString(uriStr)
-{
+function getPrincipalFromURIString(uriStr) {
   let uri = NetUtil.newURI(uriStr);
   return Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
 }
 
 function run_test() {
   let pm = Services.perms;
 
   // If we add a permission to a file:// URI, the test should return true.
   let principal = getPrincipalFromURIString("file:///foo/bar");
   pm.addFromPrincipal(principal, "test/local-files", pm.ALLOW_ACTION, 0, 0);
-  Assert.equal(pm.testPermissionFromPrincipal(principal, "test/local-files"), pm.ALLOW_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(principal, "test/local-files"),
+    pm.ALLOW_ACTION
+  );
 
   // Another file:// URI should have the same permission.
   let witnessPrincipal = getPrincipalFromURIString("file:///bar/foo");
-  Assert.equal(pm.testPermissionFromPrincipal(witnessPrincipal, "test/local-files"), pm.UNKNOWN_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(witnessPrincipal, "test/local-files"),
+    pm.UNKNOWN_ACTION
+  );
 
   // Giving "file:///" a permission shouldn't give it to all file:// URIs.
   let rootPrincipal = getPrincipalFromURIString("file:///");
   pm.addFromPrincipal(rootPrincipal, "test/local-files", pm.ALLOW_ACTION, 0, 0);
-  Assert.equal(pm.testPermissionFromPrincipal(witnessPrincipal, "test/local-files"), pm.UNKNOWN_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(witnessPrincipal, "test/local-files"),
+    pm.UNKNOWN_ACTION
+  );
 
   // Giving "file://" a permission shouldn't give it to all file:// URIs.
   let schemeRootPrincipal = getPrincipalFromURIString("file://");
-  pm.addFromPrincipal(schemeRootPrincipal, "test/local-files", pm.ALLOW_ACTION, 0, 0);
-  Assert.equal(pm.testPermissionFromPrincipal(witnessPrincipal, "test/local-files"), pm.UNKNOWN_ACTION);
+  pm.addFromPrincipal(
+    schemeRootPrincipal,
+    "test/local-files",
+    pm.ALLOW_ACTION,
+    0,
+    0
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(witnessPrincipal, "test/local-files"),
+    pm.UNKNOWN_ACTION
+  );
 
   // Giving 'node' a permission shouldn't give it to its 'children'.
-  let fileInDirPrincipal = getPrincipalFromURIString("file:///foo/bar/foobar.txt");
-  Assert.equal(pm.testPermissionFromPrincipal(fileInDirPrincipal, "test/local-files"), pm.UNKNOWN_ACTION);
+  let fileInDirPrincipal = getPrincipalFromURIString(
+    "file:///foo/bar/foobar.txt"
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(fileInDirPrincipal, "test/local-files"),
+    pm.UNKNOWN_ACTION
+  );
 
   // Revert "file:///foo/bar" permission and check that it has been correctly taken into account.
   pm.removeFromPrincipal(principal, "test/local-files");
-  Assert.equal(pm.testPermissionFromPrincipal(principal, "test/local-files"), pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionFromPrincipal(witnessPrincipal, "test/local-files"), pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionFromPrincipal(fileInDirPrincipal, "test/local-files"), pm.UNKNOWN_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(principal, "test/local-files"),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(witnessPrincipal, "test/local-files"),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(fileInDirPrincipal, "test/local-files"),
+    pm.UNKNOWN_ACTION
+  );
 }
--- a/extensions/permissions/test/unit/test_permmanager_matches.js
+++ b/extensions/permissions/test/unit/test_permmanager_matches.js
@@ -1,72 +1,92 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function matches_always(perm, principals) {
-  principals.forEach((principal) => {
-    Assert.ok(perm.matches(principal, true), "perm: " + perm.principal.origin + ", princ: " + principal.origin);
-    Assert.ok(perm.matches(principal, false), "perm: " + perm.principal.origin + ", princ: " + principal.origin);
+  principals.forEach(principal => {
+    Assert.ok(
+      perm.matches(principal, true),
+      "perm: " + perm.principal.origin + ", princ: " + principal.origin
+    );
+    Assert.ok(
+      perm.matches(principal, false),
+      "perm: " + perm.principal.origin + ", princ: " + principal.origin
+    );
   });
 }
 
 function matches_weak(perm, principals) {
-  principals.forEach((principal) => {
-    Assert.ok(!perm.matches(principal, true), "perm: " + perm.principal.origin + ", princ: " + principal.origin);
-    Assert.ok(perm.matches(principal, false), "perm: " + perm.principal.origin + ", princ: " + principal.origin);
+  principals.forEach(principal => {
+    Assert.ok(
+      !perm.matches(principal, true),
+      "perm: " + perm.principal.origin + ", princ: " + principal.origin
+    );
+    Assert.ok(
+      perm.matches(principal, false),
+      "perm: " + perm.principal.origin + ", princ: " + principal.origin
+    );
   });
 }
 
 function matches_never(perm, principals) {
-  principals.forEach((principal) => {
-    Assert.ok(!perm.matches(principal, true), "perm: " + perm.principal.origin + ", princ: " + principal.origin);
-    Assert.ok(!perm.matches(principal, false), "perm: " + perm.principal.origin + ", princ: " + principal.origin);
+  principals.forEach(principal => {
+    Assert.ok(
+      !perm.matches(principal, true),
+      "perm: " + perm.principal.origin + ", princ: " + principal.origin
+    );
+    Assert.ok(
+      !perm.matches(principal, false),
+      "perm: " + perm.principal.origin + ", princ: " + principal.origin
+    );
   });
 }
 
 function run_test() {
   // initialize the permission manager service
-  let pm = Cc["@mozilla.org/permissionmanager;1"].
-        getService(Ci.nsIPermissionManager);
+  let pm = Cc["@mozilla.org/permissionmanager;1"].getService(
+    Ci.nsIPermissionManager
+  );
 
-  let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
-        .getService(Ci.nsIScriptSecurityManager);
+  let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(
+    Ci.nsIScriptSecurityManager
+  );
 
   // Add some permissions
   let uri0 = NetUtil.newURI("http://google.com/search?q=foo#hashtag");
   let uri1 = NetUtil.newURI("http://hangouts.google.com/subdir");
   let uri2 = NetUtil.newURI("http://google.org/");
   let uri3 = NetUtil.newURI("https://google.com/some/random/subdirectory");
   let uri4 = NetUtil.newURI("https://hangouts.google.com/#!/hangout");
   let uri5 = NetUtil.newURI("http://google.com:8096/");
 
   let uri0_n = secMan.createCodebasePrincipal(uri0, {});
   let uri1_n = secMan.createCodebasePrincipal(uri1, {});
   let uri2_n = secMan.createCodebasePrincipal(uri2, {});
   let uri3_n = secMan.createCodebasePrincipal(uri3, {});
   let uri4_n = secMan.createCodebasePrincipal(uri4, {});
   let uri5_n = secMan.createCodebasePrincipal(uri5, {});
 
-  attrs = {inIsolatedMozBrowser: true};
+  attrs = { inIsolatedMozBrowser: true };
   let uri0_y_ = secMan.createCodebasePrincipal(uri0, attrs);
   let uri1_y_ = secMan.createCodebasePrincipal(uri1, attrs);
   let uri2_y_ = secMan.createCodebasePrincipal(uri2, attrs);
   let uri3_y_ = secMan.createCodebasePrincipal(uri3, attrs);
   let uri4_y_ = secMan.createCodebasePrincipal(uri4, attrs);
   let uri5_y_ = secMan.createCodebasePrincipal(uri5, attrs);
 
-  attrs = {userContextId: 1};
+  attrs = { userContextId: 1 };
   let uri0_1 = secMan.createCodebasePrincipal(uri0, attrs);
   let uri1_1 = secMan.createCodebasePrincipal(uri1, attrs);
   let uri2_1 = secMan.createCodebasePrincipal(uri2, attrs);
   let uri3_1 = secMan.createCodebasePrincipal(uri3, attrs);
   let uri4_1 = secMan.createCodebasePrincipal(uri4, attrs);
   let uri5_1 = secMan.createCodebasePrincipal(uri5, attrs);
 
-  attrs = {firstPartyDomain: "cnn.com"};
+  attrs = { firstPartyDomain: "cnn.com" };
   let uri0_cnn = secMan.createCodebasePrincipal(uri0, attrs);
   let uri1_cnn = secMan.createCodebasePrincipal(uri1, attrs);
   let uri2_cnn = secMan.createCodebasePrincipal(uri2, attrs);
   let uri3_cnn = secMan.createCodebasePrincipal(uri3, attrs);
   let uri4_cnn = secMan.createCodebasePrincipal(uri4, attrs);
   let uri5_cnn = secMan.createCodebasePrincipal(uri5, attrs);
 
   pm.addFromPrincipal(uri0_n, "test/matches", pm.ALLOW_ACTION);
@@ -75,37 +95,111 @@ function run_test() {
   let perm_y_ = pm.getPermissionObject(uri0_y_, "test/matches", true);
   pm.addFromPrincipal(uri0_1, "test/matches", pm.ALLOW_ACTION);
   let perm_1 = pm.getPermissionObject(uri0_n, "test/matches", true);
   pm.addFromPrincipal(uri0_cnn, "test/matches", pm.ALLOW_ACTION);
   let perm_cnn = pm.getPermissionObject(uri0_n, "test/matches", true);
 
   matches_always(perm_n, [uri0_n, uri0_1]);
   matches_weak(perm_n, [uri1_n, uri1_1]);
-  matches_never(perm_n, [uri2_n, uri3_n, uri4_n, uri5_n,
-                           uri0_y_, uri1_y_, uri2_y_, uri3_y_, uri4_y_, uri5_y_,
-                           uri2_1, uri3_1, uri4_1, uri5_1,
-                           uri0_cnn, uri1_cnn, uri2_cnn, uri3_cnn, uri4_cnn, uri5_cnn]);
+  matches_never(perm_n, [
+    uri2_n,
+    uri3_n,
+    uri4_n,
+    uri5_n,
+    uri0_y_,
+    uri1_y_,
+    uri2_y_,
+    uri3_y_,
+    uri4_y_,
+    uri5_y_,
+    uri2_1,
+    uri3_1,
+    uri4_1,
+    uri5_1,
+    uri0_cnn,
+    uri1_cnn,
+    uri2_cnn,
+    uri3_cnn,
+    uri4_cnn,
+    uri5_cnn,
+  ]);
 
   matches_always(perm_y_, [uri0_y_]);
   matches_weak(perm_y_, [uri1_y_]);
-  matches_never(perm_y_, [uri2_y_, uri3_y_, uri4_y_, uri5_y_,
-                              uri0_n, uri1_n, uri2_n, uri3_n, uri4_n, uri5_n,
-                              uri0_1, uri1_1, uri2_1, uri3_1, uri4_1, uri5_1,
-                              uri0_cnn, uri1_cnn, uri2_cnn, uri3_cnn, uri4_cnn, uri5_cnn]);
+  matches_never(perm_y_, [
+    uri2_y_,
+    uri3_y_,
+    uri4_y_,
+    uri5_y_,
+    uri0_n,
+    uri1_n,
+    uri2_n,
+    uri3_n,
+    uri4_n,
+    uri5_n,
+    uri0_1,
+    uri1_1,
+    uri2_1,
+    uri3_1,
+    uri4_1,
+    uri5_1,
+    uri0_cnn,
+    uri1_cnn,
+    uri2_cnn,
+    uri3_cnn,
+    uri4_cnn,
+    uri5_cnn,
+  ]);
 
   matches_always(perm_1, [uri0_n, uri0_1]);
   matches_weak(perm_1, [uri1_n, uri1_1]);
-  matches_never(perm_1, [uri2_n, uri3_n, uri4_n, uri5_n,
-                         uri0_y_, uri1_y_, uri2_y_, uri3_y_, uri4_y_, uri5_y_,
-                         uri2_1, uri3_1, uri4_1, uri5_1,
-                         uri0_cnn, uri1_cnn, uri2_cnn, uri3_cnn, uri4_cnn, uri5_cnn]);
+  matches_never(perm_1, [
+    uri2_n,
+    uri3_n,
+    uri4_n,
+    uri5_n,
+    uri0_y_,
+    uri1_y_,
+    uri2_y_,
+    uri3_y_,
+    uri4_y_,
+    uri5_y_,
+    uri2_1,
+    uri3_1,
+    uri4_1,
+    uri5_1,
+    uri0_cnn,
+    uri1_cnn,
+    uri2_cnn,
+    uri3_cnn,
+    uri4_cnn,
+    uri5_cnn,
+  ]);
 
   matches_always(perm_cnn, [uri0_n, uri0_1]);
   matches_weak(perm_cnn, [uri1_n, uri1_1]);
-  matches_never(perm_cnn, [uri2_n, uri3_n, uri4_n, uri5_n,
-                           uri0_y_, uri1_y_, uri2_y_, uri3_y_, uri4_y_, uri5_y_,
-                           uri2_1, uri3_1, uri4_1, uri5_1,
-                           uri0_cnn, uri1_cnn, uri2_cnn, uri3_cnn, uri4_cnn, uri5_cnn]);
+  matches_never(perm_cnn, [
+    uri2_n,
+    uri3_n,
+    uri4_n,
+    uri5_n,
+    uri0_y_,
+    uri1_y_,
+    uri2_y_,
+    uri3_y_,
+    uri4_y_,
+    uri5_y_,
+    uri2_1,
+    uri3_1,
+    uri4_1,
+    uri5_1,
+    uri0_cnn,
+    uri1_cnn,
+    uri2_cnn,
+    uri3_cnn,
+    uri4_cnn,
+    uri5_cnn,
+  ]);
 
   // Clean up!
   pm.removeAll();
 }
--- a/extensions/permissions/test/unit/test_permmanager_matchesuri.js
+++ b/extensions/permissions/test/unit/test_permmanager_matchesuri.js
@@ -1,55 +1,77 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function matches_always(perm, uris) {
-  uris.forEach((uri) => {
-    Assert.ok(perm.matchesURI(uri, true), "perm: " + perm.principal.origin + ", URI: " + uri.spec);
-    Assert.ok(perm.matchesURI(uri, false), "perm: " + perm.principal.origin + ", URI: " + uri.spec);
+  uris.forEach(uri => {
+    Assert.ok(
+      perm.matchesURI(uri, true),
+      "perm: " + perm.principal.origin + ", URI: " + uri.spec
+    );
+    Assert.ok(
+      perm.matchesURI(uri, false),
+      "perm: " + perm.principal.origin + ", URI: " + uri.spec
+    );
   });
 }
 
 function matches_weak(perm, uris) {
-  uris.forEach((uri) => {
-    Assert.ok(!perm.matchesURI(uri, true), "perm: " + perm.principal.origin + ", URI: " + uri.spec);
-    Assert.ok(perm.matchesURI(uri, false), "perm: " + perm.principal.origin + ", URI: " + uri.spec);
+  uris.forEach(uri => {
+    Assert.ok(
+      !perm.matchesURI(uri, true),
+      "perm: " + perm.principal.origin + ", URI: " + uri.spec
+    );
+    Assert.ok(
+      perm.matchesURI(uri, false),
+      "perm: " + perm.principal.origin + ", URI: " + uri.spec
+    );
   });
 }
 
 function matches_never(perm, uris) {
-  uris.forEach((uri) => {
-    Assert.ok(!perm.matchesURI(uri, true), "perm: " + perm.principal.origin + ", URI: " + uri.spec);
-    Assert.ok(!perm.matchesURI(uri, false), "perm: " + perm.principal.origin + ", URI: " + uri.spec);
+  uris.forEach(uri => {
+    Assert.ok(
+      !perm.matchesURI(uri, true),
+      "perm: " + perm.principal.origin + ", URI: " + uri.spec
+    );
+    Assert.ok(
+      !perm.matchesURI(uri, false),
+      "perm: " + perm.principal.origin + ", URI: " + uri.spec
+    );
   });
 }
 
 function mk_permission(uri) {
-  let pm = Cc["@mozilla.org/permissionmanager;1"].
-        getService(Ci.nsIPermissionManager);
+  let pm = Cc["@mozilla.org/permissionmanager;1"].getService(
+    Ci.nsIPermissionManager
+  );
 
-  let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
-        .getService(Ci.nsIScriptSecurityManager);
+  let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(
+    Ci.nsIScriptSecurityManager
+  );
 
   // Get the permission from the principal!
   let principal = secMan.createCodebasePrincipal(uri, {});
 
   pm.addFromPrincipal(principal, "test/matchesuri", pm.ALLOW_ACTION);
   let permission = pm.getPermissionObject(principal, "test/matchesuri", true);
 
   return permission;
 }
 
 function run_test() {
   // initialize the permission manager service
-  let pm = Cc["@mozilla.org/permissionmanager;1"].
-        getService(Ci.nsIPermissionManager);
+  let pm = Cc["@mozilla.org/permissionmanager;1"].getService(
+    Ci.nsIPermissionManager
+  );
 
-  let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
-        .getService(Ci.nsIScriptSecurityManager);
+  let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(
+    Ci.nsIScriptSecurityManager
+  );
 
   let fileprefix = "file:///";
   if (Services.appinfo.OS == "WINNT") {
     // Windows rejects files if they don't have a drive. See Bug 1180870
     fileprefix += "c:/";
   }
 
   // Add some permissions
@@ -72,77 +94,169 @@ function run_test() {
     matches_weak(perm, [uri1, uri4]);
     matches_never(perm, [uri3, uri5, uri6, uri7, fileuri1, fileuri2, fileuri3]);
   }
 
   {
     let perm = mk_permission(uri1);
     matches_always(perm, [uri1]);
     matches_weak(perm, [uri4]);
-    matches_never(perm, [uri0, uri2, uri3, uri5, uri6, uri7, fileuri1, fileuri2, fileuri3]);
+    matches_never(perm, [
+      uri0,
+      uri2,
+      uri3,
+      uri5,
+      uri6,
+      uri7,
+      fileuri1,
+      fileuri2,
+      fileuri3,
+    ]);
   }
 
   {
     let perm = mk_permission(uri2);
     matches_always(perm, [uri0, uri2]);
     matches_weak(perm, [uri1, uri4]);
     matches_never(perm, [uri3, uri5, uri6, uri7, fileuri1, fileuri2, fileuri3]);
   }
 
   {
     let perm = mk_permission(uri3);
     matches_always(perm, [uri3]);
     matches_weak(perm, []);
-    matches_never(perm, [uri1, uri2, uri4, uri5, uri6, uri7, fileuri1, fileuri2, fileuri3]);
+    matches_never(perm, [
+      uri1,
+      uri2,
+      uri4,
+      uri5,
+      uri6,
+      uri7,
+      fileuri1,
+      fileuri2,
+      fileuri3,
+    ]);
   }
 
   {
     let perm = mk_permission(uri4);
     matches_always(perm, [uri4]);
     matches_weak(perm, []);
-    matches_never(perm, [uri1, uri2, uri3, uri5, uri6, uri7, fileuri1, fileuri2, fileuri3]);
+    matches_never(perm, [
+      uri1,
+      uri2,
+      uri3,
+      uri5,
+      uri6,
+      uri7,
+      fileuri1,
+      fileuri2,
+      fileuri3,
+    ]);
   }
 
   {
     let perm = mk_permission(uri5);
     matches_always(perm, [uri5, uri7]);
     matches_weak(perm, [uri6]);
-    matches_never(perm, [uri0, uri1, uri2, uri3, uri4, fileuri1, fileuri2, fileuri3]);
+    matches_never(perm, [
+      uri0,
+      uri1,
+      uri2,
+      uri3,
+      uri4,
+      fileuri1,
+      fileuri2,
+      fileuri3,
+    ]);
   }
 
   {
     let perm = mk_permission(uri6);
     matches_always(perm, [uri6]);
     matches_weak(perm, []);
-    matches_never(perm, [uri0, uri1, uri2, uri3, uri4, uri5, uri7, fileuri1, fileuri2, fileuri3]);
+    matches_never(perm, [
+      uri0,
+      uri1,
+      uri2,
+      uri3,
+      uri4,
+      uri5,
+      uri7,
+      fileuri1,
+      fileuri2,
+      fileuri3,
+    ]);
   }
 
   {
     let perm = mk_permission(uri7);
     matches_always(perm, [uri5, uri7]);
     matches_weak(perm, [uri6]);
-    matches_never(perm, [uri0, uri1, uri2, uri3, uri4, fileuri1, fileuri2, fileuri3]);
+    matches_never(perm, [
+      uri0,
+      uri1,
+      uri2,
+      uri3,
+      uri4,
+      fileuri1,
+      fileuri2,
+      fileuri3,
+    ]);
   }
 
   {
     let perm = mk_permission(fileuri1);
     matches_always(perm, [fileuri1]);
     matches_weak(perm, []);
-    matches_never(perm, [uri0, uri1, uri2, uri3, uri4, uri5, uri6, uri7, fileuri2, fileuri3]);
+    matches_never(perm, [
+      uri0,
+      uri1,
+      uri2,
+      uri3,
+      uri4,
+      uri5,
+      uri6,
+      uri7,
+      fileuri2,
+      fileuri3,
+    ]);
   }
 
   {
     let perm = mk_permission(fileuri2);
     matches_always(perm, [fileuri2]);
     matches_weak(perm, []);
-    matches_never(perm, [uri0, uri1, uri2, uri3, uri4, uri5, uri6, uri7, fileuri1, fileuri3]);
+    matches_never(perm, [
+      uri0,
+      uri1,
+      uri2,
+      uri3,
+      uri4,
+      uri5,
+      uri6,
+      uri7,
+      fileuri1,
+      fileuri3,
+    ]);
   }
 
   {
     let perm = mk_permission(fileuri3);
     matches_always(perm, [fileuri3]);
     matches_weak(perm, []);
-    matches_never(perm, [uri0, uri1, uri2, uri3, uri4, uri5, uri6, uri7, fileuri1, fileuri2]);
+    matches_never(perm, [
+      uri0,
+      uri1,
+      uri2,
+      uri3,
+      uri4,
+      uri5,
+      uri6,
+      uri7,
+      fileuri1,
+      fileuri2,
+    ]);
   }
 
   // Clean up!
   pm.removeAll();
 }
--- a/extensions/permissions/test/unit/test_permmanager_migrate_4-7.js
+++ b/extensions/permissions/test/unit/test_permmanager_migrate_4-7.js
@@ -1,18 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-ChromeUtils.defineModuleGetter(this, "PlacesTestUtils",
-                               "resource://testing-common/PlacesTestUtils.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "PlacesTestUtils",
+  "resource://testing-common/PlacesTestUtils.jsm"
+);
 
 var PERMISSIONS_FILE_NAME = "permissions.sqlite";
 
-function GetPermissionsFile(profile)
-{
+function GetPermissionsFile(profile) {
   let file = profile.clone();
   file.append(PERMISSIONS_FILE_NAME);
   return file;
 }
 
 add_task(async function test() {
   /* Create and set up the permissions database */
   let profile = do_get_profile();
@@ -29,28 +31,39 @@ add_task(async function test() {
       ",host TEXT" +
       ",type TEXT" +
       ",permission INTEGER" +
       ",expireType INTEGER" +
       ",expireTime INTEGER" +
       ",modificationTime INTEGER" +
       ",appId INTEGER" +
       ",isInBrowserElement INTEGER" +
-    ")");
+      ")"
+  );
 
   let stmtInsert = db.createStatement(
     "INSERT INTO moz_hosts (" +
       "id, host, type, permission, expireType, expireTime, modificationTime, appId, isInBrowserElement" +
-    ") VALUES (" +
+      ") VALUES (" +
       ":id, :host, :type, :permission, :expireType, :expireTime, :modificationTime, :appId, :isInBrowserElement" +
-    ")");
+      ")"
+  );
 
   let id = 0;
 
-  function insertHost(host, type, permission, expireType, expireTime, modificationTime, appId, isInBrowserElement) {
+  function insertHost(
+    host,
+    type,
+    permission,
+    expireType,
+    expireTime,
+    modificationTime,
+    appId,
+    isInBrowserElement
+  ) {
     let thisId = id++;
 
     stmtInsert.bindByName("id", thisId);
     stmtInsert.bindByName("host", host);
     stmtInsert.bindByName("type", type);
     stmtInsert.bindByName("permission", permission);
     stmtInsert.bindByName("expireType", expireType);
     stmtInsert.bindByName("expireTime", expireTime);
@@ -68,17 +81,17 @@ add_task(async function test() {
       id: thisId,
       host,
       type,
       permission,
       expireType,
       expireTime,
       modificationTime,
       appId,
-      isInBrowserElement
+      isInBrowserElement,
     };
   }
 
   // Add some rows to the database
   let created = [
     insertHost("foo.com", "A", 1, 0, 0, 0, 0, false),
     insertHost("foo.com", "C", 1, 0, 0, 0, 0, false),
     insertHost("foo.com", "A", 1, 0, 0, 0, 1000, false),
@@ -88,18 +101,36 @@ add_task(async function test() {
     insertHost("bar.ca", "B", 1, 0, 0, 0, 0, false),
     insertHost("bar.ca", "B", 1, 0, 0, 0, 1000, false),
     insertHost("bar.ca", "A", 1, 0, 0, 0, 1000, true),
     insertHost("localhost", "A", 1, 0, 0, 0, 0, false),
     insertHost("127.0.0.1", "A", 1, 0, 0, 0, 0, false),
     insertHost("192.0.2.235", "A", 1, 0, 0, 0, 0, false),
     insertHost("file:///some/path/to/file.html", "A", 1, 0, 0, 0, 0, false),
     insertHost("file:///another/file.html", "A", 1, 0, 0, 0, 0, false),
-    insertHost("moz-nullprincipal:{8695105a-adbe-4e4e-8083-851faa5ca2d7}", "A", 1, 0, 0, 0, 0, false),
-    insertHost("moz-nullprincipal:{12ahjksd-akjs-asd3-8393-asdu2189asdu}", "B", 1, 0, 0, 0, 0, false),
+    insertHost(
+      "moz-nullprincipal:{8695105a-adbe-4e4e-8083-851faa5ca2d7}",
+      "A",
+      1,
+      0,
+      0,
+      0,
+      0,
+      false
+    ),
+    insertHost(
+      "moz-nullprincipal:{12ahjksd-akjs-asd3-8393-asdu2189asdu}",
+      "B",
+      1,
+      0,
+      0,
+      0,
+      0,
+      false
+    ),
     insertHost("<file>", "A", 1, 0, 0, 0, 0, false),
     insertHost("<file>", "B", 1, 0, 0, 0, 0, false),
   ];
 
   // CLose the db connection
   stmtInsert.finalize();
   db.close();
   stmtInsert = null;
@@ -145,52 +176,71 @@ add_task(async function test() {
     ["http://localhost", "A", 1, 0, 0],
     ["https://localhost", "A", 1, 0, 0],
     ["http://127.0.0.1", "A", 1, 0, 0],
     ["https://127.0.0.1", "A", 1, 0, 0],
     ["http://192.0.2.235", "A", 1, 0, 0],
     ["https://192.0.2.235", "A", 1, 0, 0],
   ];
 
-  let found = expected.map((it) => 0);
+  let found = expected.map(it => 0);
 
   // Add some places to the places database
-  await PlacesTestUtils.addVisits(Services.io.newURI("https://foo.com/some/other/subdirectory"));
-  await PlacesTestUtils.addVisits(Services.io.newURI("ftp://some.subdomain.of.foo.com:8000/some/subdirectory"));
+  await PlacesTestUtils.addVisits(
+    Services.io.newURI("https://foo.com/some/other/subdirectory")
+  );
+  await PlacesTestUtils.addVisits(
+    Services.io.newURI("ftp://some.subdomain.of.foo.com:8000/some/subdirectory")
+  );
 
   // This will force the permission-manager to reload the data.
   Services.obs.notifyObservers(null, "testonly-reload-permissions-from-disk");
 
   // Force initialization of the nsPermissionManager
   for (let permission of Services.perms.enumerator) {
     let isExpected = false;
 
     expected.forEach((it, i) => {
-      if (permission.principal.origin == it[0] &&
-          permission.type == it[1] &&
-          permission.capability == it[2] &&
-          permission.expireType == it[3] &&
-          permission.expireTime == it[4]) {
+      if (
+        permission.principal.origin == it[0] &&
+        permission.type == it[1] &&
+        permission.capability == it[2] &&
+        permission.expireType == it[3] &&
+        permission.expireTime == it[4]
+      ) {
         isExpected = true;
         found[i]++;
       }
     });
 
-    Assert.ok(isExpected,
-              "Permission " + (isExpected ? "should" : "shouldn't") +
-              " be in permission database: " +
-              permission.principal.origin + ", " +
-              permission.type + ", " +
-              permission.capability + ", " +
-              permission.expireType + ", " +
-              permission.expireTime);
+    Assert.ok(
+      isExpected,
+      "Permission " +
+        (isExpected ? "should" : "shouldn't") +
+        " be in permission database: " +
+        permission.principal.origin +
+        ", " +
+        permission.type +
+        ", " +
+        permission.capability +
+        ", " +
+        permission.expireType +
+        ", " +
+        permission.expireTime
+    );
   }
 
   found.forEach((count, i) => {
-    Assert.ok(count == 1, "Expected count = 1, got count = " + count + " for permission " + expected[i]);
+    Assert.ok(
+      count == 1,
+      "Expected count = 1, got count = " +
+        count +
+        " for permission " +
+        expected[i]
+    );
   });
 
   // Check to make sure that all of the tables which we care about are present
   {
     db = Services.storage.openDatabase(GetPermissionsFile(profile));
     Assert.ok(db.tableExists("moz_perms"));
     Assert.ok(db.tableExists("moz_hosts"));
     Assert.ok(!db.tableExists("moz_hosts_is_backup"));
--- a/extensions/permissions/test/unit/test_permmanager_migrate_4-7_no_history.js
+++ b/extensions/permissions/test/unit/test_permmanager_migrate_4-7_no_history.js
@@ -10,50 +10,56 @@ var PERMISSIONS_FILE_NAME = "permissions
 var CONTRACT_ID = "@mozilla.org/browser/nav-history-service;1";
 var factory = {
   createInstance() {
     throw new Error("There is no history service");
   },
   lockFactory() {
     throw Cr.NS_ERROR_NOT_IMPLEMENTED;
   },
-  QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory])
+  QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]),
 };
 
-var newClassID = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator).generateUUID();
+var newClassID = Cc["@mozilla.org/uuid-generator;1"]
+  .getService(Ci.nsIUUIDGenerator)
+  .generateUUID();
 
 var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
 var oldClassID = registrar.contractIDToCID(CONTRACT_ID);
-var oldFactory = Components.manager.getClassObject(Cc[CONTRACT_ID], Ci.nsIFactory);
+var oldFactory = Components.manager.getClassObject(
+  Cc[CONTRACT_ID],
+  Ci.nsIFactory
+);
 registrar.registerFactory(newClassID, "", CONTRACT_ID, factory);
 
 function cleanupFactory() {
   registrar.unregisterFactory(newClassID, factory);
   registrar.registerFactory(oldClassID, "", CONTRACT_ID, null);
 }
 
-function GetPermissionsFile(profile)
-{
+function GetPermissionsFile(profile) {
   let file = profile.clone();
   file.append(PERMISSIONS_FILE_NAME);
   return file;
 }
 
 /*
  * Done nsINavHistoryService code
  */
 
 add_task(function test() {
   /* Create and set up the permissions database */
   let profile = do_get_profile();
   Services.prefs.setCharPref("permissions.manager.defaultsUrl", "");
 
   // Make sure that we can't resolve the nsINavHistoryService
   try {
-    Cc['@mozilla.org/browser/nav-history-service;1'].getService(Ci.nsINavHistoryService);
+    Cc["@mozilla.org/browser/nav-history-service;1"].getService(
+      Ci.nsINavHistoryService
+    );
     Assert.ok(false, "There shouldn't have been a nsINavHistoryService");
   } catch (e) {
     Assert.ok(true, "There wasn't a nsINavHistoryService");
   }
 
   let db = Services.storage.openDatabase(GetPermissionsFile(profile));
   db.schemaVersion = 4;
   db.executeSimpleSQL("DROP TABLE moz_perms");
@@ -65,28 +71,39 @@ add_task(function test() {
       ",host TEXT" +
       ",type TEXT" +
       ",permission INTEGER" +
       ",expireType INTEGER" +
       ",expireTime INTEGER" +
       ",modificationTime INTEGER" +
       ",appId INTEGER" +
       ",isInBrowserElement INTEGER" +
-    ")");
+      ")"
+  );
 
   let stmtInsert = db.createStatement(
     "INSERT INTO moz_hosts (" +
       "id, host, type, permission, expireType, expireTime, modificationTime, appId, isInBrowserElement" +
-    ") VALUES (" +
+      ") VALUES (" +
       ":id, :host, :type, :permission, :expireType, :expireTime, :modificationTime, :appId, :isInBrowserElement" +
-    ")");
+      ")"
+  );
 
   let id = 0;
 
-  function insertHost(host, type, permission, expireType, expireTime, modificationTime, appId, isInBrowserElement) {
+  function insertHost(
+    host,
+    type,
+    permission,
+    expireType,
+    expireTime,
+    modificationTime,
+    appId,
+    isInBrowserElement
+  ) {
     let thisId = id++;
 
     stmtInsert.bindByName("id", thisId);
     stmtInsert.bindByName("host", host);
     stmtInsert.bindByName("type", type);
     stmtInsert.bindByName("permission", permission);
     stmtInsert.bindByName("expireType", expireType);
     stmtInsert.bindByName("expireTime", expireTime);
@@ -104,17 +121,17 @@ add_task(function test() {
       id: thisId,
       host,
       type,
       permission,
       expireType,
       expireTime,
       modificationTime,
       appId,
-      isInBrowserElement
+      isInBrowserElement,
     };
   }
 
   // Add some rows to the database
   let created = [
     insertHost("foo.com", "A", 1, 0, 0, 0, 0, false),
     insertHost("foo.com", "C", 1, 0, 0, 0, 0, false),
     insertHost("foo.com", "A", 1, 0, 0, 0, 1000, false),
@@ -124,18 +141,36 @@ add_task(function test() {
     insertHost("bar.ca", "B", 1, 0, 0, 0, 0, false),
     insertHost("bar.ca", "B", 1, 0, 0, 0, 1000, false),
     insertHost("bar.ca", "A", 1, 0, 0, 0, 1000, true),
     insertHost("localhost", "A", 1, 0, 0, 0, 0, false),
     insertHost("127.0.0.1", "A", 1, 0, 0, 0, 0, false),
     insertHost("263.123.555.676", "A", 1, 0, 0, 0, 0, false),
     insertHost("file:///some/path/to/file.html", "A", 1, 0, 0, 0, 0, false),
     insertHost("file:///another/file.html", "A", 1, 0, 0, 0, 0, false),
-    insertHost("moz-nullprincipal:{8695105a-adbe-4e4e-8083-851faa5ca2d7}", "A", 1, 0, 0, 0, 0, false),
-    insertHost("moz-nullprincipal:{12ahjksd-akjs-asd3-8393-asdu2189asdu}", "B", 1, 0, 0, 0, 0, false),
+    insertHost(
+      "moz-nullprincipal:{8695105a-adbe-4e4e-8083-851faa5ca2d7}",
+      "A",
+      1,
+      0,
+      0,
+      0,
+      0,
+      false
+    ),
+    insertHost(
+      "moz-nullprincipal:{12ahjksd-akjs-asd3-8393-asdu2189asdu}",
+      "B",
+      1,
+      0,
+      0,
+      0,
+      0,
+      false
+    ),
     insertHost("<file>", "A", 1, 0, 0, 0, 0, false),
     insertHost("<file>", "B", 1, 0, 0, 0, 0, false),
   ];
 
   // CLose the db connection
   stmtInsert.finalize();
   db.close();
   stmtInsert = null;
@@ -166,48 +201,63 @@ add_task(function test() {
     ["http://localhost", "A", 1, 0, 0],
     ["https://localhost", "A", 1, 0, 0],
     ["http://127.0.0.1", "A", 1, 0, 0],
     ["https://127.0.0.1", "A", 1, 0, 0],
     ["http://263.123.555.676", "A", 1, 0, 0],
     ["https://263.123.555.676", "A", 1, 0, 0],
   ];
 
-  let found = expected.map((it) => 0);
+  let found = expected.map(it => 0);
 
   // This will force the permission-manager to reload the data.
   Services.obs.notifyObservers(null, "testonly-reload-permissions-from-disk");
 
   // Force initialization of the nsPermissionManager
   for (let permission of Services.perms.enumerator) {
     let isExpected = false;
 
     expected.forEach((it, i) => {
-      if (permission.principal.origin == it[0] &&
-          permission.type == it[1] &&
-          permission.capability == it[2] &&
-          permission.expireType == it[3] &&
-          permission.expireTime == it[4]) {
+      if (
+        permission.principal.origin == it[0] &&
+        permission.type == it[1] &&
+        permission.capability == it[2] &&
+        permission.expireType == it[3] &&
+        permission.expireTime == it[4]
+      ) {
         isExpected = true;
         found[i]++;
       }
     });
 
-    Assert.ok(isExpected,
-              "Permission " + (isExpected ? "should" : "shouldn't") +
-              " be in permission database: " +
-              permission.principal.origin + ", " +
-              permission.type + ", " +
-              permission.capability + ", " +
-              permission.expireType + ", " +
-              permission.expireTime);
+    Assert.ok(
+      isExpected,
+      "Permission " +
+        (isExpected ? "should" : "shouldn't") +
+        " be in permission database: " +
+        permission.principal.origin +
+        ", " +
+        permission.type +
+        ", " +
+        permission.capability +
+        ", " +
+        permission.expireType +
+        ", " +
+        permission.expireTime
+    );
   }
 
   found.forEach((count, i) => {
-    Assert.ok(count == 1, "Expected count = 1, got count = " + count + " for permission " + expected[i]);
+    Assert.ok(
+      count == 1,
+      "Expected count = 1, got count = " +
+        count +
+        " for permission " +
+        expected[i]
+    );
   });
 
   // Check to make sure that all of the tables which we care about are present
   {
     db = Services.storage.openDatabase(GetPermissionsFile(profile));
     Assert.ok(db.tableExists("moz_perms"));
     Assert.ok(db.tableExists("moz_hosts"));
     Assert.ok(!db.tableExists("moz_hosts_is_backup"));
--- a/extensions/permissions/test/unit/test_permmanager_migrate_5-7a.js
+++ b/extensions/permissions/test/unit/test_permmanager_migrate_5-7a.js
@@ -1,18 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-ChromeUtils.defineModuleGetter(this, "PlacesTestUtils",
-                               "resource://testing-common/PlacesTestUtils.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "PlacesTestUtils",
+  "resource://testing-common/PlacesTestUtils.jsm"
+);
 
 var PERMISSIONS_FILE_NAME = "permissions.sqlite";
 
-function GetPermissionsFile(profile)
-{
+function GetPermissionsFile(profile) {
   let file = profile.clone();
   file.append(PERMISSIONS_FILE_NAME);
   return file;
 }
 
 add_task(async function test() {
   /* Create and set up the permissions database */
   let profile = do_get_profile();
@@ -30,51 +32,62 @@ add_task(async function test() {
     "CREATE TABLE moz_hosts (" +
       " id INTEGER PRIMARY KEY" +
       ",origin TEXT" +
       ",type TEXT" +
       ",permission INTEGER" +
       ",expireType INTEGER" +
       ",expireTime INTEGER" +
       ",modificationTime INTEGER" +
-    ")");
+      ")"
+  );
 
   let stmt5Insert = db.createStatement(
     "INSERT INTO moz_hosts (" +
       "id, origin, type, permission, expireType, expireTime, modificationTime" +
-    ") VALUES (" +
+      ") VALUES (" +
       ":id, :origin, :type, :permission, :expireType, :expireTime, :modificationTime" +
-    ")");
+      ")"
+  );
 
   /*
    * V4 table
    */
   db.executeSimpleSQL(
     "CREATE TABLE moz_hosts_v4 (" +
       " id INTEGER PRIMARY KEY" +
       ",host TEXT" +
       ",type TEXT" +
       ",permission INTEGER" +
       ",expireType INTEGER" +
       ",expireTime INTEGER" +
       ",modificationTime INTEGER" +
       ",appId INTEGER" +
       ",isInBrowserElement INTEGER" +
-    ")");
+      ")"
+  );
 
   let stmtInsert = db.createStatement(
     "INSERT INTO moz_hosts_v4 (" +
       "id, host, type, permission, expireType, expireTime, modificationTime, appId, isInBrowserElement" +
-    ") VALUES (" +
+      ") VALUES (" +
       ":id, :host, :type, :permission, :expireType, :expireTime, :modificationTime, :appId, :isInBrowserElement" +
-    ")");
+      ")"
+  );
 
   let id = 0;
 
-  function insertOrigin(origin, type, permission, expireType, expireTime, modificationTime) {
+  function insertOrigin(
+    origin,
+    type,
+    permission,
+    expireType,
+    expireTime,
+    modificationTime
+  ) {
     let thisId = id++;
 
     stmt5Insert.bindByName("id", thisId);
     stmt5Insert.bindByName("origin", origin);
     stmt5Insert.bindByName("type", type);
     stmt5Insert.bindByName("permission", permission);
     stmt5Insert.bindByName("expireType", expireType);
     stmt5Insert.bindByName("expireTime", expireTime);
@@ -88,21 +101,30 @@ add_task(async function test() {
 
     return {
       id: thisId,
       origin,
       type,
       permission,
       expireType,
       expireTime,
-      modificationTime
+      modificationTime,
     };
   }
 
-  function insertHost(host, type, permission, expireType, expireTime, modificationTime, appId, isInBrowserElement) {
+  function insertHost(
+    host,
+    type,
+    permission,
+    expireType,
+    expireTime,
+    modificationTime,
+    appId,
+    isInBrowserElement
+  ) {
     let thisId = id++;
 
     stmtInsert.bindByName("id", thisId);
     stmtInsert.bindByName("host", host);
     stmtInsert.bindByName("type", type);
     stmtInsert.bindByName("permission", permission);
     stmtInsert.bindByName("expireType", expireType);
     stmtInsert.bindByName("expireTime", expireTime);
@@ -120,17 +142,17 @@ add_task(async function test() {
       id: thisId,
       host,
       type,
       permission,
       expireType,
       expireTime,
       modificationTime,
       appId,
-      isInBrowserElement
+      isInBrowserElement,
     };
   }
 
   let created5 = [
     insertOrigin("https://foo.com", "A", 2, 0, 0, 0),
     insertOrigin("http://foo.com", "A", 2, 0, 0, 0),
     insertOrigin("http://foo.com^inBrowser=1", "A", 2, 0, 0, 0),
   ];
@@ -146,18 +168,36 @@ add_task(async function test() {
     insertHost("bar.ca", "B", 1, 0, 0, 0, 0, false),
     insertHost("bar.ca", "B", 1, 0, 0, 0, 1000, false),
     insertHost("bar.ca", "A", 1, 0, 0, 0, 1000, true),
     insertHost("localhost", "A", 1, 0, 0, 0, 0, false),
     insertHost("127.0.0.1", "A", 1, 0, 0, 0, 0, false),
     insertHost("192.0.2.235", "A", 1, 0, 0, 0, 0, false),
     insertHost("file:///some/path/to/file.html", "A", 1, 0, 0, 0, 0, false),
     insertHost("file:///another/file.html", "A", 1, 0, 0, 0, 0, false),
-    insertHost("moz-nullprincipal:{8695105a-adbe-4e4e-8083-851faa5ca2d7}", "A", 1, 0, 0, 0, 0, false),
-    insertHost("moz-nullprincipal:{12ahjksd-akjs-asd3-8393-asdu2189asdu}", "B", 1, 0, 0, 0, 0, false),
+    insertHost(
+      "moz-nullprincipal:{8695105a-adbe-4e4e-8083-851faa5ca2d7}",
+      "A",
+      1,
+      0,
+      0,
+      0,
+      0,
+      false
+    ),
+    insertHost(
+      "moz-nullprincipal:{12ahjksd-akjs-asd3-8393-asdu2189asdu}",
+      "B",
+      1,
+      0,
+      0,
+      0,
+      0,
+      false
+    ),
     insertHost("<file>", "A", 1, 0, 0, 0, 0, false),
     insertHost("<file>", "B", 1, 0, 0, 0, 0, false),
   ];
 
   // CLose the db connection
   stmt5Insert.finalize();
   stmtInsert.finalize();
   db.close();
@@ -204,52 +244,71 @@ add_task(async function test() {
     ["http://localhost", "A", 1, 0, 0],
     ["https://localhost", "A", 1, 0, 0],
     ["http://127.0.0.1", "A", 1, 0, 0],
     ["https://127.0.0.1", "A", 1, 0, 0],
     ["http://192.0.2.235", "A", 1, 0, 0],
     ["https://192.0.2.235", "A", 1, 0, 0],
   ];
 
-  let found = expected.map((it) => 0);
+  let found = expected.map(it => 0);
 
   // Add some places to the places database
-  await PlacesTestUtils.addVisits(Services.io.newURI("https://foo.com/some/other/subdirectory"));
-  await PlacesTestUtils.addVisits(Services.io.newURI("ftp://some.subdomain.of.foo.com:8000/some/subdirectory"));
+  await PlacesTestUtils.addVisits(
+    Services.io.newURI("https://foo.com/some/other/subdirectory")
+  );
+  await PlacesTestUtils.addVisits(
+    Services.io.newURI("ftp://some.subdomain.of.foo.com:8000/some/subdirectory")
+  );
 
   // This will force the permission-manager to reload the data.
   Services.obs.notifyObservers(null, "testonly-reload-permissions-from-disk");
 
   // Force initialization of the nsPermissionManager
   for (let permission of Services.perms.enumerator) {
     let isExpected = false;
 
     expected.forEach((it, i) => {
-      if (permission.principal.origin == it[0] &&
-          permission.type == it[1] &&
-          permission.capability == it[2] &&
-          permission.expireType == it[3] &&
-          permission.expireTime == it[4]) {
+      if (
+        permission.principal.origin == it[0] &&
+        permission.type == it[1] &&
+        permission.capability == it[2] &&
+        permission.expireType == it[3] &&
+        permission.expireTime == it[4]
+      ) {
         isExpected = true;
         found[i]++;
       }
     });
 
-    Assert.ok(isExpected,
-              "Permission " + (isExpected ? "should" : "shouldn't") +
-              " be in permission database: " +
-              permission.principal.origin + ", " +
-              permission.type + ", " +
-              permission.capability + ", " +
-              permission.expireType + ", " +
-              permission.expireTime);
+    Assert.ok(
+      isExpected,
+      "Permission " +
+        (isExpected ? "should" : "shouldn't") +
+        " be in permission database: " +
+        permission.principal.origin +
+        ", " +
+        permission.type +
+        ", " +
+        permission.capability +
+        ", " +
+        permission.expireType +
+        ", " +
+        permission.expireTime
+    );
   }
 
   found.forEach((count, i) => {
-    Assert.ok(count == 1, "Expected count = 1, got count = " + count + " for permission " + expected[i]);
+    Assert.ok(
+      count == 1,
+      "Expected count = 1, got count = " +
+        count +
+        " for permission " +
+        expected[i]
+    );
   });
 
   // Check to make sure that all of the tables which we care about are present
   {
     db = Services.storage.openDatabase(GetPermissionsFile(profile));
     Assert.ok(db.tableExists("moz_perms"));
     Assert.ok(db.tableExists("moz_hosts"));
     Assert.ok(!db.tableExists("moz_hosts_is_backup"));
@@ -260,38 +319,42 @@ add_task(async function test() {
     try {
       mozHostsCount.executeStep();
       Assert.equal(mozHostsCount.getInt64(0), 0);
     } finally {
       mozHostsCount.finalize();
     }
 
     // Check that the moz_perms_v6 table contains the backup of the entry we created
-    let mozPermsV6Stmt = db.createStatement("SELECT " +
-                                            "origin, type, permission, expireType, expireTime, modificationTime " +
-                                            "FROM moz_perms_v6 WHERE id = :id");
+    let mozPermsV6Stmt = db.createStatement(
+      "SELECT " +
+        "origin, type, permission, expireType, expireTime, modificationTime " +
+        "FROM moz_perms_v6 WHERE id = :id"
+    );
     try {
       // Check that the moz_hosts table still contains the correct values.
-      created5.forEach((it) => {
+      created5.forEach(it => {
         mozPermsV6Stmt.reset();
         mozPermsV6Stmt.bindByName("id", it.id);
         mozPermsV6Stmt.executeStep();
         Assert.equal(mozPermsV6Stmt.getUTF8String(0), it.origin);
         Assert.equal(mozPermsV6Stmt.getUTF8String(1), it.type);
         Assert.equal(mozPermsV6Stmt.getInt64(2), it.permission);
         Assert.equal(mozPermsV6Stmt.getInt64(3), it.expireType);
         Assert.equal(mozPermsV6Stmt.getInt64(4), it.expireTime);
         Assert.equal(mozPermsV6Stmt.getInt64(5), it.modificationTime);
       });
     } finally {
       mozPermsV6Stmt.finalize();
     }
 
     // Check that there are the right number of values
-    let mozPermsV6Count = db.createStatement("SELECT count(*) FROM moz_perms_v6");
+    let mozPermsV6Count = db.createStatement(
+      "SELECT count(*) FROM moz_perms_v6"
+    );
     try {
       mozPermsV6Count.executeStep();
       Assert.equal(mozPermsV6Count.getInt64(0), created5.length);
     } finally {
       mozPermsV6Count.finalize();
     }
 
     db.close();
--- a/extensions/permissions/test/unit/test_permmanager_migrate_5-7b.js
+++ b/extensions/permissions/test/unit/test_permmanager_migrate_5-7b.js
@@ -1,18 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-ChromeUtils.defineModuleGetter(this, "PlacesTestUtils",
-                               "resource://testing-common/PlacesTestUtils.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "PlacesTestUtils",
+  "resource://testing-common/PlacesTestUtils.jsm"
+);
 
 var PERMISSIONS_FILE_NAME = "permissions.sqlite";
 
-function GetPermissionsFile(profile)
-{
+function GetPermissionsFile(profile) {
   let file = profile.clone();
   file.append(PERMISSIONS_FILE_NAME);
   return file;
 }
 
 add_task(function test() {
   /* Create and set up the permissions database */
   let profile = do_get_profile();
@@ -30,28 +32,37 @@ add_task(function test() {
     "CREATE TABLE moz_hosts (" +
       " id INTEGER PRIMARY KEY" +
       ",origin TEXT" +
       ",type TEXT" +
       ",permission INTEGER" +
       ",expireType INTEGER" +
       ",expireTime INTEGER" +
       ",modificationTime INTEGER" +
-    ")");
+      ")"
+  );
 
   let stmt5Insert = db.createStatement(
     "INSERT INTO moz_hosts (" +
       "id, origin, type, permission, expireType, expireTime, modificationTime" +
-    ") VALUES (" +
+      ") VALUES (" +
       ":id, :origin, :type, :permission, :expireType, :expireTime, :modificationTime" +
-    ")");
+      ")"
+  );
 
   let id = 0;
 
-  function insertOrigin(origin, type, permission, expireType, expireTime, modificationTime) {
+  function insertOrigin(
+    origin,
+    type,
+    permission,
+    expireType,
+    expireTime,
+    modificationTime
+  ) {
     let thisId = id++;
 
     stmt5Insert.bindByName("id", thisId);
     stmt5Insert.bindByName("origin", origin);
     stmt5Insert.bindByName("type", type);
     stmt5Insert.bindByName("permission", permission);
     stmt5Insert.bindByName("expireType", expireType);
     stmt5Insert.bindByName("expireTime", expireTime);
@@ -65,17 +76,17 @@ add_task(function test() {
 
     return {
       id: thisId,
       host: origin,
       type,
       permission,
       expireType,
       expireTime,
-      modificationTime
+      modificationTime,
     };
   }
 
   let created5 = [
     insertOrigin("https://foo.com", "A", 2, 0, 0, 0),
     insertOrigin("http://foo.com", "A", 2, 0, 0, 0),
     insertOrigin("http://foo.com^appId=1000&inBrowser=1", "A", 2, 0, 0, 0),
 
@@ -95,65 +106,82 @@ add_task(function test() {
     ["https://foo.com", "A", 2, 0, 0, 0],
     ["http://foo.com", "A", 2, 0, 0, 0],
     ["http://foo.com^inBrowser=1", "A", 2, 0, 0, 0],
 
     ["http://127.0.0.1", "B", 2, 0, 0, 0],
     ["http://localhost", "B", 2, 0, 0, 0],
   ];
 
-  let found = expected.map((it) => 0);
+  let found = expected.map(it => 0);
 
   // This will force the permission-manager to reload the data.
   Services.obs.notifyObservers(null, "testonly-reload-permissions-from-disk");
 
   // Force initialization of the nsPermissionManager
   for (let permission of Services.perms.enumerator) {
     let isExpected = false;
 
     expected.forEach((it, i) => {
-      if (permission.principal.origin == it[0] &&
-          permission.type == it[1] &&
-          permission.capability == it[2] &&
-          permission.expireType == it[3] &&
-          permission.expireTime == it[4]) {
+      if (
+        permission.principal.origin == it[0] &&
+        permission.type == it[1] &&
+        permission.capability == it[2] &&
+        permission.expireType == it[3] &&
+        permission.expireTime == it[4]
+      ) {
         isExpected = true;
         found[i]++;
       }
     });
 
-    Assert.ok(isExpected,
-              "Permission " + (isExpected ? "should" : "shouldn't") +
-              " be in permission database: " +
-              permission.principal.origin + ", " +
-              permission.type + ", " +
-              permission.capability + ", " +
-              permission.expireType + ", " +
-              permission.expireTime);
+    Assert.ok(
+      isExpected,
+      "Permission " +
+        (isExpected ? "should" : "shouldn't") +
+        " be in permission database: " +
+        permission.principal.origin +
+        ", " +
+        permission.type +
+        ", " +
+        permission.capability +
+        ", " +
+        permission.expireType +
+        ", " +
+        permission.expireTime
+    );
   }
 
   found.forEach((count, i) => {
-    Assert.ok(count == 1, "Expected count = 1, got count = " + count + " for permission " + expected[i]);
+    Assert.ok(
+      count == 1,
+      "Expected count = 1, got count = " +
+        count +
+        " for permission " +
+        expected[i]
+    );
   });
 
   // Check to make sure that all of the tables which we care about are present
   {
     db = Services.storage.openDatabase(GetPermissionsFile(profile));
     Assert.ok(db.tableExists("moz_perms"));
     Assert.ok(db.tableExists("moz_hosts"));
     Assert.ok(!db.tableExists("moz_hosts_is_backup"));
     Assert.ok(!db.tableExists("moz_perms_v6"));
 
-    let mozHostsStmt = db.createStatement("SELECT " +
-                                          "host, type, permission, expireType, expireTime, " +
-                                          "modificationTime, isInBrowserElement " +
-                                          "FROM moz_hosts WHERE id = :id");
+    let mozHostsStmt = db.createStatement(
+      "SELECT " +
+        "host, type, permission, expireType, expireTime, " +
+        "modificationTime, isInBrowserElement " +
+        "FROM moz_hosts WHERE id = :id"
+    );
     try {
       // Check that the moz_hosts table still contains the correct values.
-      created4.forEach((it) => {
+      created4.forEach(it => {
         mozHostsStmt.reset();
         mozHostsStmt.bindByName("id", it.id);
         mozHostsStmt.executeStep();
         Assert.equal(mozHostsStmt.getUTF8String(0), it.host);
         Assert.equal(mozHostsStmt.getUTF8String(1), it.type);
         Assert.equal(mozHostsStmt.getInt64(2), it.permission);
         Assert.equal(mozHostsStmt.getInt64(3), it.expireType);
         Assert.equal(mozHostsStmt.getInt64(4), it.expireTime);
--- a/extensions/permissions/test/unit/test_permmanager_migrate_6-7a.js
+++ b/extensions/permissions/test/unit/test_permmanager_migrate_6-7a.js
@@ -1,18 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-ChromeUtils.defineModuleGetter(this, "PlacesTestUtils",
-                               "resource://testing-common/PlacesTestUtils.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "PlacesTestUtils",
+  "resource://testing-common/PlacesTestUtils.jsm"
+);
 
 var PERMISSIONS_FILE_NAME = "permissions.sqlite";
 
-function GetPermissionsFile(profile)
-{
+function GetPermissionsFile(profile) {
   let file = profile.clone();
   file.append(PERMISSIONS_FILE_NAME);
   return file;
 }
 
 add_task(async function test() {
   /* Create and set up the permissions database */
   let profile = do_get_profile();
@@ -30,51 +32,62 @@ add_task(async function test() {
     "CREATE TABLE moz_perms (" +
       " id INTEGER PRIMARY KEY" +
       ",origin TEXT" +
       ",type TEXT" +
       ",permission INTEGER" +
       ",expireType INTEGER" +
       ",expireTime INTEGER" +
       ",modificationTime INTEGER" +
-    ")");
+      ")"
+  );
 
   let stmt6Insert = db.createStatement(
     "INSERT INTO moz_perms (" +
       "id, origin, type, permission, expireType, expireTime, modificationTime" +
-    ") VALUES (" +
+      ") VALUES (" +
       ":id, :origin, :type, :permission, :expireType, :expireTime, :modificationTime" +
-    ")");
+      ")"
+  );
 
   /*
    * V4 table
    */
   db.executeSimpleSQL(
     "CREATE TABLE moz_hosts (" +
       " id INTEGER PRIMARY KEY" +
       ",host TEXT" +
       ",type TEXT" +
       ",permission INTEGER" +
       ",expireType INTEGER" +
       ",expireTime INTEGER" +
       ",modificationTime INTEGER" +
       ",appId INTEGER" +
       ",isInBrowserElement INTEGER" +
-    ")");
+      ")"
+  );
 
   let stmtInsert = db.createStatement(
     "INSERT INTO moz_hosts (" +
       "id, host, type, permission, expireType, expireTime, modificationTime, appId, isInBrowserElement" +
-    ") VALUES (" +
+      ") VALUES (" +
       ":id, :host, :type, :permission, :expireType, :expireTime, :modificationTime, :appId, :isInBrowserElement" +
-    ")");
+      ")"
+  );
 
   let id = 0;
 
-  function insertOrigin(origin, type, permission, expireType, expireTime, modificationTime) {
+  function insertOrigin(
+    origin,
+    type,
+    permission,
+    expireType,
+    expireTime,
+    modificationTime
+  ) {
     let thisId = id++;
 
     stmt6Insert.bindByName("id", thisId);
     stmt6Insert.bindByName("origin", origin);
     stmt6Insert.bindByName("type", type);
     stmt6Insert.bindByName("permission", permission);
     stmt6Insert.bindByName("expireType", expireType);
     stmt6Insert.bindByName("expireTime", expireTime);
@@ -88,21 +101,30 @@ add_task(async function test() {
 
     return {
       id: thisId,
       origin,
       type,
       permission,
       expireType,
       expireTime,
-      modificationTime
+      modificationTime,
     };
   }
 
-  function insertHost(host, type, permission, expireType, expireTime, modificationTime, appId, isInBrowserElement) {
+  function insertHost(
+    host,
+    type,
+    permission,
+    expireType,
+    expireTime,
+    modificationTime,
+    appId,
+    isInBrowserElement
+  ) {
     let thisId = id++;
 
     stmtInsert.bindByName("id", thisId);
     stmtInsert.bindByName("host", host);
     stmtInsert.bindByName("type", type);
     stmtInsert.bindByName("permission", permission);
     stmtInsert.bindByName("expireType", expireType);
     stmtInsert.bindByName("expireTime", expireTime);
@@ -120,17 +142,17 @@ add_task(async function test() {
       id: thisId,
       host,
       type,
       permission,
       expireType,
       expireTime,
       modificationTime,
       appId,
-      isInBrowserElement
+      isInBrowserElement,
     };
   }
 
   let created6 = [
     insertOrigin("https://foo.com", "A", 2, 0, 0, 0),
     insertOrigin("http://foo.com", "A", 2, 0, 0, 0),
     insertOrigin("http://foo.com^inBrowser=1", "A", 2, 0, 0, 0),
   ];
@@ -146,18 +168,36 @@ add_task(async function test() {
     insertHost("bar.ca", "B", 1, 0, 0, 0, 0, false),
     insertHost("bar.ca", "B", 1, 0, 0, 0, 1000, false),
     insertHost("bar.ca", "A", 1, 0, 0, 0, 1000, true),
     insertHost("localhost", "A", 1, 0, 0, 0, 0, false),
     insertHost("127.0.0.1", "A", 1, 0, 0, 0, 0, false),
     insertHost("192.0.2.235", "A", 1, 0, 0, 0, 0, false),
     insertHost("file:///some/path/to/file.html", "A", 1, 0, 0, 0, 0, false),
     insertHost("file:///another/file.html", "A", 1, 0, 0, 0, 0, false),
-    insertHost("moz-nullprincipal:{8695105a-adbe-4e4e-8083-851faa5ca2d7}", "A", 1, 0, 0, 0, 0, false),
-    insertHost("moz-nullprincipal:{12ahjksd-akjs-asd3-8393-asdu2189asdu}", "B", 1, 0, 0, 0, 0, false),
+    insertHost(
+      "moz-nullprincipal:{8695105a-adbe-4e4e-8083-851faa5ca2d7}",
+      "A",
+      1,
+      0,
+      0,
+      0,
+      0,
+      false
+    ),
+    insertHost(
+      "moz-nullprincipal:{12ahjksd-akjs-asd3-8393-asdu2189asdu}",
+      "B",
+      1,
+      0,
+      0,
+      0,
+      0,
+      false
+    ),
     insertHost("<file>", "A", 1, 0, 0, 0, 0, false),
     insertHost("<file>", "B", 1, 0, 0, 0, 0, false),
   ];
 
   // CLose the db connection
   stmt6Insert.finalize();
   stmtInsert.finalize();
   db.close();
@@ -204,52 +244,71 @@ add_task(async function test() {
     ["http://localhost", "A", 1, 0, 0],
     ["https://localhost", "A", 1, 0, 0],
     ["http://127.0.0.1", "A", 1, 0, 0],
     ["https://127.0.0.1", "A", 1, 0, 0],
     ["http://192.0.2.235", "A", 1, 0, 0],
     ["https://192.0.2.235", "A", 1, 0, 0],
   ];
 
-  let found = expected.map((it) => 0);
+  let found = expected.map(it => 0);
 
   // Add some places to the places database
-  await PlacesTestUtils.addVisits(Services.io.newURI("https://foo.com/some/other/subdirectory"));
-  await PlacesTestUtils.addVisits(Services.io.newURI("ftp://some.subdomain.of.foo.com:8000/some/subdirectory"));
+  await PlacesTestUtils.addVisits(
+    Services.io.newURI("https://foo.com/some/other/subdirectory")
+  );
+  await PlacesTestUtils.addVisits(
+    Services.io.newURI("ftp://some.subdomain.of.foo.com:8000/some/subdirectory")
+  );
 
   // This will force the permission-manager to reload the data.
   Services.obs.notifyObservers(null, "testonly-reload-permissions-from-disk");
 
   // Force initialization of the nsPermissionManager
   for (let permission of Services.perms.enumerator) {
     let isExpected = false;
 
     expected.forEach((it, i) => {
-      if (permission.principal.origin == it[0] &&
-          permission.type == it[1] &&
-          permission.capability == it[2] &&
-          permission.expireType == it[3] &&
-          permission.expireTime == it[4]) {
+      if (
+        permission.principal.origin == it[0] &&
+        permission.type == it[1] &&
+        permission.capability == it[2] &&
+        permission.expireType == it[3] &&
+        permission.expireTime == it[4]
+      ) {
         isExpected = true;
         found[i]++;
       }
     });
 
-    Assert.ok(isExpected,
-              "Permission " + (isExpected ? "should" : "shouldn't") +
-              " be in permission database: " +
-              permission.principal.origin + ", " +
-              permission.type + ", " +
-              permission.capability + ", " +
-              permission.expireType + ", " +
-              permission.expireTime);
+    Assert.ok(
+      isExpected,
+      "Permission " +
+        (isExpected ? "should" : "shouldn't") +
+        " be in permission database: " +
+        permission.principal.origin +
+        ", " +
+        permission.type +
+        ", " +
+        permission.capability +
+        ", " +
+        permission.expireType +
+        ", " +
+        permission.expireTime
+    );
   }
 
   found.forEach((count, i) => {
-    Assert.ok(count == 1, "Expected count = 1, got count = " + count + " for permission " + expected[i]);
+    Assert.ok(
+      count == 1,
+      "Expected count = 1, got count = " +
+        count +
+        " for permission " +
+        expected[i]
+    );
   });
 
   // Check to make sure that all of the tables which we care about are present
   {
     db = Services.storage.openDatabase(GetPermissionsFile(profile));
     Assert.ok(db.tableExists("moz_perms"));
     Assert.ok(db.tableExists("moz_hosts"));
     Assert.ok(!db.tableExists("moz_hosts_is_backup"));
@@ -260,38 +319,42 @@ add_task(async function test() {
     try {
       mozHostsCount.executeStep();
       Assert.equal(mozHostsCount.getInt64(0), 0);
     } finally {
       mozHostsCount.finalize();
     }
 
     // Check that the moz_perms_v6 table contains the backup of the entry we created
-    let mozPermsV6Stmt = db.createStatement("SELECT " +
-                                            "origin, type, permission, expireType, expireTime, modificationTime " +
-                                            "FROM moz_perms_v6 WHERE id = :id");
+    let mozPermsV6Stmt = db.createStatement(
+      "SELECT " +
+        "origin, type, permission, expireType, expireTime, modificationTime " +
+        "FROM moz_perms_v6 WHERE id = :id"
+    );
     try {
       // Check that the moz_hosts table still contains the correct values.
-      created6.forEach((it) => {
+      created6.forEach(it => {
         mozPermsV6Stmt.reset();
         mozPermsV6Stmt.bindByName("id", it.id);
         mozPermsV6Stmt.executeStep();
         Assert.equal(mozPermsV6Stmt.getUTF8String(0), it.origin);
         Assert.equal(mozPermsV6Stmt.getUTF8String(1), it.type);
         Assert.equal(mozPermsV6Stmt.getInt64(2), it.permission);
         Assert.equal(mozPermsV6Stmt.getInt64(3), it.expireType);
         Assert.equal(mozPermsV6Stmt.getInt64(4), it.expireTime);
         Assert.equal(mozPermsV6Stmt.getInt64(5), it.modificationTime);
       });
     } finally {
       mozPermsV6Stmt.finalize();
     }
 
     // Check that there are the right number of values
-    let mozPermsV6Count = db.createStatement("SELECT count(*) FROM moz_perms_v6");
+    let mozPermsV6Count = db.createStatement(
+      "SELECT count(*) FROM moz_perms_v6"
+    );
     try {
       mozPermsV6Count.executeStep();
       Assert.equal(mozPermsV6Count.getInt64(0), created6.length);
     } finally {
       mozPermsV6Count.finalize();
     }
 
     db.close();
--- a/extensions/permissions/test/unit/test_permmanager_migrate_6-7b.js
+++ b/extensions/permissions/test/unit/test_permmanager_migrate_6-7b.js
@@ -1,18 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-ChromeUtils.defineModuleGetter(this, "PlacesTestUtils",
-                               "resource://testing-common/PlacesTestUtils.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "PlacesTestUtils",
+  "resource://testing-common/PlacesTestUtils.jsm"
+);
 
 var PERMISSIONS_FILE_NAME = "permissions.sqlite";
 
-function GetPermissionsFile(profile)
-{
+function GetPermissionsFile(profile) {
   let file = profile.clone();
   file.append(PERMISSIONS_FILE_NAME);
   return file;
 }
 
 add_task(function test() {
   /* Create and set up the permissions database */
   let profile = do_get_profile();
@@ -30,28 +32,37 @@ add_task(function test() {
     "CREATE TABLE moz_perms (" +
       " id INTEGER PRIMARY KEY" +
       ",origin TEXT" +
       ",type TEXT" +
       ",permission INTEGER" +
       ",expireType INTEGER" +
       ",expireTime INTEGER" +
       ",modificationTime INTEGER" +
-    ")");
+      ")"
+  );
 
   let stmt6Insert = db.createStatement(
     "INSERT INTO moz_perms (" +
       "id, origin, type, permission, expireType, expireTime, modificationTime" +
-    ") VALUES (" +
+      ") VALUES (" +
       ":id, :origin, :type, :permission, :expireType, :expireTime, :modificationTime" +
-    ")");
+      ")"
+  );
 
   let id = 0;
 
-  function insertOrigin(origin, type, permission, expireType, expireTime, modificationTime) {
+  function insertOrigin(
+    origin,
+    type,
+    permission,
+    expireType,
+    expireTime,
+    modificationTime
+  ) {
     let thisId = id++;
 
     stmt6Insert.bindByName("id", thisId);
     stmt6Insert.bindByName("origin", origin);
     stmt6Insert.bindByName("type", type);
     stmt6Insert.bindByName("permission", permission);
     stmt6Insert.bindByName("expireType", expireType);
     stmt6Insert.bindByName("expireTime", expireTime);
@@ -65,17 +76,17 @@ add_task(function test() {
 
     return {
       id: thisId,
       host: origin,
       type,
       permission,
       expireType,
       expireTime,
-      modificationTime
+      modificationTime,
     };
   }
 
   let created6 = [
     insertOrigin("https://foo.com", "A", 2, 0, 0, 0),
     insertOrigin("http://foo.com", "A", 2, 0, 0, 0),
     insertOrigin("http://foo.com^appId=1000&inBrowser=1", "A", 2, 0, 0, 0),
   ];
@@ -86,68 +97,85 @@ add_task(function test() {
   stmt6Insert.finalize();
   db.close();
   stmt6Insert = null;
   db = null;
 
   let expected = [
     ["https://foo.com", "A", 2, 0, 0, 0],
     ["http://foo.com", "A", 2, 0, 0, 0],
-    ["http://foo.com^inBrowser=1", "A", 2, 0, 0, 0]
+    ["http://foo.com^inBrowser=1", "A", 2, 0, 0, 0],
   ];
 
-  let found = expected.map((it) => 0);
+  let found = expected.map(it => 0);
 
   // This will force the permission-manager to reload the data.
   Services.obs.notifyObservers(null, "testonly-reload-permissions-from-disk");
 
   // Force initialization of the nsPermissionManager
   for (let permission of Services.perms.enumerator) {
     let isExpected = false;
 
     expected.forEach((it, i) => {
-      if (permission.principal.origin == it[0] &&
-          permission.type == it[1] &&
-          permission.capability == it[2] &&
-          permission.expireType == it[3] &&
-          permission.expireTime == it[4]) {
+      if (
+        permission.principal.origin == it[0] &&
+        permission.type == it[1] &&
+        permission.capability == it[2] &&
+        permission.expireType == it[3] &&
+        permission.expireTime == it[4]
+      ) {
         isExpected = true;
         found[i]++;
       }
     });
 
-    Assert.ok(isExpected,
-              "Permission " + (isExpected ? "should" : "shouldn't") +
-              " be in permission database: " +
-              permission.principal.origin + ", " +
-              permission.type + ", " +
-              permission.capability + ", " +
-              permission.expireType + ", " +
-              permission.expireTime);
+    Assert.ok(
+      isExpected,
+      "Permission " +
+        (isExpected ? "should" : "shouldn't") +
+        " be in permission database: " +
+        permission.principal.origin +
+        ", " +
+        permission.type +
+        ", " +
+        permission.capability +
+        ", " +
+        permission.expireType +
+        ", " +
+        permission.expireTime
+    );
   }
 
   found.forEach((count, i) => {
-    Assert.ok(count == 1, "Expected count = 1, got count = " + count + " for permission " + expected[i]);
+    Assert.ok(
+      count == 1,
+      "Expected count = 1, got count = " +
+        count +
+        " for permission " +
+        expected[i]
+    );
   });
 
   // Check to make sure that all of the tables which we care about are present
   {
     db = Services.storage.openDatabase(GetPermissionsFile(profile));
     Assert.ok(db.tableExists("moz_perms"));
     Assert.ok(db.tableExists("moz_hosts"));
     Assert.ok(!db.tableExists("moz_hosts_is_backup"));
     Assert.ok(!db.tableExists("moz_perms_v6"));
 
-    let mozHostsStmt = db.createStatement("SELECT " +
-                                          "host, type, permission, expireType, expireTime, " +
-                                          "modificationTime, isInBrowserElement " +
-                                          "FROM moz_hosts WHERE id = :id");
+    let mozHostsStmt = db.createStatement(
+      "SELECT " +
+        "host, type, permission, expireType, expireTime, " +
+        "modificationTime, isInBrowserElement " +
+        "FROM moz_hosts WHERE id = :id"
+    );
     try {
       // Check that the moz_hosts table still contains the correct values.
-      created4.forEach((it) => {
+      created4.forEach(it => {
         mozHostsStmt.reset();
         mozHostsStmt.bindByName("id", it.id);
         mozHostsStmt.executeStep();
         Assert.equal(mozHostsStmt.getUTF8String(0), it.host);
         Assert.equal(mozHostsStmt.getUTF8String(1), it.type);
         Assert.equal(mozHostsStmt.getInt64(2), it.permission);
         Assert.equal(mozHostsStmt.getInt64(3), it.expireType);
         Assert.equal(mozHostsStmt.getInt64(4), it.expireTime);
--- a/extensions/permissions/test/unit/test_permmanager_migrate_7-8.js
+++ b/extensions/permissions/test/unit/test_permmanager_migrate_7-8.js
@@ -1,18 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-ChromeUtils.defineModuleGetter(this, "PlacesTestUtils",
-                               "resource://testing-common/PlacesTestUtils.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "PlacesTestUtils",
+  "resource://testing-common/PlacesTestUtils.jsm"
+);
 
 var PERMISSIONS_FILE_NAME = "permissions.sqlite";
 
-function GetPermissionsFile(profile)
-{
+function GetPermissionsFile(profile) {
   let file = profile.clone();
   file.append(PERMISSIONS_FILE_NAME);
   return file;
 }
 
 add_task(async function test() {
   /* Create and set up the permissions database */
   let profile = do_get_profile();
@@ -30,56 +32,69 @@ add_task(async function test() {
     "CREATE TABLE moz_perms (" +
       " id INTEGER PRIMARY KEY" +
       ",origin TEXT" +
       ",type TEXT" +
       ",permission INTEGER" +
       ",expireType INTEGER" +
       ",expireTime INTEGER" +
       ",modificationTime INTEGER" +
-    ")");
+      ")"
+  );
 
   let stmt6Insert = db.createStatement(
     "INSERT INTO moz_perms (" +
       "id, origin, type, permission, expireType, expireTime, modificationTime" +
-    ") VALUES (" +
+      ") VALUES (" +
       ":id, :origin, :type, :permission, :expireType, :expireTime, :modificationTime" +
-    ")");
+      ")"
+  );
 
   /*
    * V4 table
    */
   db.executeSimpleSQL(
     "CREATE TABLE moz_hosts (" +
       " id INTEGER PRIMARY KEY" +
       ",host TEXT" +
       ",type TEXT" +
       ",permission INTEGER" +
       ",expireType INTEGER" +
       ",expireTime INTEGER" +
       ",modificationTime INTEGER" +
       ",appId INTEGER" +
       ",isInBrowserElement INTEGER" +
-    ")");
+      ")"
+  );
 
   let stmtInsert = db.createStatement(
     "INSERT INTO moz_hosts (" +
       "id, host, type, permission, expireType, expireTime, modificationTime, appId, isInBrowserElement" +
-    ") VALUES (" +
+      ") VALUES (" +
       ":id, :host, :type, :permission, :expireType, :expireTime, :modificationTime, :appId, :isInBrowserElement" +
-    ")");
+      ")"
+  );
 
   /*
    * The v4 table is a backup
    */
-  db.executeSimpleSQL("CREATE TABLE moz_hosts_is_backup (dummy INTEGER PRIMARY KEY)");
+  db.executeSimpleSQL(
+    "CREATE TABLE moz_hosts_is_backup (dummy INTEGER PRIMARY KEY)"
+  );
 
   let id = 0;
 
-  function insertOrigin(origin, type, permission, expireType, expireTime, modificationTime) {
+  function insertOrigin(
+    origin,
+    type,
+    permission,
+    expireType,
+    expireTime,
+    modificationTime
+  ) {
     let thisId = id++;
 
     stmt6Insert.bindByName("id", thisId);
     stmt6Insert.bindByName("origin", origin);
     stmt6Insert.bindByName("type", type);
     stmt6Insert.bindByName("permission", permission);
     stmt6Insert.bindByName("expireType", expireType);
     stmt6Insert.bindByName("expireTime", expireTime);
@@ -93,21 +108,30 @@ add_task(async function test() {
 
     return {
       id: thisId,
       origin,
       type,
       permission,
       expireType,
       expireTime,
-      modificationTime
+      modificationTime,
     };
   }
 
-  function insertHost(host, type, permission, expireType, expireTime, modificationTime, appId, isInBrowserElement) {
+  function insertHost(
+    host,
+    type,
+    permission,
+    expireType,
+    expireTime,
+    modificationTime,
+    appId,
+    isInBrowserElement
+  ) {
     let thisId = id++;
 
     stmtInsert.bindByName("id", thisId);
     stmtInsert.bindByName("host", host);
     stmtInsert.bindByName("type", type);
     stmtInsert.bindByName("permission", permission);
     stmtInsert.bindByName("expireType", expireType);
     stmtInsert.bindByName("expireTime", expireTime);
@@ -125,17 +149,17 @@ add_task(async function test() {
       id: thisId,
       host,
       type,
       permission,
       expireType,
       expireTime,
       modificationTime,
       appId,
-      isInBrowserElement
+      isInBrowserElement,
     };
   }
 
   let created7 = [
     insertOrigin("https://foo.com", "A", 2, 0, 0, 0),
     insertOrigin("http://foo.com", "A", 2, 0, 0, 0),
     insertOrigin("http://foo.com^inBrowser=1", "A", 2, 0, 0, 0),
     insertOrigin("https://192.0.2.235", "A", 2, 0, 0),
@@ -156,18 +180,36 @@ add_task(async function test() {
     insertHost("127.0.0.1", "A", 1, 0, 0, 0, 0, false),
     insertHost("192.0.2.235", "A", 1, 0, 0, 0, 0, false),
     // Although ipv6 addresses are written with [] around the IP address,
     // the .host property doesn't contain these []s, which means that we
     // write it like this
     insertHost("2001:db8::ff00:42:8329", "C", 1, 0, 0, 0, 0, false),
     insertHost("file:///some/path/to/file.html", "A", 1, 0, 0, 0, 0, false),
     insertHost("file:///another/file.html", "A", 1, 0, 0, 0, 0, false),
-    insertHost("moz-nullprincipal:{8695105a-adbe-4e4e-8083-851faa5ca2d7}", "A", 1, 0, 0, 0, 0, false),
-    insertHost("moz-nullprincipal:{12ahjksd-akjs-asd3-8393-asdu2189asdu}", "B", 1, 0, 0, 0, 0, false),
+    insertHost(
+      "moz-nullprincipal:{8695105a-adbe-4e4e-8083-851faa5ca2d7}",
+      "A",
+      1,
+      0,
+      0,
+      0,
+      0,
+      false
+    ),
+    insertHost(
+      "moz-nullprincipal:{12ahjksd-akjs-asd3-8393-asdu2189asdu}",
+      "B",
+      1,
+      0,
+      0,
+      0,
+      0,
+      false
+    ),
     insertHost("<file>", "A", 1, 0, 0, 0, 0, false),
     insertHost("<file>", "B", 1, 0, 0, 0, 0, false),
   ];
 
   // CLose the db connection
   stmt6Insert.finalize();
   stmtInsert.finalize();
   db.close();
@@ -187,54 +229,73 @@ add_task(async function test() {
     ["http://[2001:db8::ff00:42:8329]", "C", 1, 0, 0],
     ["https://[2001:db8::ff00:42:8329]", "C", 1, 0, 0],
     ["http://192.0.2.235", "A", 1, 0, 0],
 
     // There should only be one entry of this type in the database
     ["https://192.0.2.235", "A", 2, 0, 0],
   ];
 
-  let found = expected.map((it) => 0);
+  let found = expected.map(it => 0);
 
   // Add some places to the places database
-  await PlacesTestUtils.addVisits(Services.io.newURI("https://foo.com/some/other/subdirectory"));
-  await PlacesTestUtils.addVisits(Services.io.newURI("ftp://some.subdomain.of.foo.com:8000/some/subdirectory"));
+  await PlacesTestUtils.addVisits(
+    Services.io.newURI("https://foo.com/some/other/subdirectory")
+  );
+  await PlacesTestUtils.addVisits(
+    Services.io.newURI("ftp://some.subdomain.of.foo.com:8000/some/subdirectory")
+  );
   await PlacesTestUtils.addVisits(Services.io.newURI("ftp://127.0.0.1:8080"));
   await PlacesTestUtils.addVisits(Services.io.newURI("https://localhost:8080"));
 
   // This will force the permission-manager to reload the data.
   Services.obs.notifyObservers(null, "testonly-reload-permissions-from-disk");
 
   // Force initialization of the nsPermissionManager
   for (let permission of Services.perms.enumerator) {
     let isExpected = false;
 
     expected.forEach((it, i) => {
-      if (permission.principal.origin == it[0] &&
-          permission.type == it[1] &&
-          permission.capability == it[2] &&
-          permission.expireType == it[3] &&
-          permission.expireTime == it[4]) {
+      if (
+        permission.principal.origin == it[0] &&
+        permission.type == it[1] &&
+        permission.capability == it[2] &&
+        permission.expireType == it[3] &&
+        permission.expireTime == it[4]
+      ) {
         isExpected = true;
         found[i]++;
       }
     });
 
-    Assert.ok(isExpected,
-              "Permission " + (isExpected ? "should" : "shouldn't") +
-              " be in permission database: " +
-              permission.principal.origin + ", " +
-              permission.type + ", " +
-              permission.capability + ", " +
-              permission.expireType + ", " +
-              permission.expireTime);
+    Assert.ok(
+      isExpected,
+      "Permission " +
+        (isExpected ? "should" : "shouldn't") +
+        " be in permission database: " +
+        permission.principal.origin +
+        ", " +
+        permission.type +
+        ", " +
+        permission.capability +
+        ", " +
+        permission.expireType +
+        ", " +
+        permission.expireTime
+    );
   }
 
   found.forEach((count, i) => {
-    Assert.ok(count == 1, "Expected count = 1, got count = " + count + " for permission " + expected[i]);
+    Assert.ok(
+      count == 1,
+      "Expected count = 1, got count = " +
+        count +
+        " for permission " +
+        expected[i]
+    );
   });
 
   // Check to make sure that all of the tables which we care about are present
   {
     db = Services.storage.openDatabase(GetPermissionsFile(profile));
     Assert.ok(db.tableExists("moz_perms"));
     Assert.ok(db.tableExists("moz_hosts"));
     Assert.ok(!db.tableExists("moz_hosts_is_backup"));
--- a/extensions/permissions/test/unit/test_permmanager_migrate_9-10.js
+++ b/extensions/permissions/test/unit/test_permmanager_migrate_9-10.js
@@ -1,18 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-ChromeUtils.defineModuleGetter(this, "PlacesTestUtils",
-                               "resource://testing-common/PlacesTestUtils.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "PlacesTestUtils",
+  "resource://testing-common/PlacesTestUtils.jsm"
+);
 
 var PERMISSIONS_FILE_NAME = "permissions.sqlite";
 
-function GetPermissionsFile(profile)
-{
+function GetPermissionsFile(profile) {
   let file = profile.clone();
   file.append(PERMISSIONS_FILE_NAME);
   return file;
 }
 
 add_task(async function test() {
   /* Create and set up the permissions database */
   let profile = do_get_profile();
@@ -27,48 +29,59 @@ add_task(async function test() {
     "CREATE TABLE moz_perms (" +
       " id INTEGER PRIMARY KEY" +
       ",origin TEXT" +
       ",type TEXT" +
       ",permission INTEGER" +
       ",expireType INTEGER" +
       ",expireTime INTEGER" +
       ",modificationTime INTEGER" +
-    ")");
+      ")"
+  );
 
   let stmt6Insert = db.createStatement(
     "INSERT INTO moz_perms (" +
       "id, origin, type, permission, expireType, expireTime, modificationTime" +
-    ") VALUES (" +
+      ") VALUES (" +
       ":id, :origin, :type, :permission, :expireType, :expireTime, :modificationTime" +
-    ")");
+      ")"
+  );
 
   db.executeSimpleSQL(
     "CREATE TABLE moz_hosts (" +
       " id INTEGER PRIMARY KEY" +
       ",host TEXT" +
       ",type TEXT" +
       ",permission INTEGER" +
       ",expireType INTEGER" +
       ",expireTime INTEGER" +
       ",modificationTime INTEGER" +
       ",appId INTEGER" +
       ",isInBrowserElement INTEGER" +
-    ")");
+      ")"
+  );
 
   let stmtInsert = db.createStatement(
     "INSERT INTO moz_hosts (" +
       "id, host, type, permission, expireType, expireTime, modificationTime, appId, isInBrowserElement" +
-    ") VALUES (" +
+      ") VALUES (" +
       ":id, :host, :type, :permission, :expireType, :expireTime, :modificationTime, :appId, :isInBrowserElement" +
-    ")");
+      ")"
+  );
 
   let id = 0;
 
-  function insertOrigin(origin, type, permission, expireType, expireTime, modificationTime) {
+  function insertOrigin(
+    origin,
+    type,
+    permission,
+    expireType,
+    expireTime,
+    modificationTime
+  ) {
     let thisId = id++;
 
     stmt6Insert.bindByName("id", thisId);
     stmt6Insert.bindByName("origin", origin);
     stmt6Insert.bindByName("type", type);
     stmt6Insert.bindByName("permission", permission);
     stmt6Insert.bindByName("expireType", expireType);
     stmt6Insert.bindByName("expireTime", expireTime);
@@ -82,21 +95,30 @@ add_task(async function test() {
 
     return {
       id: thisId,
       origin,
       type,
       permission,
       expireType,
       expireTime,
-      modificationTime
+      modificationTime,
     };
   }
 
-  function insertHost(host, type, permission, expireType, expireTime, modificationTime, appId, isInBrowserElement) {
+  function insertHost(
+    host,
+    type,
+    permission,
+    expireType,
+    expireTime,
+    modificationTime,
+    appId,
+    isInBrowserElement
+  ) {
     let thisId = id++;
 
     stmtInsert.bindByName("id", thisId);
     stmtInsert.bindByName("host", host);
     stmtInsert.bindByName("type", type);
     stmtInsert.bindByName("permission", permission);
     stmtInsert.bindByName("expireType", expireType);
     stmtInsert.bindByName("expireTime", expireTime);
@@ -114,17 +136,17 @@ add_task(async function test() {
       id: thisId,
       host,
       type,
       permission,
       expireType,
       expireTime,
       modificationTime,
       appId,
-      isInBrowserElement
+      isInBrowserElement,
     };
   }
 
   let created7 = [
     insertOrigin("https://foo.com", "A", 2, 0, 0, 0),
     insertOrigin("http://foo.com", "A", 2, 0, 0, 0),
     insertOrigin("http://foo.com^inBrowser=1", "A", 2, 0, 0, 0),
   ];
@@ -144,54 +166,73 @@ add_task(async function test() {
   db = null;
 
   let expected = [
     ["https://foo.com", "A", 2, 0, 0, 0],
     ["http://foo.com", "A", 2, 0, 0, 0],
     ["http://foo.com^inBrowser=1", "A", 2, 0, 0, 0],
   ];
 
-  let found = expected.map((it) => 0);
+  let found = expected.map(it => 0);
 
   // Add some places to the places database
-  await PlacesTestUtils.addVisits(Services.io.newURI("https://foo.com/some/other/subdirectory"));
-  await PlacesTestUtils.addVisits(Services.io.newURI("ftp://some.subdomain.of.foo.com:8000/some/subdirectory"));
+  await PlacesTestUtils.addVisits(
+    Services.io.newURI("https://foo.com/some/other/subdirectory")
+  );
+  await PlacesTestUtils.addVisits(
+    Services.io.newURI("ftp://some.subdomain.of.foo.com:8000/some/subdirectory")
+  );
   await PlacesTestUtils.addVisits(Services.io.newURI("ftp://127.0.0.1:8080"));
   await PlacesTestUtils.addVisits(Services.io.newURI("https://localhost:8080"));
 
   // This will force the permission-manager to reload the data.
   Services.obs.notifyObservers(null, "testonly-reload-permissions-from-disk");
 
   // Force initialization of the nsPermissionManager
   for (let permission of Services.perms.enumerator) {
     let isExpected = false;
 
     expected.forEach((it, i) => {
-      if (permission.principal.origin == it[0] &&
-          permission.type == it[1] &&
-          permission.capability == it[2] &&
-          permission.expireType == it[3] &&
-          permission.expireTime == it[4]) {
+      if (
+        permission.principal.origin == it[0] &&
+        permission.type == it[1] &&
+        permission.capability == it[2] &&
+        permission.expireType == it[3] &&
+        permission.expireTime == it[4]
+      ) {
         isExpected = true;
         found[i]++;
       }
     });
 
-    Assert.ok(isExpected,
-              "Permission " + (isExpected ? "should" : "shouldn't") +
-              " be in permission database: " +
-              permission.principal.origin + ", " +
-              permission.type + ", " +
-              permission.capability + ", " +
-              permission.expireType + ", " +
-              permission.expireTime);
+    Assert.ok(
+      isExpected,
+      "Permission " +
+        (isExpected ? "should" : "shouldn't") +
+        " be in permission database: " +
+        permission.principal.origin +
+        ", " +
+        permission.type +
+        ", " +
+        permission.capability +
+        ", " +
+        permission.expireType +
+        ", " +
+        permission.expireTime
+    );
   }
 
   found.forEach((count, i) => {
-    Assert.ok(count == 1, "Expected count = 1, got count = " + count + " for permission " + expected[i]);
+    Assert.ok(
+      count == 1,
+      "Expected count = 1, got count = " +
+        count +
+        " for permission " +
+        expected[i]
+    );
   });
 
   // Check to make sure that all of the tables which we care about are present
   {
     db = Services.storage.openDatabase(GetPermissionsFile(profile));
     Assert.ok(db.tableExists("moz_perms"));
     Assert.ok(db.tableExists("moz_hosts"));
     Assert.ok(!db.tableExists("moz_perms_v6"));
--- a/extensions/permissions/test/unit/test_permmanager_notifications.js
+++ b/extensions/permissions/test/unit/test_permmanager_notifications.js
@@ -7,47 +7,59 @@
 var test_generator = do_run_test();
 
 function run_test() {
   Services.prefs.setCharPref("permissions.manager.defaultsUrl", "");
   do_test_pending();
   test_generator.next();
 }
 
-function continue_test()
-{
+function continue_test() {
   do_run_generator(test_generator);
 }
 
 function* do_run_test() {
   // Set up a profile.
   let profile = do_get_profile();
 
   let pm = Services.perms;
   let now = Number(Date.now());
   let permType = "test/expiration-perm";
-  let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
-              .getService(Ci.nsIScriptSecurityManager);
+  let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(
+    Ci.nsIScriptSecurityManager
+  );
   let uri = NetUtil.newURI("http://example.com");
   let principal = ssm.createCodebasePrincipal(uri, {});
 
   let observer = new permission_observer(test_generator, now, permType);
   Services.obs.addObserver(observer, "perm-changed");
 
   // Add a permission, to test the 'add' notification. Note that we use
   // do_execute_soon() so that we can use our generator to continue the test
   // where we left off.
   executeSoon(function() {
-    pm.addFromPrincipal(principal, permType, pm.ALLOW_ACTION, pm.EXPIRE_TIME, now + 100000);
+    pm.addFromPrincipal(
+      principal,
+      permType,
+      pm.ALLOW_ACTION,
+      pm.EXPIRE_TIME,
+      now + 100000
+    );
   });
   yield;
 
   // Alter a permission, to test the 'changed' notification.
   executeSoon(function() {
-    pm.addFromPrincipal(principal, permType, pm.ALLOW_ACTION, pm.EXPIRE_TIME, now + 200000);
+    pm.addFromPrincipal(
+      principal,
+      permType,
+      pm.ALLOW_ACTION,
+      pm.EXPIRE_TIME,
+      now + 200000
+    );
   });
   yield;
 
   // Remove a permission, to test the 'deleted' notification.
   executeSoon(function() {
     pm.removeFromPrincipal(principal, permType);
   });
   yield;
@@ -94,47 +106,43 @@ permission_observer.prototype = {
         case 1:
           Assert.equal(this.type, perm.type);
           Assert.equal(this.pm.EXPIRE_TIME, perm.expireType);
           Assert.equal(this.now + 100000, perm.expireTime);
           break;
         default:
           do_throw("too many add notifications posted.");
       }
-
     } else if (data == "changed") {
       let perm = subject.QueryInterface(Ci.nsIPermission);
       this.changes++;
       switch (this.changes) {
         case 1:
           Assert.equal(this.type, perm.type);
           Assert.equal(this.pm.EXPIRE_TIME, perm.expireType);
           Assert.equal(this.now + 200000, perm.expireTime);
           break;
         default:
           do_throw("too many change notifications posted.");
       }
-
     } else if (data == "deleted") {
       let perm = subject.QueryInterface(Ci.nsIPermission);
       this.deletes++;
       switch (this.deletes) {
         case 1:
           Assert.equal(this.type, perm.type);
           break;
         default:
           do_throw("too many delete notifications posted.");
       }
-
     } else if (data == "cleared") {
       // only clear once: at the end
       Assert.ok(!this.cleared);
       Assert.equal(do_count_enumerator(Services.perms.enumerator), 0);
       this.cleared = true;
-
     } else {
       do_throw("unexpected data '" + data + "'!");
     }
 
     // Continue the test.
     do_run_generator(this.generator);
   },
 };
--- a/extensions/permissions/test/unit/test_permmanager_removeall.js
+++ b/extensions/permissions/test/unit/test_permmanager_removeall.js
@@ -1,33 +1,37 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
   // setup a profile directory
   var dir = do_get_profile();
 
   // initialize the permission manager service
-  var pm = Cc["@mozilla.org/permissionmanager;1"].
-           getService(Ci.nsIPermissionManager);
+  var pm = Cc["@mozilla.org/permissionmanager;1"].getService(
+    Ci.nsIPermissionManager
+  );
 
   // get the db file
   var file = dir.clone();
   file.append("permissions.sqlite");
   Assert.ok(file.exists());
 
   // corrupt the file
-  var ostream = Cc["@mozilla.org/network/file-output-stream;1"].
-                createInstance(Ci.nsIFileOutputStream);
+  var ostream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(
+    Ci.nsIFileOutputStream
+  );
   ostream.init(file, 0x02, 0o666, 0);
-  var conv = Cc["@mozilla.org/intl/converter-output-stream;1"].
-             createInstance(Ci.nsIConverterOutputStream);
+  var conv = Cc["@mozilla.org/intl/converter-output-stream;1"].createInstance(
+    Ci.nsIConverterOutputStream
+  );
   conv.init(ostream, "UTF-8");
-  for (var i = 0; i < file.fileSize; ++i)
+  for (var i = 0; i < file.fileSize; ++i) {
     conv.writeString("a");
+  }
   conv.close();
 
   // prepare an empty hostperm.1 file so that it can be used for importing
   var hostperm = dir.clone();
   hostperm.append("hostperm.1");
   ostream.init(hostperm, 0x02 | 0x08, 0o666, 0);
   ostream.close();
 
--- a/extensions/permissions/test/unit/test_permmanager_removebytype.js
+++ b/extensions/permissions/test/unit/test_permmanager_removebytype.js
@@ -1,17 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
   Services.prefs.setCharPref("permissions.manager.defaultsUrl", "");
 
   // initialize the permission manager service
-  let pm = Cc["@mozilla.org/permissionmanager;1"].
-        getService(Ci.nsIPermissionManager);
+  let pm = Cc["@mozilla.org/permissionmanager;1"].getService(
+    Ci.nsIPermissionManager
+  );
 
   Assert.equal(perm_count(), 0);
 
   // add some permissions
   let uri = NetUtil.newURI("http://amazon.com:8080/foobarbaz");
   let uri2 = NetUtil.newURI("http://google.com:2048/quxx");
   let uri3 = NetUtil.newURI("https://google.com/search");
 
--- a/extensions/permissions/test/unit/test_permmanager_removebytypesince.js
+++ b/extensions/permissions/test/unit/test_permmanager_removebytypesince.js
@@ -1,16 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 add_task(async function test() {
   Services.prefs.setCharPref("permissions.manager.defaultsUrl", "");
 
   // initialize the permission manager service
-  let pm = Cc["@mozilla.org/permissionmanager;1"].getService(Ci.nsIPermissionManager);
+  let pm = Cc["@mozilla.org/permissionmanager;1"].getService(
+    Ci.nsIPermissionManager
+  );
 
   Assert.equal(perm_count(), 0);
 
   // add some permissions
   let uri = Services.io.newURI("http://amazon.com:8080/foobarbaz");
   let uri2 = Services.io.newURI("http://google.com:2048/quxx");
   let uri3 = Services.io.newURI("https://google.com/search");
 
@@ -43,43 +45,43 @@ add_task(async function test() {
   Assert.equal(perm_count(), 5);
 
   Assert.equal(pm.testPermission(uri, "pear"), 1);
   Assert.equal(pm.testPermission(uri2, "pear"), 2);
 
   Assert.equal(pm.testPermission(uri, "apple"), 3);
   Assert.equal(pm.testPermission(uri2, "apple"), 0);
   Assert.equal(pm.testPermission(uri3, "apple"), 0);
- 
+
   Assert.equal(pm.testPermission(uri, "cucumber"), 1);
   Assert.equal(pm.testPermission(uri3, "cucumber"), 3);
 
   pm.removeByTypeSince("cucumber", since);
   Assert.equal(perm_count(), 4);
 
   Assert.equal(pm.testPermission(uri, "pear"), 1);
   Assert.equal(pm.testPermission(uri2, "pear"), 2);
-  
+
   Assert.equal(pm.testPermission(uri, "apple"), 3);
   Assert.equal(pm.testPermission(uri2, "apple"), 0);
   Assert.equal(pm.testPermission(uri3, "apple"), 0);
-  
+
   Assert.equal(pm.testPermission(uri, "cucumber"), 1);
   Assert.equal(pm.testPermission(uri3, "cucumber"), 0);
-  
+
   pm.removeByTypeSince("pear", since);
   Assert.equal(perm_count(), 3);
-  
+
   Assert.equal(pm.testPermission(uri, "pear"), 1);
   Assert.equal(pm.testPermission(uri2, "pear"), 0);
-  
+
   Assert.equal(pm.testPermission(uri, "apple"), 3);
   Assert.equal(pm.testPermission(uri2, "apple"), 0);
   Assert.equal(pm.testPermission(uri3, "apple"), 0);
-  
+
   Assert.equal(pm.testPermission(uri, "cucumber"), 1);
   Assert.equal(pm.testPermission(uri3, "cucumber"), 0);
 
   function perm_count() {
     let enumerator = pm.enumerator;
     let count = 0;
     while (enumerator.hasMoreElements()) {
       count++;
--- a/extensions/permissions/test/unit/test_permmanager_removepermission.js
+++ b/extensions/permissions/test/unit/test_permmanager_removepermission.js
@@ -1,15 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function run_test() {
   // initialize the permission manager service
-  let pm = Cc["@mozilla.org/permissionmanager;1"].
-        getService(Ci.nsIPermissionManager);
+  let pm = Cc["@mozilla.org/permissionmanager;1"].getService(
+    Ci.nsIPermissionManager
+  );
 
   Assert.equal(perm_count(), 0);
 
   // add some permissions
   let uri = NetUtil.newURI("http://amazon.com:8080/foobarbaz");
   let uri2 = NetUtil.newURI("http://google.com:2048/quxx");
 
   pm.add(uri, "apple", 0);
@@ -37,17 +38,16 @@ function run_test() {
   Assert.equal(perm_count(), 2);
 
   remove_one_by_type("cucumber");
   Assert.equal(perm_count(), 1);
 
   remove_one_by_type("pear");
   Assert.equal(perm_count(), 0);
 
-
   function perm_count() {
     let enumerator = pm.enumerator;
     let count = 0;
     while (enumerator.hasMoreElements()) {
       count++;
       enumerator.getNext();
     }
 
--- a/extensions/permissions/test/unit/test_permmanager_removesince.js
+++ b/extensions/permissions/test/unit/test_permmanager_removesince.js
@@ -5,34 +5,39 @@
 
 var test_generator = do_run_test();
 
 function run_test() {
   do_test_pending();
   test_generator.next();
 }
 
-function continue_test()
-{
+function continue_test() {
   do_run_generator(test_generator);
 }
 
 function* do_run_test() {
   // Set up a profile.
   let profile = do_get_profile();
 
   let pm = Services.perms;
 
   // to help with testing edge-cases, we will arrange for .removeAllSince to
   // remove *all* permissions from one principal and one permission from another.
   let permURI1 = NetUtil.newURI("http://example.com");
-  let principal1 = Services.scriptSecurityManager.createCodebasePrincipal(permURI1, {});
+  let principal1 = Services.scriptSecurityManager.createCodebasePrincipal(
+    permURI1,
+    {}
+  );
 
   let permURI2 = NetUtil.newURI("http://example.org");
-  let principal2 = Services.scriptSecurityManager.createCodebasePrincipal(permURI2, {});
+  let principal2 = Services.scriptSecurityManager.createCodebasePrincipal(
+    permURI2,
+    {}
+  );
 
   // add a permission now - this isn't going to be removed.
   pm.addFromPrincipal(principal1, "test/remove-since", 1);
 
   // sleep briefly, then record the time - we'll remove all since then.
   do_timeout(20, continue_test);
   yield;
 
@@ -52,18 +57,30 @@ function* do_run_test() {
   // add 2 items for the second principal - both will be removed.
   pm.addFromPrincipal(principal2, "test/remove-since", 1);
   pm.addFromPrincipal(principal2, "test/remove-since-2", 1);
 
   // do the removal.
   pm.removeAllSince(since);
 
   // principal1 - the first one should remain.
-  Assert.equal(1, pm.testPermissionFromPrincipal(principal1, "test/remove-since"));
+  Assert.equal(
+    1,
+    pm.testPermissionFromPrincipal(principal1, "test/remove-since")
+  );
   // but the second should have been removed.
-  Assert.equal(0, pm.testPermissionFromPrincipal(principal1, "test/remove-since-2"));
+  Assert.equal(
+    0,
+    pm.testPermissionFromPrincipal(principal1, "test/remove-since-2")
+  );
 
   // principal2 - both should have been removed.
-  Assert.equal(0, pm.testPermissionFromPrincipal(principal2, "test/remove-since"));
-  Assert.equal(0, pm.testPermissionFromPrincipal(principal2, "test/remove-since-2"));
+  Assert.equal(
+    0,
+    pm.testPermissionFromPrincipal(principal2, "test/remove-since")
+  );
+  Assert.equal(
+    0,
+    pm.testPermissionFromPrincipal(principal2, "test/remove-since-2")
+  );
 
   do_finish_generator_test(test_generator);
 }
--- a/extensions/permissions/test/unit/test_permmanager_subdomains.js
+++ b/extensions/permissions/test/unit/test_permmanager_subdomains.js
@@ -1,74 +1,229 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function getPrincipalFromURI(aURI) {
-  let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
-              .getService(Ci.nsIScriptSecurityManager);
+  let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(
+    Ci.nsIScriptSecurityManager
+  );
   let uri = NetUtil.newURI(aURI);
   return ssm.createCodebasePrincipal(uri, {});
 }
 
 function run_test() {
-  var pm = Cc["@mozilla.org/permissionmanager;1"].
-           getService(Ci.nsIPermissionManager);
+  var pm = Cc["@mozilla.org/permissionmanager;1"].getService(
+    Ci.nsIPermissionManager
+  );
 
   // Adds a permission to a sub-domain. Checks if it is working.
   let sub1Principal = getPrincipalFromURI("http://sub1.example.com");
   pm.addFromPrincipal(sub1Principal, "test/subdomains", pm.ALLOW_ACTION, 0, 0);
-  Assert.equal(pm.testPermissionFromPrincipal(sub1Principal, "test/subdomains"), pm.ALLOW_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(sub1Principal.originNoSuffix, "test/subdomains"), pm.ALLOW_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(sub1Principal, "test/subdomains"),
+    pm.ALLOW_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      sub1Principal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.ALLOW_ACTION
+  );
 
   // A sub-sub-domain should get the permission.
   let subsubPrincipal = getPrincipalFromURI("http://sub.sub1.example.com");
-  Assert.equal(pm.testPermissionFromPrincipal(subsubPrincipal, "test/subdomains"), pm.ALLOW_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(subsubPrincipal.originNoSuffix, "test/subdomains"), pm.ALLOW_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(subsubPrincipal, "test/subdomains"),
+    pm.ALLOW_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      subsubPrincipal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.ALLOW_ACTION
+  );
 
   // Another sub-domain shouldn't get the permission.
   let sub2Principal = getPrincipalFromURI("http://sub2.example.com");
-  Assert.equal(pm.testPermissionFromPrincipal(sub2Principal, "test/subdomains"), pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(sub2Principal.originNoSuffix, "test/subdomains"), pm.UNKNOWN_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(sub2Principal, "test/subdomains"),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      sub2Principal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.UNKNOWN_ACTION
+  );
 
   // Remove current permissions.
   pm.removeFromPrincipal(sub1Principal, "test/subdomains");
-  Assert.equal(pm.testPermissionFromPrincipal(sub1Principal, "test/subdomains"), pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(sub1Principal.originNoSuffix, "test/subdomains"), pm.UNKNOWN_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(sub1Principal, "test/subdomains"),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      sub1Principal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.UNKNOWN_ACTION
+  );
 
   // Adding the permission to the main domain. Checks if it is working.
   let mainPrincipal = getPrincipalFromURI("http://example.com");
   pm.addFromPrincipal(mainPrincipal, "test/subdomains", pm.ALLOW_ACTION, 0, 0);
-  Assert.equal(pm.testPermissionFromPrincipal(mainPrincipal, "test/subdomains"), pm.ALLOW_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(mainPrincipal.originNoSuffix, "test/subdomains"), pm.ALLOW_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(mainPrincipal, "test/subdomains"),
+    pm.ALLOW_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      mainPrincipal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.ALLOW_ACTION
+  );
 
   // All sub-domains should have the permission now.
-  Assert.equal(pm.testPermissionFromPrincipal(sub1Principal, "test/subdomains"), pm.ALLOW_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(sub1Principal.originNoSuffix, "test/subdomains"), pm.ALLOW_ACTION);
-  Assert.equal(pm.testPermissionFromPrincipal(sub2Principal, "test/subdomains"), pm.ALLOW_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(sub2Principal.originNoSuffix, "test/subdomains"), pm.ALLOW_ACTION);
-  Assert.equal(pm.testPermissionFromPrincipal(subsubPrincipal, "test/subdomains"), pm.ALLOW_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(subsubPrincipal.originNoSuffix, "test/subdomains"), pm.ALLOW_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(sub1Principal, "test/subdomains"),
+    pm.ALLOW_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      sub1Principal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.ALLOW_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(sub2Principal, "test/subdomains"),
+    pm.ALLOW_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      sub2Principal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.ALLOW_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(subsubPrincipal, "test/subdomains"),
+    pm.ALLOW_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      subsubPrincipal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.ALLOW_ACTION
+  );
 
   // Remove current permissions.
   pm.removeFromPrincipal(mainPrincipal, "test/subdomains");
-  Assert.equal(pm.testPermissionFromPrincipal(mainPrincipal, "test/subdomains"), pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(mainPrincipal.originNoSuffix, "test/subdomains"), pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionFromPrincipal(sub1Principal, "test/subdomains"), pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(sub1Principal.originNoSuffix, "test/subdomains"), pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionFromPrincipal(sub2Principal, "test/subdomains"), pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(sub2Principal.originNoSuffix, "test/subdomains"), pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionFromPrincipal(subsubPrincipal, "test/subdomains"), pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(subsubPrincipal.originNoSuffix, "test/subdomains"), pm.UNKNOWN_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(mainPrincipal, "test/subdomains"),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      mainPrincipal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(sub1Principal, "test/subdomains"),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      sub1Principal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(sub2Principal, "test/subdomains"),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      sub2Principal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(subsubPrincipal, "test/subdomains"),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      subsubPrincipal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.UNKNOWN_ACTION
+  );
 
   // A sanity check that the previous implementation wasn't passing...
   let crazyPrincipal = getPrincipalFromURI("http://com");
   pm.addFromPrincipal(crazyPrincipal, "test/subdomains", pm.ALLOW_ACTION, 0, 0);
-  Assert.equal(pm.testPermissionFromPrincipal(crazyPrincipal, "test/subdomains"),  pm.ALLOW_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(crazyPrincipal.originNoSuffix, "test/subdomains"),  pm.ALLOW_ACTION);
-  Assert.equal(pm.testPermissionFromPrincipal(mainPrincipal, "test/subdomains"),   pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(mainPrincipal.originNoSuffix, "test/subdomains"),   pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionFromPrincipal(sub1Principal, "test/subdomains"),   pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(sub1Principal.originNoSuffix, "test/subdomains"),   pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionFromPrincipal(sub2Principal, "test/subdomains"),   pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(sub2Principal.originNoSuffix, "test/subdomains"),   pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionFromPrincipal(subsubPrincipal, "test/subdomains"), pm.UNKNOWN_ACTION);
-  Assert.equal(pm.testPermissionOriginNoSuffix(subsubPrincipal.originNoSuffix, "test/subdomains"), pm.UNKNOWN_ACTION);
+  Assert.equal(
+    pm.testPermissionFromPrincipal(crazyPrincipal, "test/subdomains"),
+    pm.ALLOW_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      crazyPrincipal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.ALLOW_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(mainPrincipal, "test/subdomains"),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      mainPrincipal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(sub1Principal, "test/subdomains"),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      sub1Principal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(sub2Principal, "test/subdomains"),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      sub2Principal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionFromPrincipal(subsubPrincipal, "test/subdomains"),
+    pm.UNKNOWN_ACTION
+  );
+  Assert.equal(
+    pm.testPermissionOriginNoSuffix(
+      subsubPrincipal.originNoSuffix,
+      "test/subdomains"
+    ),
+    pm.UNKNOWN_ACTION
+  );
 }
--- a/extensions/pref/autoconfig/src/prefcalls.js
+++ b/extensions/pref/autoconfig/src/prefcalls.js
@@ -15,208 +15,222 @@ const PrefServiceContractID = "@mozilla.
 
 // ChromeUtils isn't available here, so we can't use Services.*
 /* eslint-disable mozilla/use-services */
 
 var gVersion;
 var gIsUTF8;
 
 function getPrefBranch() {
-    var prefService = Cc[PrefServiceContractID]
-                        .getService(nsIPrefService);
-    return prefService.getBranch(null);
+  var prefService = Cc[PrefServiceContractID].getService(nsIPrefService);
+  return prefService.getBranch(null);
 }
 
 function pref(prefName, value) {
-    try {
-        var prefBranch = getPrefBranch();
+  try {
+    var prefBranch = getPrefBranch();
 
-        if (typeof value == "string") {
-            if (gIsUTF8) {
-                prefBranch.setStringPref(prefName, value);
-                return;
-            }
-            prefBranch.setCharPref(prefName, value);
-        } else if (typeof value == "number") {
-            prefBranch.setIntPref(prefName, value);
-        } else if (typeof value == "boolean") {
-            prefBranch.setBoolPref(prefName, value);
-        }
-    } catch (e) {
-        displayError("pref", e);
+    if (typeof value == "string") {
+      if (gIsUTF8) {
+        prefBranch.setStringPref(prefName, value);
+        return;
+      }
+      prefBranch.setCharPref(prefName, value);
+    } else if (typeof value == "number") {
+      prefBranch.setIntPref(prefName, value);
+    } else if (typeof value == "boolean") {
+      prefBranch.setBoolPref(prefName, value);
     }
+  } catch (e) {
+    displayError("pref", e);
+  }
 }
 
 function defaultPref(prefName, value) {
-    try {
-        var prefService = Cc[PrefServiceContractID]
-                            .getService(nsIPrefService);
-        var prefBranch = prefService.getDefaultBranch(null);
-        if (typeof value == "string") {
-            if (gIsUTF8) {
-                prefBranch.setStringPref(prefName, value);
-                return;
-            }
-            prefBranch.setCharPref(prefName, value);
-        } else if (typeof value == "number") {
-            prefBranch.setIntPref(prefName, value);
-        } else if (typeof value == "boolean") {
-            prefBranch.setBoolPref(prefName, value);
-        }
-    } catch (e) {
-        displayError("defaultPref", e);
+  try {
+    var prefService = Cc[PrefServiceContractID].getService(nsIPrefService);
+    var prefBranch = prefService.getDefaultBranch(null);
+    if (typeof value == "string") {
+      if (gIsUTF8) {
+        prefBranch.setStringPref(prefName, value);
+        return;
+      }
+      prefBranch.setCharPref(prefName, value);
+    } else if (typeof value == "number") {
+      prefBranch.setIntPref(prefName, value);
+    } else if (typeof value == "boolean") {
+      prefBranch.setBoolPref(prefName, value);
     }
+  } catch (e) {
+    displayError("defaultPref", e);
+  }
 }
 
 function lockPref(prefName, value) {
-    try {
-        var prefBranch = getPrefBranch();
+  try {
+    var prefBranch = getPrefBranch();
 
-        if (prefBranch.prefIsLocked(prefName))
-            prefBranch.unlockPref(prefName);
+    if (prefBranch.prefIsLocked(prefName)) {
+      prefBranch.unlockPref(prefName);
+    }
 
-        defaultPref(prefName, value);
+    defaultPref(prefName, value);
 
-        prefBranch.lockPref(prefName);
-    } catch (e) {
-        displayError("lockPref", e);
-    }
+    prefBranch.lockPref(prefName);
+  } catch (e) {
+    displayError("lockPref", e);
+  }
 }
 
 function unlockPref(prefName) {
-    try {
-        var prefBranch = getPrefBranch();
-        prefBranch.unlockPref(prefName);
-    } catch (e) {
-        displayError("unlockPref", e);
-    }
+  try {
+    var prefBranch = getPrefBranch();
+    prefBranch.unlockPref(prefName);
+  } catch (e) {
+    displayError("unlockPref", e);
+  }
 }
 
 function getPref(prefName) {
-    try {
-        var prefBranch = getPrefBranch();
+  try {
+    var prefBranch = getPrefBranch();
 
-        switch (prefBranch.getPrefType(prefName)) {
-        case prefBranch.PREF_STRING:
-            if (gIsUTF8) {
-                return prefBranch.getStringPref(prefName);
-            }
-            return prefBranch.getCharPref(prefName);
+    switch (prefBranch.getPrefType(prefName)) {
+      case prefBranch.PREF_STRING:
+        if (gIsUTF8) {
+          return prefBranch.getStringPref(prefName);
+        }
+        return prefBranch.getCharPref(prefName);
 
-        case prefBranch.PREF_INT:
-            return prefBranch.getIntPref(prefName);
+      case prefBranch.PREF_INT:
+        return prefBranch.getIntPref(prefName);
 
-        case prefBranch.PREF_BOOL:
-            return prefBranch.getBoolPref(prefName);
-        default:
-            return null;
-        }
-    } catch (e) {
-        displayError("getPref", e);
+      case prefBranch.PREF_BOOL:
+        return prefBranch.getBoolPref(prefName);
+      default:
+        return null;
     }
-    return undefined;
+  } catch (e) {
+    displayError("getPref", e);
+  }
+  return undefined;
 }
 
 function clearPref(prefName) {
-    try {
-        var prefBranch = getPrefBranch();
-            prefBranch.clearUserPref(prefName);
-    } catch (e) {
-    }
+  try {
+    var prefBranch = getPrefBranch();
+    prefBranch.clearUserPref(prefName);
+  } catch (e) {}
 }
 
 function setLDAPVersion(version) {
-    gVersion = version;
+  gVersion = version;
 }
 
-
 function getLDAPAttributes(host, base, filter, attribs, isSecure) {
-    try {
-        var urlSpec = "ldap" + (isSecure ? "s" : "") + "://" + host + (isSecure ? ":636" : "") + "/" + base + "?" + attribs + "?sub?" +
-                      filter;
-
-        var url = Cc["@mozilla.org/network/io-service;1"]
-                    .getService(Ci.nsIIOService)
-                    .newURI(urlSpec)
-                    .QueryInterface(Ci.nsILDAPURL);
+  try {
+    var urlSpec =
+      "ldap" +
+      (isSecure ? "s" : "") +
+      "://" +
+      host +
+      (isSecure ? ":636" : "") +
+      "/" +
+      base +
+      "?" +
+      attribs +
+      "?sub?" +
+      filter;
 
-        var ldapquery = Cc[LDAPSyncQueryContractID]
-                          .createInstance(nsILDAPSyncQuery);
-        // default to LDAP v3
-        if (!gVersion)
-          gVersion = Ci.nsILDAPConnection.VERSION3;
-        // user supplied method
-        processLDAPValues(ldapquery.getQueryResults(url, gVersion));
-    } catch (e) {
-        displayError("getLDAPAttibutes", e);
+    var url = Cc["@mozilla.org/network/io-service;1"]
+      .getService(Ci.nsIIOService)
+      .newURI(urlSpec)
+      .QueryInterface(Ci.nsILDAPURL);
+
+    var ldapquery = Cc[LDAPSyncQueryContractID].createInstance(
+      nsILDAPSyncQuery
+    );
+    // default to LDAP v3
+    if (!gVersion) {
+      gVersion = Ci.nsILDAPConnection.VERSION3;
     }
+    // user supplied method
+    processLDAPValues(ldapquery.getQueryResults(url, gVersion));
+  } catch (e) {
+    displayError("getLDAPAttibutes", e);
+  }
 }
 
 function getLDAPValue(str, key) {
-    try {
-        if (str == null || key == null)
-            return null;
+  try {
+    if (str == null || key == null) {
+      return null;
+    }
 
-        var search_key = "\n" + key + "=";
+    var search_key = "\n" + key + "=";
 
-        var start_pos = str.indexOf(search_key);
-        if (start_pos == -1)
-            return null;
+    var start_pos = str.indexOf(search_key);
+    if (start_pos == -1) {
+      return null;
+    }
 
-        start_pos += search_key.length;
-
-        var end_pos = str.indexOf("\n", start_pos);
-        if (end_pos == -1)
-            end_pos = str.length;
+    start_pos += search_key.length;
 
-        return str.substring(start_pos, end_pos);
-    } catch (e) {
-        displayError("getLDAPValue", e);
+    var end_pos = str.indexOf("\n", start_pos);
+    if (end_pos == -1) {
+      end_pos = str.length;
     }
-    return undefined;
+
+    return str.substring(start_pos, end_pos);
+  } catch (e) {
+    displayError("getLDAPValue", e);
+  }
+  return undefined;
 }
 
 function displayError(funcname, message) {
-    try {
-        var promptService = Cc["@mozilla.org/embedcomp/prompt-service;1"]
-                              .getService(Ci.nsIPromptService);
-        var bundle = Cc["@mozilla.org/intl/stringbundle;1"]
-                       .getService(Ci.nsIStringBundleService)
-                       .createBundle("chrome://autoconfig/locale/autoconfig.properties");
+  try {
+    var promptService = Cc[
+      "@mozilla.org/embedcomp/prompt-service;1"
+    ].getService(Ci.nsIPromptService);
+    var bundle = Cc["@mozilla.org/intl/stringbundle;1"]
+      .getService(Ci.nsIStringBundleService)
+      .createBundle("chrome://autoconfig/locale/autoconfig.properties");
 
-         var title = bundle.GetStringFromName("autoConfigTitle");
-         var msg = bundle.formatStringFromName("autoConfigMsg", [funcname]);
-         promptService.alert(null, title, msg + " " + message);
-    } catch (e) { }
+    var title = bundle.GetStringFromName("autoConfigTitle");
+    var msg = bundle.formatStringFromName("autoConfigMsg", [funcname]);
+    promptService.alert(null, title, msg + " " + message);
+  } catch (e) {}
 }
 
 function getenv(name) {
-    try {
-        var environment = Cc["@mozilla.org/process/environment;1"].
-            getService(Ci.nsIEnvironment);
-        return environment.get(name);
-    } catch (e) {
-        displayError("getEnvironment", e);
-    }
-    return undefined;
+  try {
+    var environment = Cc["@mozilla.org/process/environment;1"].getService(
+      Ci.nsIEnvironment
+    );
+    return environment.get(name);
+  } catch (e) {
+    displayError("getEnvironment", e);
+  }
+  return undefined;
 }
 
 var APIs = {
-    pref,
-    defaultPref,
-    lockPref,
-    unlockPref,
-    getPref,
-    clearPref,
-    setLDAPVersion,
-    getLDAPAttributes,
-    getLDAPValue,
-    displayError,
-    getenv,
+  pref,
+  defaultPref,
+  lockPref,
+  unlockPref,
+  getPref,
+  clearPref,
+  setLDAPVersion,
+  getLDAPAttributes,
+  getLDAPValue,
+  displayError,
+  getenv,
 };
 
 for (let [defineAs, func] of Object.entries(APIs)) {
-    Cu.exportFunction(func, gSandbox, {defineAs});
+  Cu.exportFunction(func, gSandbox, { defineAs });
 }
 
 Object.defineProperty(Cu.waiveXrays(gSandbox), "gIsUTF8", {
   get: Cu.exportFunction(() => gIsUTF8, gSandbox),
 });
--- a/extensions/pref/autoconfig/test/unit/test_autoconfig.js
+++ b/extensions/pref/autoconfig/test/unit/test_autoconfig.js
@@ -1,20 +1,21 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /* eslint no-unsafe-finally: "off"*/
 /* Turning off this rule to allow control flow operations in finally block
  * http://eslint.org/docs/rules/no-unsafe-finally  */
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function run_test() {
-  let env = Cc["@mozilla.org/process/environment;1"]
-    .getService(Ci.nsIEnvironment);
+  let env = Cc["@mozilla.org/process/environment;1"].getService(
+    Ci.nsIEnvironment
+  );
   let prefs = Services.prefs.getBranch(null);
   let defPrefs = Services.prefs.getDefaultBranch(null);
 
   let greD = Services.dirsvc.get("GreD", Ci.nsIFile);
   let defaultPrefD = Services.dirsvc.get("PrfDef", Ci.nsIFile);
   let testDir = do_get_cwd();
 
   try {
@@ -27,22 +28,28 @@ function run_test() {
     Services.prefs.resetPrefs();
 
     let autoConfigCfg = testDir.clone();
     autoConfigCfg.append("autoconfig-all.cfg");
     autoConfigCfg.copyTo(greD, "autoconfig.cfg");
 
     env.set("AUTOCONFIG_TEST_GETENV", "getenv");
 
-    Services.obs.notifyObservers(Services.prefs, "prefservice:before-read-userprefs");
+    Services.obs.notifyObservers(
+      Services.prefs,
+      "prefservice:before-read-userprefs"
+    );
 
     ok(prefs.prefHasUserValue("_autoconfig_.test.userpref"));
     equal("userpref", prefs.getStringPref("_autoconfig_.test.userpref"));
 
-    equal("defaultpref", defPrefs.getStringPref("_autoconfig_.test.defaultpref"));
+    equal(
+      "defaultpref",
+      defPrefs.getStringPref("_autoconfig_.test.defaultpref")
+    );
     equal("defaultpref", prefs.getStringPref("_autoconfig_.test.defaultpref"));
 
     ok(prefs.prefIsLocked("_autoconfig_.test.lockpref"));
     equal("lockpref", prefs.getStringPref("_autoconfig_.test.lockpref"));
 
     ok(!prefs.prefIsLocked("_autoconfig_.test.unlockpref"));
     equal("unlockpref", prefs.getStringPref("_autoconfig_.test.unlockpref"));
 
--- a/extensions/pref/autoconfig/test/unit/test_autoconfig_nonascii.js
+++ b/extensions/pref/autoconfig/test/unit/test_autoconfig_nonascii.js
@@ -1,75 +1,90 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /* eslint no-unsafe-finally: "off"*/
 /* Turning off this rule to allow control flow operations in finally block
  * http://eslint.org/docs/rules/no-unsafe-finally  */
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function run_test() {
   let greD = Services.dirsvc.get("GreD", Ci.nsIFile);
   let defaultPrefD = Services.dirsvc.get("PrfDef", Ci.nsIFile);
   let testDir = do_get_cwd();
 
   try {
     let autoConfigJS = testDir.clone();
     autoConfigJS.append("autoconfig.js");
     autoConfigJS.copyTo(defaultPrefD, "autoconfig.js");
 
     // Make sure nsReadConfig is initialized.
     Cc["@mozilla.org/readconfig;1"].getService(Ci.nsISupports);
     Services.prefs.resetPrefs();
 
-    var tests = [{
-      filename: "autoconfig-utf8.cfg",
-      prefs: {
-        "_test.string.ASCII": "UTF-8",
-        "_test.string.non-ASCII": "日本語",
-        "_test.string.getPref": "日本語",
-        "_test.string.gIsUTF8": "true",
+    var tests = [
+      {
+        filename: "autoconfig-utf8.cfg",
+        prefs: {
+          "_test.string.ASCII": "UTF-8",
+          "_test.string.non-ASCII": "日本語",
+          "_test.string.getPref": "日本語",
+          "_test.string.gIsUTF8": "true",
+        },
       },
-    }, {
-      filename: "autoconfig-latin1.cfg",
-      prefs: {
-        "_test.string.ASCII": "ASCII",
-        "_test.string.non-ASCII": "日本語",
-        "_test.string.getPref": "日本語",
-        "_test.string.gIsUTF8": "false",
+      {
+        filename: "autoconfig-latin1.cfg",
+        prefs: {
+          "_test.string.ASCII": "ASCII",
+          "_test.string.non-ASCII": "日本語",
+          "_test.string.getPref": "日本語",
+          "_test.string.gIsUTF8": "false",
+        },
       },
-    }, {
-      filename: "autoconfig-chromecheck.cfg",
-      prefs: {
-        "_test.string.typeofComponents": "undefined",
+      {
+        filename: "autoconfig-chromecheck.cfg",
+        prefs: {
+          "_test.string.typeofComponents": "undefined",
+        },
       },
-    }];
+    ];
 
     function testAutoConfig(test) {
       // Make sure pref values are unset.
       for (let prefName in test.prefs) {
-        Assert.equal(Ci.nsIPrefBranch.PREF_INVALID, Services.prefs.getPrefType(prefName));
+        Assert.equal(
+          Ci.nsIPrefBranch.PREF_INVALID,
+          Services.prefs.getPrefType(prefName)
+        );
       }
 
       let autoConfigCfg = testDir.clone();
       autoConfigCfg.append(test.filename);
       autoConfigCfg.copyTo(greD, "autoconfig.cfg");
 
-      Services.obs.notifyObservers(Services.prefs, "prefservice:before-read-userprefs");
+      Services.obs.notifyObservers(
+        Services.prefs,
+        "prefservice:before-read-userprefs"
+      );
 
       for (let prefName in test.prefs) {
-        Assert.equal(test.prefs[prefName],
-                     Services.prefs.getStringPref(prefName));
+        Assert.equal(
+          test.prefs[prefName],
+          Services.prefs.getStringPref(prefName)
+        );
       }
 
       Services.prefs.resetPrefs();
       // Make sure pref values are reset.
       for (let prefName in test.prefs) {
-        Assert.equal(Ci.nsIPrefBranch.PREF_INVALID, Services.prefs.getPrefType(prefName));
+        Assert.equal(
+          Ci.nsIPrefBranch.PREF_INVALID,
+          Services.prefs.getPrefType(prefName)
+        );
       }
     }
 
     tests.forEach(testAutoConfig);
   } finally {
     try {
       let autoConfigJS = defaultPrefD.clone();
       autoConfigJS.append("autoconfig.js");
--- a/extensions/spellcheck/hunspell/tests/unit/test_hunspell.js
+++ b/extensions/spellcheck/hunspell/tests/unit/test_hunspell.js
@@ -1,141 +1,172 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 const tests = [
-    ["affixes", "iso-8859-1"],
-    ["condition", "iso-8859-1"],
-    ["condition-utf", "UTF-8"],
-    ["base", "iso-8859-1"],
-    ["base-utf", "UTF-8"],
-    ["allcaps", "iso-8859-1"],
-    ["allcaps-utf", "UTF-8"],
-    ["allcaps2", "iso-8859-1"],
-    ["allcaps3", "iso-8859-1"],
-    ["keepcase", "iso-8859-1"],
-    ["i58202", "iso-8859-1"],
-    ["map", "iso-8859-1"],
-    ["rep", "iso-8859-1"],
-    ["sug", "iso-8859-1"],
-    ["sugutf", "UTF-8"],
-    ["phone", "iso-8859-1"],
-    ["flag", "iso-8859-1"],
-    ["flaglong", "iso-8859-1"],
-    ["flagnum", "iso-8859-1"],
-    ["flagutf8", "UTF-8"],
-    ["slash", "iso-8859-1"],
-    ["forbiddenword", "iso-8859-1"],
-    ["nosuggest", "iso-8859-1"],
-    ["alias", "iso-8859-1"],
-    ["alias2", "iso-8859-1"],
-    ["alias3", "iso-8859-1"],
-    ["breakdefault", "iso-8859-1"],
-    ["break", "UTF-8"],
-    ["needaffix", "iso-8859-1"],
-    ["needaffix2", "iso-8859-1"],
-    ["needaffix3", "iso-8859-1"],
-    ["needaffix4", "iso-8859-1"],
-    ["needaffix5", "iso-8859-1"],
-    ["circumfix", "iso-8859-1"],
-    ["fogemorpheme", "iso-8859-1"],
-    ["onlyincompound", "iso-8859-1"],
-    ["complexprefixes", "iso-8859-1"],
-    ["complexprefixes2", "iso-8859-1"],
-    ["complexprefixesutf", "UTF-8"],
-    ["conditionalprefix", "iso-8859-1"],
-    ["zeroaffix", "iso-8859-1"],
-    ["utf8", "UTF-8"],
-    ["utf8-bom", "UTF-8", {1: "todo"}],
-    ["utf8-bom2", "UTF-8", {1: "todo"}],
-    ["utf8-nonbmp", "UTF-8", {1: "todo", 2: "todo", 3: "todo", 4: "todo"}],
-    ["compoundflag", "iso-8859-1"],
-    ["compoundrule", "iso-8859-1"],
-    ["compoundrule2", "iso-8859-1"],
-    ["compoundrule3", "iso-8859-1"],
-    ["compoundrule4", "iso-8859-1"],
-    ["compoundrule5", "UTF-8"],
-    ["compoundrule6", "iso-8859-1"],
-    ["compoundrule7", "iso-8859-1"],
-    ["compoundrule8", "iso-8859-1"],
-    ["compoundaffix", "iso-8859-1"],
-    ["compoundaffix2", "iso-8859-1"],
-    ["compoundaffix3", "iso-8859-1"],
-    ["checkcompounddup", "iso-8859-1"],
-    ["checkcompoundtriple", "iso-8859-1"],
-    ["simplifiedtriple", "iso-8859-1"],
-    ["checkcompoundrep", "iso-8859-1"],
-    ["checkcompoundcase2", "iso-8859-1"],
-    ["checkcompoundcaseutf", "UTF-8"],
-    ["checkcompoundpattern", "iso-8859-1"],
-    ["checkcompoundpattern2", "iso-8859-1"],
-    ["checkcompoundpattern3", "iso-8859-1"],
-    ["checkcompoundpattern4", "iso-8859-1"],
-    ["utfcompound", "UTF-8"],
-    ["checksharps", "iso-8859-1"],
-    ["checksharpsutf", "UTF-8"],
-    ["germancompounding", "iso-8859-1"],
-    ["germancompoundingold", "iso-8859-1"],
-    ["i35725", "iso-8859-1"],
-    ["i53643", "iso-8859-1"],
-    ["i54633", "iso-8859-1"],
-    ["i54980", "iso-8859-1", {1: "todo", 3: "todo"}],
-    ["maputf", "UTF-8"],
-    ["reputf", "UTF-8"],
-    ["ignore", "iso-8859-1"],
-    ["ignoreutf", "UTF-8",
-     {1: "todo", 2: "todo", 3: "todo", 4: "todo", 5: "todo", 6: "todo",
-      7: "todo", 8: "todo"}],
-    ["1592880", "iso-8859-1"],
-    ["1695964", "iso-8859-1"],
-    ["1463589", "iso-8859-1"],
-    ["1463589-utf", "UTF-8"],
-    ["IJ", "iso-8859-1"],
-    ["i68568", "iso-8859-1"],
-    ["i68568utf", "UTF-8"],
-    ["1706659", "iso-8859-1"],
-    ["digits-in-words", "iso-8859-1"],
-//    ["colons-in-words", "iso-8859-1"], Suggestion test only
-    ["ngram-utf-fix", "UTF-8"],
-    ["morph", "us-ascii",
-     {11: "todo", 12: "todo", 13: "todo", 14: "todo", 15: "todo", 16: "todo",
-      17: "todo", 18: "todo", 19: "todo", 20: "todo", 21: "todo", 22: "todo",
-      23: "todo", 24: "todo", 25: "todo", 26: "todo", 27: "todo"}],
-    ["1975530", "UTF-8"],
-    ["fullstrip", "iso-8859-1"],
-    ["iconv", "UTF-8"],
-    ["oconv", "UTF-8"],
-    ["encoding", "iso-8859-1", {1: "todo", 3: "todo"}],
-    ["korean", "UTF-8"],
-    ["opentaal-forbiddenword1", "UTF-8"],
-    ["opentaal-forbiddenword2", "UTF-8"],
-    ["opentaal-keepcase", "UTF-8"],
-    ["arabic", "UTF-8"],
-    ["2970240", "iso-8859-1"],
-    ["2970242", "iso-8859-1"],
-    ["breakoff", "iso-8859-1"],
-    ["opentaal-cpdpat", "iso-8859-1"],
-    ["opentaal-cpdpat2", "iso-8859-1"],
-    ["2999225", "iso-8859-1"],
-    ["onlyincompound2", "iso-8859-1"],
-    ["forceucase", "iso-8859-1"],
-    ["warn", "iso-8859-1"]
+  ["affixes", "iso-8859-1"],
+  ["condition", "iso-8859-1"],
+  ["condition-utf", "UTF-8"],
+  ["base", "iso-8859-1"],
+  ["base-utf", "UTF-8"],
+  ["allcaps", "iso-8859-1"],
+  ["allcaps-utf", "UTF-8"],
+  ["allcaps2", "iso-8859-1"],
+  ["allcaps3", "iso-8859-1"],
+  ["keepcase", "iso-8859-1"],
+  ["i58202", "iso-8859-1"],
+  ["map", "iso-8859-1"],
+  ["rep", "iso-8859-1"],
+  ["sug", "iso-8859-1"],
+  ["sugutf", "UTF-8"],
+  ["phone", "iso-8859-1"],
+  ["flag", "iso-8859-1"],
+  ["flaglong", "iso-8859-1"],
+  ["flagnum", "iso-8859-1"],
+  ["flagutf8", "UTF-8"],
+  ["slash", "iso-8859-1"],
+  ["forbiddenword", "iso-8859-1"],
+  ["nosuggest", "iso-8859-1"],
+  ["alias", "iso-8859-1"],
+  ["alias2", "iso-8859-1"],
+  ["alias3", "iso-8859-1"],
+  ["breakdefault", "iso-8859-1"],
+  ["break", "UTF-8"],
+  ["needaffix", "iso-8859-1"],
+  ["needaffix2", "iso-8859-1"],
+  ["needaffix3", "iso-8859-1"],
+  ["needaffix4", "iso-8859-1"],
+  ["needaffix5", "iso-8859-1"],
+  ["circumfix", "iso-8859-1"],
+  ["fogemorpheme", "iso-8859-1"],
+  ["onlyincompound", "iso-8859-1"],
+  ["complexprefixes", "iso-8859-1"],
+  ["complexprefixes2", "iso-8859-1"],
+  ["complexprefixesutf", "UTF-8"],
+  ["conditionalprefix", "iso-8859-1"],
+  ["zeroaffix", "iso-8859-1"],
+  ["utf8", "UTF-8"],
+  ["utf8-bom", "UTF-8", { 1: "todo" }],
+  ["utf8-bom2", "UTF-8", { 1: "todo" }],
+  ["utf8-nonbmp", "UTF-8", { 1: "todo", 2: "todo", 3: "todo", 4: "todo" }],
+  ["compoundflag", "iso-8859-1"],
+  ["compoundrule", "iso-8859-1"],
+  ["compoundrule2", "iso-8859-1"],
+  ["compoundrule3", "iso-8859-1"],
+  ["compoundrule4", "iso-8859-1"],
+  ["compoundrule5", "UTF-8"],
+  ["compoundrule6", "iso-8859-1"],
+  ["compoundrule7", "iso-8859-1"],
+  ["compoundrule8", "iso-8859-1"],
+  ["compoundaffix", "iso-8859-1"],
+  ["compoundaffix2", "iso-8859-1"],
+  ["compoundaffix3", "iso-8859-1"],
+  ["checkcompounddup", "iso-8859-1"],
+  ["checkcompoundtriple", "iso-8859-1"],
+  ["simplifiedtriple", "iso-8859-1"],
+  ["checkcompoundrep", "iso-8859-1"],
+  ["checkcompoundcase2", "iso-8859-1"],
+  ["checkcompoundcaseutf", "UTF-8"],
+  ["checkcompoundpattern", "iso-8859-1"],
+  ["checkcompoundpattern2", "iso-8859-1"],
+  ["checkcompoundpattern3", "iso-8859-1"],
+  ["checkcompoundpattern4", "iso-8859-1"],
+  ["utfcompound", "UTF-8"],
+  ["checksharps", "iso-8859-1"],
+  ["checksharpsutf", "UTF-8"],
+  ["germancompounding", "iso-8859-1"],
+  ["germancompoundingold", "iso-8859-1"],
+  ["i35725", "iso-8859-1"],
+  ["i53643", "iso-8859-1"],
+  ["i54633", "iso-8859-1"],
+  ["i54980", "iso-8859-1", { 1: "todo", 3: "todo" }],
+  ["maputf", "UTF-8"],
+  ["reputf", "UTF-8"],
+  ["ignore", "iso-8859-1"],
+  [
+    "ignoreutf",
+    "UTF-8",
+    {
+      1: "todo",
+      2: "todo",
+      3: "todo",
+      4: "todo",
+      5: "todo",
+      6: "todo",
+      7: "todo",
+      8: "todo",
+    },
+  ],
+  ["1592880", "iso-8859-1"],
+  ["1695964", "iso-8859-1"],
+  ["1463589", "iso-8859-1"],
+  ["1463589-utf", "UTF-8"],
+  ["IJ", "iso-8859-1"],
+  ["i68568", "iso-8859-1"],
+  ["i68568utf", "UTF-8"],
+  ["1706659", "iso-8859-1"],
+  ["digits-in-words", "iso-8859-1"],
+  //    ["colons-in-words", "iso-8859-1"], Suggestion test only
+  ["ngram-utf-fix", "UTF-8"],
+  [
+    "morph",
+    "us-ascii",
+    {
+      11: "todo",
+      12: "todo",
+      13: "todo",
+      14: "todo",
+      15: "todo",
+      16: "todo",
+      17: "todo",
+      18: "todo",
+      19: "todo",
+      20: "todo",
+      21: "todo",
+      22: "todo",
+      23: "todo",
+      24: "todo",
+      25: "todo",
+      26: "todo",
+      27: "todo",
+    },
+  ],
+  ["1975530", "UTF-8"],
+  ["fullstrip", "iso-8859-1"],
+  ["iconv", "UTF-8"],
+  ["oconv", "UTF-8"],
+  ["encoding", "iso-8859-1", { 1: "todo", 3: "todo" }],
+  ["korean", "UTF-8"],
+  ["opentaal-forbiddenword1", "UTF-8"],
+  ["opentaal-forbiddenword2", "UTF-8"],
+  ["opentaal-keepcase", "UTF-8"],
+  ["arabic", "UTF-8"],
+  ["2970240", "iso-8859-1"],
+  ["2970242", "iso-8859-1"],
+  ["breakoff", "iso-8859-1"],
+  ["opentaal-cpdpat", "iso-8859-1"],
+  ["opentaal-cpdpat2", "iso-8859-1"],
+  ["2999225", "iso-8859-1"],
+  ["onlyincompound2", "iso-8859-1"],
+  ["forceucase", "iso-8859-1"],
+  ["warn", "iso-8859-1"],
 ];
 
 function* do_get_file_by_line(file, charset) {
   dump("getting file by line for file " + file.path + "\n");
-  dump("using charset " + charset +"\n");
-  let fis = Cc["@mozilla.org/network/file-input-stream;1"].
-              createInstance(Ci.nsIFileInputStream);
-  fis.init(file, 0x1 /* READONLY */,
-           0o444, Ci.nsIFileInputStream.CLOSE_ON_EOF);
+  dump("using charset " + charset + "\n");
+  let fis = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(
+    Ci.nsIFileInputStream
+  );
+  fis.init(file, 0x1 /* READONLY */, 0o444, Ci.nsIFileInputStream.CLOSE_ON_EOF);
 
-  let lis = Cc["@mozilla.org/intl/converter-input-stream;1"].
-              createInstance(Ci.nsIConverterInputStream);
+  let lis = Cc["@mozilla.org/intl/converter-input-stream;1"].createInstance(
+    Ci.nsIConverterInputStream
+  );
   lis.init(fis, charset, 1024, 0);
   lis.QueryInterface(Ci.nsIUnicharLineInputStream);
 
   var val = {};
   while (lis.readLine(val)) {
     yield val.value;
     val = {};
   }
@@ -147,17 +178,17 @@ function do_run_test(checker, name, char
   if (!checker) {
     do_throw("Need spell checker here!");
   }
 
   let good = do_get_file("data/" + name + ".good", true);
   let bad = do_get_file("data/" + name + ".wrong", true);
   let sug = do_get_file("data/" + name + ".sug", true);
 
-  dump("Need some expected output\n")
+  dump("Need some expected output\n");
   Assert.ok(good.exists() || bad.exists() || sug.exists());
 
   dump("Setting dictionary to " + name + "\n");
   checker.dictionary = name;
 
   if (good.exists()) {
     var good_counter = 0;
     for (val of do_get_file_by_line(good, charset)) {
@@ -191,22 +222,23 @@ function do_run_test(checker, name, char
       if (todo) {
         todo_check_false(checker.check(val));
       } else {
         Assert.ok(!checker.check(val));
       }
     }
   }
 
-    // XXXkhuey test suggestions
+  // XXXkhuey test suggestions
 }
 
 function run_test() {
-  let spellChecker = Cc["@mozilla.org/spellchecker/engine;1"].
-                     getService(Ci.mozISpellCheckingEngine);
+  let spellChecker = Cc["@mozilla.org/spellchecker/engine;1"].getService(
+    Ci.mozISpellCheckingEngine
+  );
 
   Assert.ok(!!spellChecker, "Should have a spell checker");
   spellChecker.QueryInterface(Ci.mozISpellCheckingEngine);
   let testdir = do_get_file("data/", false);
   spellChecker.loadDictionariesFromDir(testdir);
 
   function do_run_test_closure(test) {
     [name, charset, todo_good, todo_bad] = test;
--- a/extensions/spellcheck/hunspell/tests/unit/test_hunspell_unicode_paths.js
+++ b/extensions/spellcheck/hunspell/tests/unit/test_hunspell_unicode_paths.js
@@ -1,34 +1,45 @@
 "use strict";
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-const {OS} = ChromeUtils.import("resource://gre/modules/osfile.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
+const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm");
 
 Cu.importGlobalProperties(["TextEncoder"]);
 
-XPCOMUtils.defineLazyServiceGetter(this, "spellCheck",
-                                   "@mozilla.org/spellchecker/engine;1", "mozISpellCheckingEngine");
+XPCOMUtils.defineLazyServiceGetter(
+  this,
+  "spellCheck",
+  "@mozilla.org/spellchecker/engine;1",
+  "mozISpellCheckingEngine"
+);
 
-const nsFile = Components.Constructor("@mozilla.org/file/local;1", "nsIFile",
-                                      "initWithPath");
+const nsFile = Components.Constructor(
+  "@mozilla.org/file/local;1",
+  "nsIFile",
+  "initWithPath"
+);
 
 add_task(async function() {
   let prof = do_get_profile();
 
   let basePath = OS.Path.join(prof.path, "\u263a", "dictionaries");
   let baseDir = nsFile(basePath);
-  await OS.File.makeDir(basePath, {from: prof.path});
+  await OS.File.makeDir(basePath, { from: prof.path });
 
   let dicPath = OS.Path.join(basePath, "dict.dic");
   let affPath = OS.Path.join(basePath, "dict.aff");
 
   const WORD = "Flehgragh";
 
   await OS.File.writeAtomic(dicPath, new TextEncoder().encode(`1\n${WORD}\n`));
   await OS.File.writeAtomic(affPath, new TextEncoder().encode(""));
 
   spellCheck.loadDictionariesFromDir(baseDir);
   spellCheck.dictionary = "dict";
 
-  ok(spellCheck.check(WORD), "Dictionary should have been loaded from a unicode path");
+  ok(
+    spellCheck.check(WORD),
+    "Dictionary should have been loaded from a unicode path"
+  );
 });
-
--- a/extensions/spellcheck/tests/mochitest/helper_bug1170484.js
+++ b/extensions/spellcheck/tests/mochitest/helper_bug1170484.js
@@ -1,9 +1,9 @@
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // Chrome scripts are run with synchronous messages, so make sure we're completely
 // decoupled from the content process before doing this work.
 Cu.dispatch(function() {
   let chromeWin = Services.ww.activeWindow;
   contextMenu = chromeWin.document.getElementById("contentAreaContextMenu");
   var suggestion = contextMenu.querySelector(".spell-suggestion");
   suggestion.doCommand();
--- a/extensions/universalchardet/tests/CharsetDetectionTests.js
+++ b/extensions/universalchardet/tests/CharsetDetectionTests.js
@@ -1,95 +1,100 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
 /* vim: set ts=8 et sw=4 tw=80: */
 var gExpectedCharset;
 var gOldPref;
 var gDetectorList;
 var gTestIndex;
 var gLocalDir;
 
-function CharsetDetectionTests(aTestFile, aExpectedCharset, aDetectorList)
-{
-    gExpectedCharset = aExpectedCharset;
-    gDetectorList = aDetectorList;
+function CharsetDetectionTests(aTestFile, aExpectedCharset, aDetectorList) {
+  gExpectedCharset = aExpectedCharset;
+  gDetectorList = aDetectorList;
 
-    InitDetectorTests();
+  InitDetectorTests();
 
-    var fileURI = gLocalDir + aTestFile;
-    $("testframe").src = fileURI;
+  var fileURI = gLocalDir + aTestFile;
+  $("testframe").src = fileURI;
 
-    SimpleTest.waitForExplicitFinish();
+  SimpleTest.waitForExplicitFinish();
 }
 
-function InitDetectorTests()
-{
-    var prefService = Cc["@mozilla.org/preferences-service;1"]
-        .getService(Ci.nsIPrefBranch);
-    var str = Cc["@mozilla.org/supports-string;1"]
-        .createInstance(Ci.nsISupportsString);
-    var loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
-        .getService(Ci.mozIJSSubScriptLoader);
-    var ioService = Cc['@mozilla.org/network/io-service;1']
-        .getService(Ci.nsIIOService);
-    loader.loadSubScript("chrome://mochikit/content/chrome-harness.js");
+function InitDetectorTests() {
+  var prefService = Cc["@mozilla.org/preferences-service;1"].getService(
+    Ci.nsIPrefBranch
+  );
+  var str = Cc["@mozilla.org/supports-string;1"].createInstance(
+    Ci.nsISupportsString
+  );
+  var loader = Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(
+    Ci.mozIJSSubScriptLoader
+  );
+  var ioService = Cc["@mozilla.org/network/io-service;1"].getService(
+    Ci.nsIIOService
+  );
+  loader.loadSubScript("chrome://mochikit/content/chrome-harness.js");
 
-    try {
-        gOldPref = prefService
-            .getComplexValue("intl.charset.detector",
-                             Ci.nsIPrefLocalizedString).data;
-    } catch (e) {
-        gOldPref = "";
-    }
-    SetDetectorPref(gDetectorList[0]);
-    gTestIndex = 0;
-    $("testframe").onload = DoDetectionTest;
+  try {
+    gOldPref = prefService.getComplexValue(
+      "intl.charset.detector",
+      Ci.nsIPrefLocalizedString
+    ).data;
+  } catch (e) {
+    gOldPref = "";
+  }
+  SetDetectorPref(gDetectorList[0]);
+  gTestIndex = 0;
+  $("testframe").onload = DoDetectionTest;
 
-    if (gExpectedCharset == "default") {
-        // No point trying to be generic here, because we have plenty of other
-        // unit tests that fail if run using a non-windows-1252 locale.
-        gExpectedCharset = "windows-1252";
-    }
+  if (gExpectedCharset == "default") {
+    // No point trying to be generic here, because we have plenty of other
+    // unit tests that fail if run using a non-windows-1252 locale.
+    gExpectedCharset = "windows-1252";
+  }
 
-    // Get the local directory. This needs to be a file: URI because chrome:
-    // URIs are always UTF-8 (bug 617339) and we are testing decoding from other
-    // charsets.
-    var jar = getJar(getRootDirectory(window.location.href));
-    var dir = jar ?
-                extractJarToTmp(jar) :
-                getChromeDir(getResolvedURI(window.location.href));
-    gLocalDir = ioService.newFileURI(dir).spec;
+  // Get the local directory. This needs to be a file: URI because chrome:
+  // URIs are always UTF-8 (bug 617339) and we are testing decoding from other
+  // charsets.
+  var jar = getJar(getRootDirectory(window.location.href));
+  var dir = jar
+    ? extractJarToTmp(jar)
+    : getChromeDir(getResolvedURI(window.location.href));
+  gLocalDir = ioService.newFileURI(dir).spec;
 }
 
-function SetDetectorPref(aPrefValue)
-{
-    var fallback = "";
-    if (aPrefValue == "ja_parallel_state_machine") {
-        fallback = "Shift_JIS";
-    } else if (aPrefValue == "ruprob" || aPrefValue == "ukprob") {
-        fallback = "windows-1251";
-    }
-    var prefService = Cc["@mozilla.org/preferences-service;1"]
-                      .getService(Ci.nsIPrefBranch);
-    prefService.setStringPref("intl.charset.detector", aPrefValue);
-    prefService.setStringPref("intl.charset.fallback.override", fallback);
-    gCurrentDetector = aPrefValue;
+function SetDetectorPref(aPrefValue) {
+  var fallback = "";
+  if (aPrefValue == "ja_parallel_state_machine") {
+    fallback = "Shift_JIS";
+  } else if (aPrefValue == "ruprob" || aPrefValue == "ukprob") {
+    fallback = "windows-1251";
+  }
+  var prefService = Cc["@mozilla.org/preferences-service;1"].getService(
+    Ci.nsIPrefBranch
+  );
+  prefService.setStringPref("intl.charset.detector", aPrefValue);
+  prefService.setStringPref("intl.charset.fallback.override", fallback);
+  gCurrentDetector = aPrefValue;
 }
 
 function DoDetectionTest() {
-    var iframeDoc = $("testframe").contentDocument;
-    var charset = iframeDoc.characterSet;
-
-    is(charset, gExpectedCharset,
-       "decoded as " + gExpectedCharset + " by " + gDetectorList[gTestIndex]);
+  var iframeDoc = $("testframe").contentDocument;
+  var charset = iframeDoc.characterSet;
 
-    if (++gTestIndex < gDetectorList.length) {
-        SetDetectorPref(gDetectorList[gTestIndex]);
-        iframeDoc.location.reload();
-    } else {
-        CleanUpDetectionTests();
-    }
+  is(
+    charset,
+    gExpectedCharset,
+    "decoded as " + gExpectedCharset + " by " + gDetectorList[gTestIndex]
+  );
+
+  if (++gTestIndex < gDetectorList.length) {
+    SetDetectorPref(gDetectorList[gTestIndex]);
+    iframeDoc.location.reload();
+  } else {
+    CleanUpDetectionTests();
+  }
 }
 
 function CleanUpDetectionTests() {
-    SetDetectorPref(gOldPref);
-    SimpleTest.finish();
+  SetDetectorPref(gOldPref);
+  SimpleTest.finish();
 }
-