Bug 1561435 - Format xpcom/, a=automatic-formatting
authorVictor Porof <vporof@mozilla.com>
Fri, 05 Jul 2019 11:19:37 +0200
changeset 481437 285c79c476cd11b3bcf9f1541d5c8be39b6287fe
parent 481436 b53e2f4066e82af48eb86f80840d4afbcb8d1ad1
child 481438 0e52ffb26be74d2bae4cee9600ea6d6dcd44ed97
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 xpcom/, a=automatic-formatting # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D35945
.eslintrc.js
.prettierignore
xpcom/tests/TestWinReg.js
xpcom/tests/unit/data/child_process_directive_service.js
xpcom/tests/unit/data/main_process_directive_service.js
xpcom/tests/unit/head_xpcom.js
xpcom/tests/unit/test_bug121341.js
xpcom/tests/unit/test_bug1434856.js
xpcom/tests/unit/test_bug325418.js
xpcom/tests/unit/test_bug332389.js
xpcom/tests/unit/test_bug333505.js
xpcom/tests/unit/test_bug364285-1.js
xpcom/tests/unit/test_bug374754.js
xpcom/tests/unit/test_bug476919.js
xpcom/tests/unit/test_bug478086.js
xpcom/tests/unit/test_bug725015.js
xpcom/tests/unit/test_bug745466.js
xpcom/tests/unit/test_file_createUnique.js
xpcom/tests/unit/test_file_equality.js
xpcom/tests/unit/test_file_renameTo.js
xpcom/tests/unit/test_hidden_files.js
xpcom/tests/unit/test_home.js
xpcom/tests/unit/test_iniParser.js
xpcom/tests/unit/test_ioutil.js
xpcom/tests/unit/test_localfile.js
xpcom/tests/unit/test_notxpcom_scriptable.js
xpcom/tests/unit/test_nsIMutableArray.js
xpcom/tests/unit/test_nsIProcess.js
xpcom/tests/unit/test_nsIProcess_stress.js
xpcom/tests/unit/test_pipe.js
xpcom/tests/unit/test_process_directives.js
xpcom/tests/unit/test_seek_multiplex.js
xpcom/tests/unit/test_storagestream.js
xpcom/tests/unit/test_streams.js
xpcom/tests/unit/test_stringstream.js
xpcom/tests/unit/test_symlinks.js
xpcom/tests/unit/test_systemInfo.js
xpcom/tests/unit/test_versioncomparator.js
xpcom/tests/unit/test_windows_cmdline_file.js
xpcom/tests/unit/test_windows_registry.js
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -40,17 +40,16 @@ module.exports = {
     "plugin:mozilla/recommended"
   ],
   "plugins": [
     "mozilla"
   ],
   "overrides": [{
       "files": [
         "devtools/**",
-        "xpcom/**",
         "xpfe/**",
       ],
       "rules": {
         // Temporarily disable the curly everywhere, pending Prettier.
         "curly": "off"
       }
     }, {
       "files": [
--- 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.
-xpcom/**
 xpfe/**
 
 # Ignore all devtools directories for now, except the debugger.
 devtools/client/*.js
 devtools/client/aboutdebugging/**
 devtools/client/aboutdebugging-new/**
 devtools/client/accessibility/**
 devtools/client/application/**
--- a/xpcom/tests/TestWinReg.js
+++ b/xpcom/tests/TestWinReg.js
@@ -5,52 +5,61 @@
 /*
  * This script is intended to be run using xpcshell
  */
 
 const nsIWindowsRegKey = Ci.nsIWindowsRegKey;
 const BASE_PATH = "SOFTWARE\\Mozilla\\Firefox";
 
 function idump(indent, str) {
-  for (var j = 0; j < indent; ++j)
+  for (var j = 0; j < indent; ++j) {
     dump(" ");
+  }
   dump(str);
 }
 
 function list_values(indent, key) {
   idump(indent, "{\n");
   var count = key.valueCount;
   for (var i = 0; i < count; ++i) {
     var vn = key.getValueName(i);
     var val = "";
     if (key.getValueType(vn) == nsIWindowsRegKey.TYPE_STRING) {
       val = key.readStringValue(vn);
     }
-    if (vn == "")
-      idump(indent + 1, "(Default): \"" + val + "\"\n");
-    else
-      idump(indent + 1, vn + ": \"" + val + "\"\n");
+    if (vn == "") {
+      idump(indent + 1, '(Default): "' + val + '"\n');
+    } else {
+      idump(indent + 1, vn + ': "' + val + '"\n');
+    }
   }
   idump(indent, "}\n");
 }
 
 function list_children(indent, key) {
   list_values(indent, key);
 
   var count = key.childCount;
   for (var i = 0; i < count; ++i) {
     var cn = key.getChildName(i);
     idump(indent, "[" + cn + "]\n");
     list_children(indent + 1, key.openChild(cn, nsIWindowsRegKey.ACCESS_READ));
   }
 }
 
 // enumerate everything under BASE_PATH
-var key = Cc["@mozilla.org/windows-registry-key;1"].
-    createInstance(nsIWindowsRegKey);
-key.open(nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE, BASE_PATH,
-         nsIWindowsRegKey.ACCESS_READ);
+var key = Cc["@mozilla.org/windows-registry-key;1"].createInstance(
+  nsIWindowsRegKey
+);
+key.open(
+  nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE,
+  BASE_PATH,
+  nsIWindowsRegKey.ACCESS_READ
+);
 list_children(1, key);
 
 key.close();
-key.open(nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, BASE_PATH,
-         nsIWindowsRegKey.ACCESS_READ);
+key.open(
+  nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
+  BASE_PATH,
+  nsIWindowsRegKey.ACCESS_READ
+);
 list_children(1, key);
--- a/xpcom/tests/unit/data/child_process_directive_service.js
+++ b/xpcom/tests/unit/data/child_process_directive_service.js
@@ -1,16 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
 
 function TestProcessDirective() {}
 TestProcessDirective.prototype = {
-
   /* Boilerplate */
   QueryInterface: ChromeUtils.generateQI([Ci.nsIProperty]),
   contractID: "@mozilla.org/xpcom/tests/ChildProcessDirectiveTest;1",
   classID: Components.ID("{4bd1ba60-45c4-11e4-916c-0800200c9a66}"),
 
   name: "child process",
   value: "some value",
 };
--- a/xpcom/tests/unit/data/main_process_directive_service.js
+++ b/xpcom/tests/unit/data/main_process_directive_service.js
@@ -1,16 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
 
 function TestProcessDirective() {}
 TestProcessDirective.prototype = {
-
   /* Boilerplate */
   QueryInterface: ChromeUtils.generateQI([Ci.nsIProperty]),
   contractID: "@mozilla.org/xpcom/tests/MainProcessDirectiveTest;1",
   classID: Components.ID("{9b6f4160-45be-11e4-916c-0800200c9a66}"),
 
   name: "main process",
   value: "some value",
 };
--- a/xpcom/tests/unit/head_xpcom.js
+++ b/xpcom/tests/unit/head_xpcom.js
@@ -3,20 +3,22 @@ let CC = Components.Constructor;
 function get_test_program(prog) {
   var progPath = do_get_cwd();
   progPath.append(prog);
   progPath.leafName = progPath.leafName + mozinfo.bin_suffix;
   return progPath;
 }
 
 function set_process_running_environment() {
-  var envSvc = Cc["@mozilla.org/process/environment;1"].
-    getService(Ci.nsIEnvironment);
+  var envSvc = Cc["@mozilla.org/process/environment;1"].getService(
+    Ci.nsIEnvironment
+  );
   // Importing Services here messes up appInfo for some of the tests.
   // eslint-disable-next-line mozilla/use-services
-  var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
-    getService(Ci.nsIProperties);
+  var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(
+    Ci.nsIProperties
+  );
   var greBinDir = dirSvc.get("GreBinD", Ci.nsIFile);
   envSvc.set("DYLD_LIBRARY_PATH", greBinDir.path);
   // For Linux
   envSvc.set("LD_LIBRARY_PATH", greBinDir.path);
   // XXX: handle windows
 }
--- a/xpcom/tests/unit/test_bug121341.js
+++ b/xpcom/tests/unit/test_bug121341.js
@@ -1,10 +1,10 @@
-const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function run_test() {
   var dataFile = do_get_file("data/bug121341.properties");
   var channel = NetUtil.newChannel({
     uri: Services.io.newFileURI(dataFile, null, null),
     loadUsingSystemPrincipal: true,
   });
   var inp = channel.open();
@@ -54,11 +54,10 @@ function run_test() {
     loadUsingSystemPrincipal: true,
   });
   inp = channel2.open();
 
   var properties2 = Cu.createPersistentProperties();
   try {
     properties2.load(inp);
     do_throw("load() didn't fail");
-  } catch (e) {
-  }
+  } catch (e) {}
 }
--- a/xpcom/tests/unit/test_bug1434856.js
+++ b/xpcom/tests/unit/test_bug1434856.js
@@ -1,12 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/licenses/publicdomain/  */
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function run_test() {
   let complete = false;
 
   let runnable = {
     internalQI: ChromeUtils.generateQI([Ci.nsIRunnable]),
     // eslint-disable-next-line mozilla/use-chromeutils-generateqi
     QueryInterface(iid) {
--- a/xpcom/tests/unit/test_bug325418.js
+++ b/xpcom/tests/unit/test_bug325418.js
@@ -9,52 +9,64 @@ var timer;
 
 var observer1 = {
   observe: function observeTC1(subject, topic, data) {
     if (topic == "timer-callback") {
       // Stop timer, so it doesn't repeat (if test runs slowly).
       timer.cancel();
 
       // Actual delay may not be exact, so convert to seconds and round.
-      Assert.equal(Math.round((Date.now() - gStartTime1) / 1000),
-                   kExpectedDelay1);
+      Assert.equal(
+        Math.round((Date.now() - gStartTime1) / 1000),
+        kExpectedDelay1
+      );
 
       timer = null;
 
-      info("1st timer triggered (before being cancelled). Should not have happened!");
+      info(
+        "1st timer triggered (before being cancelled). Should not have happened!"
+      );
       Assert.ok(false);
     }
   },
 };
 
 var observer2 = {
   observe: function observeTC2(subject, topic, data) {
     if (topic == "timer-callback") {
       // Stop timer, so it doesn't repeat (if test runs slowly).
       timer.cancel();
 
       // Actual delay may not be exact, so convert to seconds and round.
-      Assert.equal(Math.round((Date.now() - gStartTime2) / 1000),
-                   kExpectedDelay2);
+      Assert.equal(
+        Math.round((Date.now() - gStartTime2) / 1000),
+        kExpectedDelay2
+      );
 
       timer = null;
 
       do_test_finished();
     }
   },
 };
 
 function run_test() {
   do_test_pending();
 
   timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
 
   // Initialize the timer (with some delay), then cancel it.
   gStartTime1 = Date.now();
-  timer.init(observer1, kExpectedDelay1 * 1000,
-             timer.TYPE_REPEATING_PRECISE_CAN_SKIP);
+  timer.init(
+    observer1,
+    kExpectedDelay1 * 1000,
+    timer.TYPE_REPEATING_PRECISE_CAN_SKIP
+  );
   timer.cancel();
 
   // Re-initialize the timer (with a different delay).
   gStartTime2 = Date.now();
-  timer.init(observer2, kExpectedDelay2 * 1000,
-             timer.TYPE_REPEATING_PRECISE_CAN_SKIP);
+  timer.init(
+    observer2,
+    kExpectedDelay2 * 1000,
+    timer.TYPE_REPEATING_PRECISE_CAN_SKIP
+  );
 }
--- a/xpcom/tests/unit/test_bug332389.js
+++ b/xpcom/tests/unit/test_bug332389.js
@@ -1,9 +1,9 @@
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function run_test() {
   var f = Services.dirsvc.get("CurProcD", Ci.nsIFile);
 
   var terminated = false;
   for (var i = 0; i < 100; i++) {
     if (f == null) {
       terminated = true;
--- a/xpcom/tests/unit/test_bug333505.js
+++ b/xpcom/tests/unit/test_bug333505.js
@@ -1,9 +1,10 @@
 function run_test() {
   var dirEntries = do_get_cwd().directoryEntries;
 
-  while (dirEntries.hasMoreElements())
+  while (dirEntries.hasMoreElements()) {
     dirEntries.getNext();
+  }
 
   // We ensure there is no crash
   dirEntries.hasMoreElements();
 }
--- a/xpcom/tests/unit/test_bug364285-1.js
+++ b/xpcom/tests/unit/test_bug364285-1.js
@@ -1,44 +1,45 @@
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var nameArray = [
- "ascii",                                           // ASCII
- "fran\u00E7ais",                                   // Latin-1
- "\u0420\u0443\u0441\u0441\u043A\u0438\u0439",      // Cyrillic
- "\u65E5\u672C\u8A9E",                              // Japanese
- "\u4E2D\u6587",                                    // Chinese
- "\uD55C\uAD6D\uC5B4",                              // Korean
- "\uD801\uDC0F\uD801\uDC2D\uD801\uDC3B\uD801\uDC2B", // Deseret
+  "ascii", // ASCII
+  "fran\u00E7ais", // Latin-1
+  "\u0420\u0443\u0441\u0441\u043A\u0438\u0439", // Cyrillic
+  "\u65E5\u672C\u8A9E", // Japanese
+  "\u4E2D\u6587", // Chinese
+  "\uD55C\uAD6D\uC5B4", // Korean
+  "\uD801\uDC0F\uD801\uDC2D\uD801\uDC3B\uD801\uDC2B", // Deseret
 ];
 
 function getTempDir() {
-    return Services.dirsvc.get("TmpD", Ci.nsIFile);
+  return Services.dirsvc.get("TmpD", Ci.nsIFile);
 }
 
 function create_file(fileName) {
-    var outFile = getTempDir();
-    outFile.append(fileName);
-    outFile.createUnique(outFile.NORMAL_FILE_TYPE, 0o600);
+  var outFile = getTempDir();
+  outFile.append(fileName);
+  outFile.createUnique(outFile.NORMAL_FILE_TYPE, 0o600);
 
-    var stream = Cc["@mozilla.org/network/file-output-stream;1"]
-        .createInstance(Ci.nsIFileOutputStream);
-    stream.init(outFile, 0x02 | 0x08 | 0x20, 0o600, 0);
-    stream.write("foo", 3);
-    stream.close();
+  var stream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(
+    Ci.nsIFileOutputStream
+  );
+  stream.init(outFile, 0x02 | 0x08 | 0x20, 0o600, 0);
+  stream.write("foo", 3);
+  stream.close();
 
-    Assert.equal(outFile.leafName.substr(0, fileName.length), fileName);
+  Assert.equal(outFile.leafName.substr(0, fileName.length), fileName);
 
-    return outFile;
+  return outFile;
 }
 
 function test_create(fileName) {
-    var file1 = create_file(fileName);
-    var file2 = create_file(fileName);
-    file1.remove(false);
-    file2.remove(false);
+  var file1 = create_file(fileName);
+  var file2 = create_file(fileName);
+  file1.remove(false);
+  file2.remove(false);
 }
 
 function run_test() {
-    for (var i = 0; i < nameArray.length; ++i) {
-        test_create(nameArray[i]);
-    }
+  for (var i = 0; i < nameArray.length; ++i) {
+    test_create(nameArray[i]);
+  }
 }
--- a/xpcom/tests/unit/test_bug374754.js
+++ b/xpcom/tests/unit/test_bug374754.js
@@ -1,9 +1,9 @@
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var addedTopic = "xpcom-category-entry-added";
 var removedTopic = "xpcom-category-entry-removed";
 var testCategory = "bug-test-category";
 var testEntry = "@mozilla.org/bug-test-entry;1";
 
 var testValue = "check validity";
 var result = "";
@@ -20,31 +20,48 @@ var observer = {
       Services.obs.removeObserver(this, addedTopic);
       Services.obs.removeObserver(this, removedTopic);
 
       do_test_finished();
 
       timer = null;
     }
 
-    if (subject.QueryInterface(Ci.nsISupportsCString).data != testEntry || data != testCategory)
+    if (
+      subject.QueryInterface(Ci.nsISupportsCString).data != testEntry ||
+      data != testCategory
+    ) {
       return;
+    }
 
-    if (topic == addedTopic)
+    if (topic == addedTopic) {
       result += "add ";
-    else if (topic == removedTopic)
+    } else if (topic == removedTopic) {
       result += "remove ";
+    }
   },
 };
 
 function run_test() {
   do_test_pending();
 
   Services.obs.addObserver(observer, addedTopic);
   Services.obs.addObserver(observer, removedTopic);
 
-  Services.catMan.addCategoryEntry(testCategory, testEntry, testValue, false, true);
-  Services.catMan.addCategoryEntry(testCategory, testEntry, testValue, false, true);
+  Services.catMan.addCategoryEntry(
+    testCategory,
+    testEntry,
+    testValue,
+    false,
+    true
+  );
+  Services.catMan.addCategoryEntry(
+    testCategory,
+    testEntry,
+    testValue,
+    false,
+    true
+  );
   Services.catMan.deleteCategoryEntry(testCategory, testEntry, false);
 
   timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
   timer.init(observer, 0, timer.TYPE_ONE_SHOT);
 }
--- a/xpcom/tests/unit/test_bug476919.js
+++ b/xpcom/tests/unit/test_bug476919.js
@@ -2,25 +2,29 @@
 
 function run_test() {
   // skip this test on Windows
   if (mozinfo.os != "win") {
     var testDir = __LOCATION__.parent;
     // create a test file, then symlink it, then check that we think it's a symlink
     var targetFile = testDir.clone();
     targetFile.append("target.txt");
-    if (!targetFile.exists())
+    if (!targetFile.exists()) {
       targetFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o644);
+    }
 
     var link = testDir.clone();
     link.append("link");
-    if (link.exists())
+    if (link.exists()) {
       link.remove(false);
+    }
 
     var ln = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
     ln.initWithPath("/bin/ln");
-    var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
+    var process = Cc["@mozilla.org/process/util;1"].createInstance(
+      Ci.nsIProcess
+    );
     process.init(ln);
     var args = ["-s", targetFile.path, link.path];
     process.run(true, args, args.length);
     Assert.ok(link.isSymlink());
   }
 }
--- a/xpcom/tests/unit/test_bug478086.js
+++ b/xpcom/tests/unit/test_bug478086.js
@@ -1,15 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/licenses/publicdomain/  */
 
 function run_test() {
   var nsIFile = Ci.nsIFile;
-  var root = Cc["@mozilla.org/file/local;1"].
-              createInstance(nsIFile);
+  var root = Cc["@mozilla.org/file/local;1"].createInstance(nsIFile);
 
   // copied from http://mxr.mozilla.org/mozilla-central/source/image/test/unit/test_imgtools.js#135
   // nsIXULRuntime.OS doesn't seem to be available in xpcshell, so we'll use
   // this as a kludgy way to figure out if we're running on Windows.
   if (mozinfo.os == "win") {
     root.initWithPath("\\\\.");
   } else {
     return; // XXX disabled, since this causes intermittent failures on Mac (bug 481369).
--- a/xpcom/tests/unit/test_bug725015.js
+++ b/xpcom/tests/unit/test_bug725015.js
@@ -1,35 +1,38 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const manifest = do_get_file("bug725015.manifest");
 const contract = "@bug725015.test.contract";
 const observerTopic = "xpcom-category-entry-added";
 const category = "bug725015-test-category";
 const entry = "bug725015-category-entry";
 const cid = Components.ID("{05070380-6e6e-42ba-aaa5-3289fc55ca5a}");
 
 function observe_category(subj, topic, data) {
   try {
     Assert.equal(topic, observerTopic);
-    if (data != category)
+    if (data != category) {
       return;
+    }
 
     var thisentry = subj.QueryInterface(Ci.nsISupportsCString).data;
     Assert.equal(thisentry, entry);
 
     Assert.equal(Services.catMan.getCategoryEntry(category, entry), contract);
     Assert.ok(Cc[contract].equals(cid));
   } catch (e) {
     do_throw(e);
   }
   do_test_finished();
 }
 
 function run_test() {
   do_test_pending();
   Services.obs.addObserver(observe_category, observerTopic);
-  Components.manager.QueryInterface(Ci.nsIComponentRegistrar).autoRegister(manifest);
+  Components.manager
+    .QueryInterface(Ci.nsIComponentRegistrar)
+    .autoRegister(manifest);
 }
--- a/xpcom/tests/unit/test_bug745466.js
+++ b/xpcom/tests/unit/test_bug745466.js
@@ -1,5 +1,7 @@
-const {FileUtils} = ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
+const { FileUtils } = ChromeUtils.import(
+  "resource://gre/modules/FileUtils.jsm"
+);
 
 function run_test() {
   Assert.ok(FileUtils.File("~").equals(FileUtils.getDir("Home", [])));
 }
--- a/xpcom/tests/unit/test_file_createUnique.js
+++ b/xpcom/tests/unit/test_file_createUnique.js
@@ -1,27 +1,31 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function run_test() {
   // Generate a leaf name that is 255 characters long.
   var longLeafName = new Array(256).join("T");
 
   // Generate the path for a file located in a directory with a long name.
   var tempFile = Services.dirsvc.get("TmpD", Ci.nsIFile);
   tempFile.append(longLeafName);
   tempFile.append("test.txt");
 
   try {
     tempFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600);
     do_throw("Creating an item in a folder with a very long name should throw");
   } catch (e) {
-    if (!(e instanceof Ci.nsIException &&
-          e.result == Cr.NS_ERROR_FILE_UNRECOGNIZED_PATH)) {
+    if (
+      !(
+        e instanceof Ci.nsIException &&
+        e.result == Cr.NS_ERROR_FILE_UNRECOGNIZED_PATH
+      )
+    ) {
       throw e;
     }
     // We expect the function not to crash but to raise this exception.
   }
 }
--- a/xpcom/tests/unit/test_file_equality.js
+++ b/xpcom/tests/unit/test_file_equality.js
@@ -1,29 +1,30 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var LocalFile = CC("@mozilla.org/file/local;1", "nsIFile", "initWithPath");
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function run_test() {
   test_normalized_vs_non_normalized();
 }
 
 function test_normalized_vs_non_normalized() {
   // get a directory that exists on all platforms
   var tmp1 = Services.dirsvc.get("TmpD", Ci.nsIFile);
   var exists = tmp1.exists();
   Assert.ok(exists);
-  if (!exists)
+  if (!exists) {
     return;
+  }
 
   // the test logic below assumes we're starting with a normalized path, but the
   // default location on macos is a symbolic link, so resolve it before starting
   tmp1.normalize();
 
   // this has the same exact path as tmp1, it should equal tmp1
   var tmp2 = new LocalFile(tmp1.path);
   Assert.ok(tmp1.equals(tmp2));
--- a/xpcom/tests/unit/test_file_renameTo.js
+++ b/xpcom/tests/unit/test_file_renameTo.js
@@ -1,14 +1,14 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function run_test() {
   // Create the base directory.
   let base = Services.dirsvc.get("TmpD", Ci.nsIFile);
   base.append("renameTesting");
   if (base.exists()) {
     base.remove(true);
   }
--- a/xpcom/tests/unit/test_hidden_files.js
+++ b/xpcom/tests/unit/test_hidden_files.js
@@ -1,26 +1,28 @@
 const NS_OS_TEMP_DIR = "TmpD";
 
 const CWD = do_get_cwd();
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var hiddenUnixFile;
 function createUNIXHiddenFile() {
   var tmpDir = Services.dirsvc.get(NS_OS_TEMP_DIR, Ci.nsIFile);
   hiddenUnixFile = tmpDir.clone();
   hiddenUnixFile.append(".foo");
   // we don't care if this already exists because we don't care
   // about the file's contents (just the name)
-  if (!hiddenUnixFile.exists())
+  if (!hiddenUnixFile.exists()) {
     hiddenUnixFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666);
+  }
   return hiddenUnixFile.exists();
 }
 
 function run_test() {
   // Skip this test on Windows
-  if (mozinfo.os == "win")
+  if (mozinfo.os == "win") {
     return;
+  }
 
   Assert.ok(createUNIXHiddenFile());
   Assert.ok(hiddenUnixFile.isHidden());
 }
--- a/xpcom/tests/unit/test_home.js
+++ b/xpcom/tests/unit/test_home.js
@@ -1,22 +1,23 @@
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const CWD = do_get_cwd();
 function checkOS(os) {
   const nsILocalFile_ = "nsILocalFile" + os;
-  return nsILocalFile_ in Ci &&
-         CWD instanceof Ci[nsILocalFile_];
+  return nsILocalFile_ in Ci && CWD instanceof Ci[nsILocalFile_];
 }
 
 const isWin = checkOS("Win");
 
 function run_test() {
   var envVar = isWin ? "USERPROFILE" : "HOME";
 
   var homeDir = Services.dirsvc.get("Home", Ci.nsIFile);
 
-  var env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
+  var env = Cc["@mozilla.org/process/environment;1"].getService(
+    Ci.nsIEnvironment
+  );
   var expected = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
   expected.initWithPath(env.get(envVar));
 
   Assert.equal(homeDir.path, expected.path);
 }
--- a/xpcom/tests/unit/test_iniParser.js
+++ b/xpcom/tests/unit/test_iniParser.js
@@ -1,305 +1,467 @@
 var testnum = 0;
 var factory;
 
 function parserForFile(filename) {
-    let parser = null;
-    try {
-        let file = do_get_file(filename);
-        Assert.ok(!!file);
-        parser = factory.createINIParser(file);
-        Assert.ok(!!parser);
-    } catch (e) {
-        dump("INFO | caught error: " + e);
-        // checkParserOutput will handle a null parser when it's expected.
-    }
-    return parser;
+  let parser = null;
+  try {
+    let file = do_get_file(filename);
+    Assert.ok(!!file);
+    parser = factory.createINIParser(file);
+    Assert.ok(!!parser);
+  } catch (e) {
+    dump("INFO | caught error: " + e);
+    // checkParserOutput will handle a null parser when it's expected.
+  }
+  return parser;
 }
 
 function checkParserOutput(parser, expected) {
-    // If the expected output is null, we expect the parser to have
-    // failed (and vice-versa).
-    if (!parser || !expected) {
-        Assert.equal(parser, null);
-        Assert.equal(expected, null);
-        return;
-    }
+  // If the expected output is null, we expect the parser to have
+  // failed (and vice-versa).
+  if (!parser || !expected) {
+    Assert.equal(parser, null);
+    Assert.equal(expected, null);
+    return;
+  }
 
-    let output = getParserOutput(parser);
-    for (let section in expected) {
-        Assert.ok(section in output);
-        for (let key in expected[section]) {
-            Assert.ok(key in output[section]);
-            Assert.equal(output[section][key], expected[section][key]);
-            delete output[section][key];
-        }
-        for (let key in output[section])
-            Assert.equal(key, "wasn't expecting this key!");
-        delete output[section];
+  let output = getParserOutput(parser);
+  for (let section in expected) {
+    Assert.ok(section in output);
+    for (let key in expected[section]) {
+      Assert.ok(key in output[section]);
+      Assert.equal(output[section][key], expected[section][key]);
+      delete output[section][key];
     }
-    for (let section in output)
-        Assert.equal(section, "wasn't expecting this section!");
+    for (let key in output[section]) {
+      Assert.equal(key, "wasn't expecting this key!");
+    }
+    delete output[section];
+  }
+  for (let section in output) {
+    Assert.equal(section, "wasn't expecting this section!");
+  }
 }
 
 function getParserOutput(parser) {
-    let output = {};
+  let output = {};
 
-    for (let section of parser.getSections()) {
-        Assert.equal(false, section in output); // catch dupes
-        output[section] = {};
+  for (let section of parser.getSections()) {
+    Assert.equal(false, section in output); // catch dupes
+    output[section] = {};
 
-        for (let key of parser.getKeys(section)) {
-            Assert.equal(false, key in output[section]); // catch dupes
-            let value = parser.getString(section, key);
-            output[section][key] = value;
-        }
+    for (let key of parser.getKeys(section)) {
+      Assert.equal(false, key in output[section]); // catch dupes
+      let value = parser.getString(section, key);
+      output[section][key] = value;
     }
-    return output;
+  }
+  return output;
 }
 
 function run_test() {
-try {
-var testdata = [
-    { filename: "data/iniparser01.ini", reference: {} },
-    { filename: "data/iniparser02.ini", reference: {} },
-    { filename: "data/iniparser03.ini", reference: {} },
-    { filename: "data/iniparser04.ini", reference: {} },
-    { filename: "data/iniparser05.ini", reference: {} },
-    { filename: "data/iniparser06.ini", reference: {} },
-    { filename: "data/iniparser07.ini", reference: {} },
-    { filename: "data/iniparser08.ini", reference: { section1: { name1: "" }} },
-    { filename: "data/iniparser09.ini", reference: { section1: { name1: "value1" } } },
-    { filename: "data/iniparser10.ini", reference: { section1: { name1: "value1" } } },
-    { filename: "data/iniparser11.ini", reference: { section1: { name1: "value1" } } },
-    { filename: "data/iniparser12.ini", reference: { section1: { name1: "value1" } } },
-    { filename: "data/iniparser13.ini", reference: { section1: { name1: "value1" } } },
-    { filename: "data/iniparser14.ini", reference:
-                    { section1: { name1: "value1", name2: "value2" },
-                      section2: { name1: "value1", name2: "foopy"  }} },
-    { filename: "data/iniparser15.ini", reference:
-                    { section1: { name1: "newValue1" },
-                      section2: { name1: "foopy"     }} },
-    { filename: "data/iniparser16.ini", reference:
-                    { "☺♫": { "♫": "☻", "♪": "♥"  },
-                       "☼": { "♣": "♠", "♦": "♥"  }} },
-    { filename: "data/iniparser17.ini", reference: { section: { key: "" } } },
+  try {
+    var testdata = [
+      { filename: "data/iniparser01.ini", reference: {} },
+      { filename: "data/iniparser02.ini", reference: {} },
+      { filename: "data/iniparser03.ini", reference: {} },
+      { filename: "data/iniparser04.ini", reference: {} },
+      { filename: "data/iniparser05.ini", reference: {} },
+      { filename: "data/iniparser06.ini", reference: {} },
+      { filename: "data/iniparser07.ini", reference: {} },
+      {
+        filename: "data/iniparser08.ini",
+        reference: { section1: { name1: "" } },
+      },
+      {
+        filename: "data/iniparser09.ini",
+        reference: { section1: { name1: "value1" } },
+      },
+      {
+        filename: "data/iniparser10.ini",
+        reference: { section1: { name1: "value1" } },
+      },
+      {
+        filename: "data/iniparser11.ini",
+        reference: { section1: { name1: "value1" } },
+      },
+      {
+        filename: "data/iniparser12.ini",
+        reference: { section1: { name1: "value1" } },
+      },
+      {
+        filename: "data/iniparser13.ini",
+        reference: { section1: { name1: "value1" } },
+      },
+      {
+        filename: "data/iniparser14.ini",
+        reference: {
+          section1: { name1: "value1", name2: "value2" },
+          section2: { name1: "value1", name2: "foopy" },
+        },
+      },
+      {
+        filename: "data/iniparser15.ini",
+        reference: {
+          section1: { name1: "newValue1" },
+          section2: { name1: "foopy" },
+        },
+      },
+      {
+        filename: "data/iniparser16.ini",
+        reference: {
+          "☺♫": { "♫": "☻", "♪": "♥" },
+          "☼": { "♣": "♠", "♦": "♥" },
+        },
+      },
+      { filename: "data/iniparser17.ini", reference: { section: { key: "" } } },
     ];
 
-    testdata.push( { filename: "data/iniparser01-utf8BOM.ini",
-                     reference: testdata[0].reference } );
-    testdata.push( { filename: "data/iniparser02-utf8BOM.ini",
-                     reference: testdata[1].reference } );
-    testdata.push( { filename: "data/iniparser03-utf8BOM.ini",
-                     reference: testdata[2].reference } );
-    testdata.push( { filename: "data/iniparser04-utf8BOM.ini",
-                     reference: testdata[3].reference } );
-    testdata.push( { filename: "data/iniparser05-utf8BOM.ini",
-                     reference: testdata[4].reference } );
-    testdata.push( { filename: "data/iniparser06-utf8BOM.ini",
-                     reference: testdata[5].reference } );
-    testdata.push( { filename: "data/iniparser07-utf8BOM.ini",
-                     reference: testdata[6].reference } );
-    testdata.push( { filename: "data/iniparser08-utf8BOM.ini",
-                     reference: testdata[7].reference } );
-    testdata.push( { filename: "data/iniparser09-utf8BOM.ini",
-                     reference: testdata[8].reference } );
-    testdata.push( { filename: "data/iniparser10-utf8BOM.ini",
-                     reference: testdata[9].reference } );
-    testdata.push( { filename: "data/iniparser11-utf8BOM.ini",
-                     reference: testdata[10].reference } );
-    testdata.push( { filename: "data/iniparser12-utf8BOM.ini",
-                     reference: testdata[11].reference } );
-    testdata.push( { filename: "data/iniparser13-utf8BOM.ini",
-                     reference: testdata[12].reference } );
-    testdata.push( { filename: "data/iniparser14-utf8BOM.ini",
-                     reference: testdata[13].reference } );
-    testdata.push( { filename: "data/iniparser15-utf8BOM.ini",
-                     reference: testdata[14].reference } );
-    testdata.push( { filename: "data/iniparser16-utf8BOM.ini",
-                     reference: testdata[15].reference } );
+    testdata.push({
+      filename: "data/iniparser01-utf8BOM.ini",
+      reference: testdata[0].reference,
+    });
+    testdata.push({
+      filename: "data/iniparser02-utf8BOM.ini",
+      reference: testdata[1].reference,
+    });
+    testdata.push({
+      filename: "data/iniparser03-utf8BOM.ini",
+      reference: testdata[2].reference,
+    });
+    testdata.push({
+      filename: "data/iniparser04-utf8BOM.ini",
+      reference: testdata[3].reference,
+    });
+    testdata.push({
+      filename: "data/iniparser05-utf8BOM.ini",
+      reference: testdata[4].reference,
+    });
+    testdata.push({
+      filename: "data/iniparser06-utf8BOM.ini",
+      reference: testdata[5].reference,
+    });
+    testdata.push({
+      filename: "data/iniparser07-utf8BOM.ini",
+      reference: testdata[6].reference,
+    });
+    testdata.push({
+      filename: "data/iniparser08-utf8BOM.ini",
+      reference: testdata[7].reference,
+    });
+    testdata.push({
+      filename: "data/iniparser09-utf8BOM.ini",
+      reference: testdata[8].reference,
+    });
+    testdata.push({
+      filename: "data/iniparser10-utf8BOM.ini",
+      reference: testdata[9].reference,
+    });
+    testdata.push({
+      filename: "data/iniparser11-utf8BOM.ini",
+      reference: testdata[10].reference,
+    });
+    testdata.push({
+      filename: "data/iniparser12-utf8BOM.ini",
+      reference: testdata[11].reference,
+    });
+    testdata.push({
+      filename: "data/iniparser13-utf8BOM.ini",
+      reference: testdata[12].reference,
+    });
+    testdata.push({
+      filename: "data/iniparser14-utf8BOM.ini",
+      reference: testdata[13].reference,
+    });
+    testdata.push({
+      filename: "data/iniparser15-utf8BOM.ini",
+      reference: testdata[14].reference,
+    });
+    testdata.push({
+      filename: "data/iniparser16-utf8BOM.ini",
+      reference: testdata[15].reference,
+    });
 
     // Intentional test for appInfo that can't be preloaded.
     // eslint-disable-next-line mozilla/use-services
-    let os = Cc["@mozilla.org/xre/app-info;1"]
-             .getService(Ci.nsIXULRuntime).OS;
+    let os = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS;
     if ("WINNT" === os) {
-        testdata.push( { filename: "data/iniparser01-utf16leBOM.ini",
-                         reference: testdata[0].reference } );
-        testdata.push( { filename: "data/iniparser02-utf16leBOM.ini",
-                         reference: testdata[1].reference } );
-        testdata.push( { filename: "data/iniparser03-utf16leBOM.ini",
-                         reference: testdata[2].reference } );
-        testdata.push( { filename: "data/iniparser04-utf16leBOM.ini",
-                         reference: testdata[3].reference } );
-        testdata.push( { filename: "data/iniparser05-utf16leBOM.ini",
-                         reference: testdata[4].reference } );
-        testdata.push( { filename: "data/iniparser06-utf16leBOM.ini",
-                         reference: testdata[5].reference } );
-        testdata.push( { filename: "data/iniparser07-utf16leBOM.ini",
-                         reference: testdata[6].reference } );
-        testdata.push( { filename: "data/iniparser08-utf16leBOM.ini",
-                         reference: testdata[7].reference } );
-        testdata.push( { filename: "data/iniparser09-utf16leBOM.ini",
-                         reference: testdata[8].reference } );
-        testdata.push( { filename: "data/iniparser10-utf16leBOM.ini",
-                         reference: testdata[9].reference } );
-        testdata.push( { filename: "data/iniparser11-utf16leBOM.ini",
-                         reference: testdata[10].reference } );
-        testdata.push( { filename: "data/iniparser12-utf16leBOM.ini",
-                         reference: testdata[11].reference } );
-        testdata.push( { filename: "data/iniparser13-utf16leBOM.ini",
-                         reference: testdata[12].reference } );
-        testdata.push( { filename: "data/iniparser14-utf16leBOM.ini",
-                         reference: testdata[13].reference } );
-        testdata.push( { filename: "data/iniparser15-utf16leBOM.ini",
-                         reference: testdata[14].reference } );
-        testdata.push( { filename: "data/iniparser16-utf16leBOM.ini",
-                         reference: testdata[15].reference } );
+      testdata.push({
+        filename: "data/iniparser01-utf16leBOM.ini",
+        reference: testdata[0].reference,
+      });
+      testdata.push({
+        filename: "data/iniparser02-utf16leBOM.ini",
+        reference: testdata[1].reference,
+      });
+      testdata.push({
+        filename: "data/iniparser03-utf16leBOM.ini",
+        reference: testdata[2].reference,
+      });
+      testdata.push({
+        filename: "data/iniparser04-utf16leBOM.ini",
+        reference: testdata[3].reference,
+      });
+      testdata.push({
+        filename: "data/iniparser05-utf16leBOM.ini",
+        reference: testdata[4].reference,
+      });
+      testdata.push({
+        filename: "data/iniparser06-utf16leBOM.ini",
+        reference: testdata[5].reference,
+      });
+      testdata.push({
+        filename: "data/iniparser07-utf16leBOM.ini",
+        reference: testdata[6].reference,
+      });
+      testdata.push({
+        filename: "data/iniparser08-utf16leBOM.ini",
+        reference: testdata[7].reference,
+      });
+      testdata.push({
+        filename: "data/iniparser09-utf16leBOM.ini",
+        reference: testdata[8].reference,
+      });
+      testdata.push({
+        filename: "data/iniparser10-utf16leBOM.ini",
+        reference: testdata[9].reference,
+      });
+      testdata.push({
+        filename: "data/iniparser11-utf16leBOM.ini",
+        reference: testdata[10].reference,
+      });
+      testdata.push({
+        filename: "data/iniparser12-utf16leBOM.ini",
+        reference: testdata[11].reference,
+      });
+      testdata.push({
+        filename: "data/iniparser13-utf16leBOM.ini",
+        reference: testdata[12].reference,
+      });
+      testdata.push({
+        filename: "data/iniparser14-utf16leBOM.ini",
+        reference: testdata[13].reference,
+      });
+      testdata.push({
+        filename: "data/iniparser15-utf16leBOM.ini",
+        reference: testdata[14].reference,
+      });
+      testdata.push({
+        filename: "data/iniparser16-utf16leBOM.ini",
+        reference: testdata[15].reference,
+      });
     }
 
-/* ========== 0 ========== */
-factory = Cc["@mozilla.org/xpcom/ini-parser-factory;1"].
-          getService(Ci.nsIINIParserFactory);
-Assert.ok(!!factory);
+    /* ========== 0 ========== */
+    factory = Cc["@mozilla.org/xpcom/ini-parser-factory;1"].getService(
+      Ci.nsIINIParserFactory
+    );
+    Assert.ok(!!factory);
+
+    // Test reading from a variety of files. While we're at it, write out each one
+    // and read it back to ensure that nothing changed.
+    while (testnum < testdata.length) {
+      dump("\nINFO | test #" + ++testnum);
+      let filename = testdata[testnum - 1].filename;
+      dump(", filename " + filename + "\n");
+      let parser = parserForFile(filename);
+      checkParserOutput(parser, testdata[testnum - 1].reference);
+      if (!parser) {
+        continue;
+      }
+      Assert.ok(parser instanceof Ci.nsIINIParserWriter);
+      // write contents out to a new file
+      let newfilename = filename + ".new";
+      let newfile = do_get_file(filename);
+      newfile.leafName += ".new";
+      parser.writeFile(newfile);
+      // read new file and make sure the contents are the same.
+      parser = parserForFile(newfilename);
+      checkParserOutput(parser, testdata[testnum - 1].reference);
+      // cleanup after the test
+      newfile.remove(false);
+    }
+
+    dump("INFO | test #" + ++testnum + "\n");
 
-// Test reading from a variety of files. While we're at it, write out each one
-// and read it back to ensure that nothing changed.
-while (testnum < testdata.length) {
-    dump("\nINFO | test #" + ++testnum);
-    let filename = testdata[testnum - 1].filename;
-    dump(", filename " + filename + "\n");
-    let parser = parserForFile(filename);
-    checkParserOutput(parser, testdata[testnum - 1].reference);
-    if (!parser)
-        continue;
+    // test writing to a new file.
+    var newfile = do_get_file("data/");
+    newfile.append("nonexistent-file.ini");
+    if (newfile.exists()) {
+      newfile.remove(false);
+    }
+    Assert.ok(!newfile.exists());
+
+    try {
+      var parser = factory.createINIParser(newfile);
+      Assert.ok(false, "Should have thrown an exception");
+    } catch (e) {
+      Assert.equal(
+        e.result,
+        Cr.NS_ERROR_FILE_NOT_FOUND,
+        "Caught a file not found exception"
+      );
+    }
+    parser = factory.createINIParser();
+    Assert.ok(!!parser);
     Assert.ok(parser instanceof Ci.nsIINIParserWriter);
-    // write contents out to a new file
-    let newfilename = filename + ".new";
-    let newfile = do_get_file(filename);
-    newfile.leafName += ".new";
+    checkParserOutput(parser, {});
     parser.writeFile(newfile);
-    // read new file and make sure the contents are the same.
-    parser = parserForFile(newfilename);
-    checkParserOutput(parser, testdata[testnum - 1].reference);
+    Assert.ok(newfile.exists());
+
+    // test adding a new section and new key
+    parser.setString("section", "key", "value");
+    parser.setString("section", "key2", "");
+    parser.writeFile(newfile);
+    Assert.ok(newfile.exists());
+    checkParserOutput(parser, { section: { key: "value", key2: "" } });
+    // read it in again, check for same data.
+    parser = parserForFile("data/nonexistent-file.ini");
+    checkParserOutput(parser, { section: { key: "value", key2: "" } });
     // cleanup after the test
     newfile.remove(false);
-}
 
-dump("INFO | test #" + ++testnum + "\n");
+    dump("INFO | test #" + ++testnum + "\n");
 
-// test writing to a new file.
-var newfile = do_get_file("data/");
-newfile.append("nonexistent-file.ini");
-if (newfile.exists())
-    newfile.remove(false);
-Assert.ok(!newfile.exists());
+    // test modifying a existing key's value (in an existing section)
+    parser = parserForFile("data/iniparser09.ini");
+    checkParserOutput(parser, { section1: { name1: "value1" } });
 
-try {
-    var parser = factory.createINIParser(newfile);
-    Assert.ok(false, "Should have thrown an exception");
-} catch (e) {
-    Assert.equal(e.result, Cr.NS_ERROR_FILE_NOT_FOUND, "Caught a file not found exception");
-}
-parser = factory.createINIParser();
-Assert.ok(!!parser);
-Assert.ok(parser instanceof Ci.nsIINIParserWriter);
-checkParserOutput(parser, {});
-parser.writeFile(newfile);
-Assert.ok(newfile.exists());
+    Assert.ok(parser instanceof Ci.nsIINIParserWriter);
+    parser.setString("section1", "name1", "value2");
+    checkParserOutput(parser, { section1: { name1: "value2" } });
+
+    dump("INFO | test #" + ++testnum + "\n");
+
+    // test trying to set illegal characters
+    var caughtError;
+    caughtError = null;
+    checkParserOutput(parser, { section1: { name1: "value2" } });
 
-// test adding a new section and new key
-parser.setString("section", "key", "value");
-parser.setString("section", "key2", "");
-parser.writeFile(newfile);
-Assert.ok(newfile.exists());
-checkParserOutput(parser, {section: {key: "value", key2: ""} });
-// read it in again, check for same data.
-parser = parserForFile("data/nonexistent-file.ini");
-checkParserOutput(parser, {section: {key: "value", key2: ""} });
-// cleanup after the test
-newfile.remove(false);
-
-dump("INFO | test #" + ++testnum + "\n");
-
-// test modifying a existing key's value (in an existing section)
-parser = parserForFile("data/iniparser09.ini");
-checkParserOutput(parser, {section1: {name1: "value1"} });
-
-Assert.ok(parser instanceof Ci.nsIINIParserWriter);
-parser.setString("section1", "name1", "value2");
-checkParserOutput(parser, {section1: {name1: "value2"} });
-
-dump("INFO | test #" + ++testnum + "\n");
-
-// test trying to set illegal characters
-var caughtError;
-caughtError = null;
-checkParserOutput(parser, {section1: {name1: "value2"} });
+    // Bad characters in section name
+    try {
+      parser.setString("bad\0", "ok", "ok");
+    } catch (e) {
+      caughtError = e;
+    }
+    Assert.ok(caughtError);
+    Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
+    caughtError = null;
+    try {
+      parser.setString("bad\r", "ok", "ok");
+    } catch (e) {
+      caughtError = e;
+    }
+    Assert.ok(caughtError);
+    Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
+    caughtError = null;
+    try {
+      parser.setString("bad\n", "ok", "ok");
+    } catch (e) {
+      caughtError = e;
+    }
+    Assert.ok(caughtError);
+    Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
+    caughtError = null;
+    try {
+      parser.setString("bad[", "ok", "ok");
+    } catch (e) {
+      caughtError = e;
+    }
+    Assert.ok(caughtError);
+    Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
+    caughtError = null;
+    try {
+      parser.setString("bad]", "ok", "ok");
+    } catch (e) {
+      caughtError = e;
+    }
+    Assert.ok(caughtError);
+    Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
+    caughtError = null;
+    try {
+      parser.setString("", "ok", "ok");
+    } catch (e) {
+      caughtError = e;
+    }
+    Assert.ok(caughtError);
+    Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
 
-// Bad characters in section name
-try { parser.setString("bad\0", "ok", "ok"); } catch (e) { caughtError = e; }
-Assert.ok(caughtError);
-Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
-caughtError = null;
-try { parser.setString("bad\r", "ok", "ok"); } catch (e) { caughtError = e; }
-Assert.ok(caughtError);
-Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
-caughtError = null;
-try { parser.setString("bad\n", "ok", "ok"); } catch (e) { caughtError = e; }
-Assert.ok(caughtError);
-Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
-caughtError = null;
-try { parser.setString("bad[", "ok", "ok"); } catch (e) { caughtError = e; }
-Assert.ok(caughtError);
-Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
-caughtError = null;
-try { parser.setString("bad]", "ok", "ok"); } catch (e) { caughtError = e; }
-Assert.ok(caughtError);
-Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
-caughtError = null;
-try { parser.setString("", "ok", "ok"); } catch (e) { caughtError = e; }
-Assert.ok(caughtError);
-Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
+    // Bad characters in key name
+    caughtError = null;
+    try {
+      parser.setString("ok", "bad\0", "ok");
+    } catch (e) {
+      caughtError = e;
+    }
+    Assert.ok(caughtError);
+    Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
+    caughtError = null;
+    try {
+      parser.setString("ok", "bad\r", "ok");
+    } catch (e) {
+      caughtError = e;
+    }
+    Assert.ok(caughtError);
+    Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
+    caughtError = null;
+    try {
+      parser.setString("ok", "bad\n", "ok");
+    } catch (e) {
+      caughtError = e;
+    }
+    Assert.ok(caughtError);
+    Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
+    caughtError = null;
+    try {
+      parser.setString("ok", "bad=", "ok");
+    } catch (e) {
+      caughtError = e;
+    }
+    Assert.ok(caughtError);
+    Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
+    caughtError = null;
+    try {
+      parser.setString("ok", "", "ok");
+    } catch (e) {
+      caughtError = e;
+    }
+    Assert.ok(caughtError);
+    Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
 
-// Bad characters in key name
-caughtError = null;
-try { parser.setString("ok", "bad\0", "ok"); } catch (e) { caughtError = e; }
-Assert.ok(caughtError);
-Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
-caughtError = null;
-try { parser.setString("ok", "bad\r", "ok"); } catch (e) { caughtError = e; }
-Assert.ok(caughtError);
-Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
-caughtError = null;
-try { parser.setString("ok", "bad\n", "ok"); } catch (e) { caughtError = e; }
-Assert.ok(caughtError);
-Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
-caughtError = null;
-try { parser.setString("ok", "bad=", "ok"); } catch (e) { caughtError = e; }
-Assert.ok(caughtError);
-Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
-caughtError = null;
-try { parser.setString("ok", "", "ok"); } catch (e) { caughtError = e; }
-Assert.ok(caughtError);
-Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
-
-// Bad characters in value
-caughtError = null;
-try { parser.setString("ok", "ok", "bad\0"); } catch (e) { caughtError = e; }
-Assert.ok(caughtError);
-Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
-caughtError = null;
-try { parser.setString("ok", "ok", "bad\r"); } catch (e) { caughtError = e; }
-Assert.ok(caughtError);
-Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
-caughtError = null;
-try { parser.setString("ok", "ok", "bad\n"); } catch (e) { caughtError = e; }
-Assert.ok(caughtError);
-Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
-caughtError = null;
-try { parser.setString("ok", "ok", "good="); } catch (e) { caughtError = e; }
-Assert.ok(!caughtError);
-caughtError = null;
-} catch (e) {
+    // Bad characters in value
+    caughtError = null;
+    try {
+      parser.setString("ok", "ok", "bad\0");
+    } catch (e) {
+      caughtError = e;
+    }
+    Assert.ok(caughtError);
+    Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
+    caughtError = null;
+    try {
+      parser.setString("ok", "ok", "bad\r");
+    } catch (e) {
+      caughtError = e;
+    }
+    Assert.ok(caughtError);
+    Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
+    caughtError = null;
+    try {
+      parser.setString("ok", "ok", "bad\n");
+    } catch (e) {
+      caughtError = e;
+    }
+    Assert.ok(caughtError);
+    Assert.equal(caughtError.result, Cr.NS_ERROR_INVALID_ARG);
+    caughtError = null;
+    try {
+      parser.setString("ok", "ok", "good=");
+    } catch (e) {
+      caughtError = e;
+    }
+    Assert.ok(!caughtError);
+    caughtError = null;
+  } catch (e) {
     throw new Error(`FAILED in test #${testnum} -- ${e}`);
+  }
 }
-}
--- a/xpcom/tests/unit/test_ioutil.js
+++ b/xpcom/tests/unit/test_ioutil.js
@@ -1,28 +1,29 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const util = Cc["@mozilla.org/io-util;1"].getService(Ci.nsIIOUtil);
 
 function run_test() {
-    try {
-        util.inputStreamIsBuffered(null);
-        do_throw("inputStreamIsBuffered should have thrown");
-    } catch (e) {
-        Assert.equal(e.result, Cr.NS_ERROR_INVALID_POINTER);
-    }
+  try {
+    util.inputStreamIsBuffered(null);
+    do_throw("inputStreamIsBuffered should have thrown");
+  } catch (e) {
+    Assert.equal(e.result, Cr.NS_ERROR_INVALID_POINTER);
+  }
 
-    try {
-        util.outputStreamIsBuffered(null);
-        do_throw("outputStreamIsBuffered should have thrown");
-    } catch (e) {
-        Assert.equal(e.result, Cr.NS_ERROR_INVALID_POINTER);
-    }
+  try {
+    util.outputStreamIsBuffered(null);
+    do_throw("outputStreamIsBuffered should have thrown");
+  } catch (e) {
+    Assert.equal(e.result, Cr.NS_ERROR_INVALID_POINTER);
+  }
 
-    var s = Cc["@mozilla.org/io/string-input-stream;1"]
-              .createInstance(Ci.nsIStringInputStream);
-    var body = "This is a test";
-    s.setData(body, body.length);
-    Assert.equal(util.inputStreamIsBuffered(s), true);
+  var s = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(
+    Ci.nsIStringInputStream
+  );
+  var body = "This is a test";
+  s.setData(body, body.length);
+  Assert.equal(util.inputStreamIsBuffered(s), true);
 }
--- a/xpcom/tests/unit/test_localfile.js
+++ b/xpcom/tests/unit/test_localfile.js
@@ -1,16 +1,16 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const MAX_TIME_DIFFERENCE = 2500;
-const MILLIS_PER_DAY      = 1000 * 60 * 60 * 24;
+const MILLIS_PER_DAY = 1000 * 60 * 60 * 24;
 
 var LocalFile = CC("@mozilla.org/file/local;1", "nsIFile", "initWithPath");
 
 function run_test() {
   test_toplevel_parent_is_null();
   test_normalize_crash_if_media_missing();
   test_file_modification_time();
   test_directory_modification_time();
@@ -33,29 +33,29 @@ function test_toplevel_parent_is_null() 
 }
 
 function test_normalize_crash_if_media_missing() {
   const a = "a".charCodeAt(0);
   const z = "z".charCodeAt(0);
   for (var i = a; i <= z; ++i) {
     try {
       LocalFile(String.fromCharCode(i) + ":.\\test").normalize();
-    } catch (e) {
-    }
+    } catch (e) {}
   }
 }
 
 // Tests that changing a file's modification time is possible
 function test_file_modification_time() {
   var file = do_get_profile();
   file.append("testfile");
 
   // Should never happen but get rid of it anyway
-  if (file.exists())
+  if (file.exists()) {
     file.remove(true);
+  }
 
   var now = Date.now();
   file.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o644);
   Assert.ok(file.exists());
 
   // Modification time may be out by up to 2 seconds on FAT filesystems. Test
   // with a bit of leeway, close enough probably means it is correct.
   var diff = Math.abs(file.lastModifiedTime - now);
@@ -83,18 +83,19 @@ function test_file_modification_time() {
 }
 
 // Tests that changing a directory's modification time is possible
 function test_directory_modification_time() {
   var dir = do_get_profile();
   dir.append("testdir");
 
   // Should never happen but get rid of it anyway
-  if (dir.exists())
+  if (dir.exists()) {
     dir.remove(true);
+  }
 
   var now = Date.now();
   dir.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755);
   Assert.ok(dir.exists());
 
   // Modification time may be out by up to 2 seconds on FAT filesystems. Test
   // with a bit of leeway, close enough probably means it is correct.
   var diff = Math.abs(dir.lastModifiedTime - now);
@@ -118,17 +119,18 @@ function test_directory_modification_tim
 function test_diskSpaceAvailable() {
   let file = do_get_profile();
   file.QueryInterface(Ci.nsIFile);
 
   let bytes = file.diskSpaceAvailable;
   Assert.ok(bytes > 0);
 
   file.append("testfile");
-  if (file.exists())
+  if (file.exists()) {
     file.remove(true);
+  }
   file.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o644);
 
   bytes = file.diskSpaceAvailable;
   Assert.ok(bytes > 0);
 
   file.remove(true);
 }
--- a/xpcom/tests/unit/test_notxpcom_scriptable.js
+++ b/xpcom/tests/unit/test_notxpcom_scriptable.js
@@ -9,18 +9,20 @@ const kContract = "@testing/notxpcomtest
 function run_test() {
   let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
 
   ok(Ci.nsIScriptableWithNotXPCOM);
 
   let method1Called = false;
 
   let testObject = {
-    QueryInterface: ChromeUtils.generateQI([Ci.nsIScriptableOK,
-                                            Ci.nsIScriptableWithNotXPCOM]),
+    QueryInterface: ChromeUtils.generateQI([
+      Ci.nsIScriptableOK,
+      Ci.nsIScriptableWithNotXPCOM,
+    ]),
 
     method1() {
       method1Called = true;
     },
 
     method2() {
       ok(false, "method2 should not have been called!");
     },
@@ -53,12 +55,16 @@ function run_test() {
 
   xpcomObject.method1();
   ok(method1Called);
 
   try {
     xpcomObject.QueryInterface(Ci.nsIScriptableWithNotXPCOM);
     ok(false, "Should not have implemented nsIScriptableWithNotXPCOM");
   } catch (e) {
-    ok(true, "Should not have implemented nsIScriptableWithNotXPCOM. Correctly threw error: " + e);
+    ok(
+      true,
+      "Should not have implemented nsIScriptableWithNotXPCOM. Correctly threw error: " +
+        e
+    );
   }
   strictEqual(xpcomObject.method2, undefined);
 }
--- a/xpcom/tests/unit/test_nsIMutableArray.js
+++ b/xpcom/tests/unit/test_nsIMutableArray.js
@@ -120,11 +120,12 @@ var tests = [
   test_insert_at_beginning,
   test_replace_element,
   test_clear,
   test_enumerate,
   test_nsiarrayextensions,
 ];
 
 function run_test() {
-  for (var i = 0; i < tests.length; i++)
+  for (var i = 0; i < tests.length; i++) {
     tests[i]();
+  }
 }
--- a/xpcom/tests/unit/test_nsIProcess.js
+++ b/xpcom/tests/unit/test_nsIProcess.js
@@ -1,74 +1,82 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 // nsIProcess unit test
-const TEST_ARGS = ["mozilla", "firefox", "thunderbird", "seamonkey", "foo",
-                   "bar", "argument with spaces", "\"argument with quotes\""];
+const TEST_ARGS = [
+  "mozilla",
+  "firefox",
+  "thunderbird",
+  "seamonkey",
+  "foo",
+  "bar",
+  "argument with spaces",
+  '"argument with quotes"',
+];
 
-const TEST_UNICODE_ARGS = ["M\u00F8z\u00EEll\u00E5",
-                           "\u041C\u043E\u0437\u0438\u043B\u043B\u0430",
-                           "\u09AE\u09CB\u099C\u09BF\u09B2\u09BE",
-                           "\uD808\uDE2C\uD808\uDF63\uD808\uDDB7"];
+const TEST_UNICODE_ARGS = [
+  "M\u00F8z\u00EEll\u00E5",
+  "\u041C\u043E\u0437\u0438\u043B\u043B\u0430",
+  "\u09AE\u09CB\u099C\u09BF\u09B2\u09BE",
+  "\uD808\uDE2C\uD808\uDF63\uD808\uDDB7",
+];
 
 // test if a process can be started, polled for its running status
 // and then killed
 function test_kill() {
   var file = get_test_program("TestBlockingProcess");
 
-  var process = Cc["@mozilla.org/process/util;1"]
-                  .createInstance(Ci.nsIProcess);
+  var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
   process.init(file);
 
   Assert.ok(!process.isRunning);
 
   try {
     process.kill();
     do_throw("Attempting to kill a not-running process should throw");
-  } catch (e) { }
+  } catch (e) {}
 
   process.run(false, [], 0);
 
   Assert.ok(process.isRunning);
 
   process.kill();
 
   Assert.ok(!process.isRunning);
 
   try {
     process.kill();
     do_throw("Attempting to kill a not-running process should throw");
-  } catch (e) { }
+  } catch (e) {}
 }
 
 // test if we can get an exit value from an application that is
 // guaranteed to return an exit value of 42
 function test_quick() {
   var file = get_test_program("TestQuickReturn");
 
-  var process = Cc["@mozilla.org/process/util;1"]
-                  .createInstance(Ci.nsIProcess);
+  var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
   process.init(file);
 
   // to get an exit value it must be a blocking process
   process.run(true, [], 0);
 
   Assert.equal(process.exitValue, 42);
 }
 
 function test_args(file, args, argsAreASCII) {
-  var process = Cc["@mozilla.org/process/util;1"]
-                  .createInstance(Ci.nsIProcess);
+  var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
   process.init(file);
 
-  if (argsAreASCII)
+  if (argsAreASCII) {
     process.run(true, args, args.length);
-  else
+  } else {
     process.runw(true, args, args.length);
+  }
 
   Assert.equal(process.exitValue, 0);
 }
 
 // test if an argument can be successfully passed to an application
 // that will return 0 if "mozilla" is the only argument
 function test_arguments() {
   test_args(get_test_program("TestArguments"), TEST_ARGS, true);
@@ -90,69 +98,72 @@ function rename_and_test(asciiName, unic
 
   test_args(unicodeFile, args, argsAreASCII);
 
   unicodeFile.moveTo(null, asciiLeaf);
 }
 
 // test passing ASCII and Unicode arguments to an application with a Unicode name
 function test_unicode_app() {
-  rename_and_test("TestArguments",
-                  // "Unicode" in Tamil
-                  "\u0BAF\u0BC1\u0BA9\u0BBF\u0B95\u0BCB\u0B9F\u0BCD",
-                  TEST_ARGS, true);
+  rename_and_test(
+    "TestArguments",
+    // "Unicode" in Tamil
+    "\u0BAF\u0BC1\u0BA9\u0BBF\u0B95\u0BCB\u0B9F\u0BCD",
+    TEST_ARGS,
+    true
+  );
 
-  rename_and_test("TestUnicodeArguments",
-                  // "Unicode" in Thai
-                  "\u0E22\u0E39\u0E19\u0E34\u0E42\u0E04\u0E14",
-                  TEST_UNICODE_ARGS, false);
+  rename_and_test(
+    "TestUnicodeArguments",
+    // "Unicode" in Thai
+    "\u0E22\u0E39\u0E19\u0E34\u0E42\u0E04\u0E14",
+    TEST_UNICODE_ARGS,
+    false
+  );
 }
 
 // test if we get notified about a blocking process
 function test_notify_blocking() {
   var file = get_test_program("TestQuickReturn");
 
-  var process = Cc["@mozilla.org/process/util;1"]
-                  .createInstance(Ci.nsIProcess);
+  var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
   process.init(file);
 
   process.runAsync([], 0, {
     observe(subject, topic, data) {
       process = subject.QueryInterface(Ci.nsIProcess);
       Assert.equal(topic, "process-finished");
       Assert.equal(process.exitValue, 42);
       test_notify_nonblocking();
     },
   });
 }
 
 // test if we get notified about a non-blocking process
 function test_notify_nonblocking() {
   var file = get_test_program("TestArguments");
 
-  var process = Cc["@mozilla.org/process/util;1"]
-                  .createInstance(Ci.nsIProcess);
+  var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
   process.init(file);
 
   process.runAsync(TEST_ARGS, TEST_ARGS.length, {
     observe(subject, topic, data) {
       process = subject.QueryInterface(Ci.nsIProcess);
       Assert.equal(topic, "process-finished");
       Assert.equal(process.exitValue, 0);
       test_notify_killed();
     },
   });
 }
 
 // test if we get notified about a killed process
 function test_notify_killed() {
   var file = get_test_program("TestBlockingProcess");
 
-  var process = Cc["@mozilla.org/process/util;1"]
-                  .createInstance(Ci.nsIProcess);
+  var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
   process.init(file);
 
   process.runAsync([], 0, {
     observe(subject, topic, data) {
       process = subject.QueryInterface(Ci.nsIProcess);
       Assert.equal(topic, "process-finished");
       do_test_finished();
     },
--- a/xpcom/tests/unit/test_nsIProcess_stress.js
+++ b/xpcom/tests/unit/test_nsIProcess_stress.js
@@ -1,24 +1,24 @@
 function run_test() {
   set_process_running_environment();
 
   var file = get_test_program("TestQuickReturn");
-  var tm = Cc["@mozilla.org/thread-manager;1"]
-             .getService();
+  var tm = Cc["@mozilla.org/thread-manager;1"].getService();
 
   for (var i = 0; i < 1000; i++) {
-    var process = Cc["@mozilla.org/process/util;1"]
-                          .createInstance(Ci.nsIProcess);
+    var process = Cc["@mozilla.org/process/util;1"].createInstance(
+      Ci.nsIProcess
+    );
     process.init(file);
 
     process.run(false, [], 0);
 
     try {
       process.kill();
-    } catch (e) { }
+    } catch (e) {}
 
     // We need to ensure that we process any events on the main thread -
     // this allow threads to clean up properly and avoid out of memory
     // errors during the test.
     tm.spinEventLoopUntilEmpty();
   }
 }
--- a/xpcom/tests/unit/test_pipe.js
+++ b/xpcom/tests/unit/test_pipe.js
@@ -7,25 +7,27 @@
 var Pipe = CC("@mozilla.org/pipe;1", "nsIPipe", "init");
 
 function run_test() {
   test_not_initialized();
   test_ends_are_threadsafe();
 }
 
 function test_not_initialized() {
-  var p = Cc["@mozilla.org/pipe;1"]
-            .createInstance(Ci.nsIPipe);
+  var p = Cc["@mozilla.org/pipe;1"].createInstance(Ci.nsIPipe);
   try {
     var dummy = p.outputStream;
     dump("dummy: " + dummy + "\n");
     throw Cr.NS_ERROR_FAILURE;
   } catch (e) {
-    if (e.result != Cr.NS_ERROR_NOT_INITIALIZED)
-      do_throw("using a pipe before initializing it should throw NS_ERROR_NOT_INITIALIZED");
+    if (e.result != Cr.NS_ERROR_NOT_INITIALIZED) {
+      do_throw(
+        "using a pipe before initializing it should throw NS_ERROR_NOT_INITIALIZED"
+      );
+    }
   }
 }
 
 function test_ends_are_threadsafe() {
   var p, is, os;
 
   p = new Pipe(true, true, 1024, 1, null);
   is = p.inputStream.QueryInterface(Ci.nsIClassInfo);
--- a/xpcom/tests/unit/test_process_directives.js
+++ b/xpcom/tests/unit/test_process_directives.js
@@ -1,21 +1,34 @@
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function run_test() {
-  Components.manager.autoRegister(do_get_file("data/process_directive.manifest"));
+  Components.manager.autoRegister(
+    do_get_file("data/process_directive.manifest")
+  );
 
-  let isChild = Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT;
+  let isChild =
+    Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT;
 
   if (isChild) {
-    Assert.equal(false, "@mozilla.org/xpcom/tests/MainProcessDirectiveTest;1" in Cc);
+    Assert.equal(
+      false,
+      "@mozilla.org/xpcom/tests/MainProcessDirectiveTest;1" in Cc
+    );
   } else {
-    let svc = Cc["@mozilla.org/xpcom/tests/MainProcessDirectiveTest;1"].createInstance(Ci.nsIProperty);
+    let svc = Cc[
+      "@mozilla.org/xpcom/tests/MainProcessDirectiveTest;1"
+    ].createInstance(Ci.nsIProperty);
     Assert.equal(svc.name, "main process");
   }
 
   if (!isChild) {
-    Assert.equal(false, "@mozilla.org/xpcom/tests/ChildProcessDirectiveTest;1" in Cc);
+    Assert.equal(
+      false,
+      "@mozilla.org/xpcom/tests/ChildProcessDirectiveTest;1" in Cc
+    );
   } else {
-    let svc = Cc["@mozilla.org/xpcom/tests/ChildProcessDirectiveTest;1"].createInstance(Ci.nsIProperty);
+    let svc = Cc[
+      "@mozilla.org/xpcom/tests/ChildProcessDirectiveTest;1"
+    ].createInstance(Ci.nsIProperty);
     Assert.equal(svc.name, "child process");
   }
 }
--- a/xpcom/tests/unit/test_seek_multiplex.js
+++ b/xpcom/tests/unit/test_seek_multiplex.js
@@ -3,31 +3,35 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // The string we use as data.
 const data = "0123456789";
 // Number of streams in the multiplex stream.
 const count = 10;
 
 function test_multiplex_streams() {
-  var MultiplexStream = CC("@mozilla.org/io/multiplex-input-stream;1",
-                           "nsIMultiplexInputStream");
+  var MultiplexStream = CC(
+    "@mozilla.org/io/multiplex-input-stream;1",
+    "nsIMultiplexInputStream"
+  );
   Assert.equal(1, 1);
 
   var multiplex = new MultiplexStream();
   for (var i = 0; i < count; ++i) {
-    let s = Cc["@mozilla.org/io/string-input-stream;1"]
-              .createInstance(Ci.nsIStringInputStream);
+    let s = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(
+      Ci.nsIStringInputStream
+    );
     s.setData(data, data.length);
 
     multiplex.appendStream(s);
   }
   var seekable = multiplex.QueryInterface(Ci.nsISeekableStream);
-  var sis = Cc["@mozilla.org/scriptableinputstream;1"]
-              .createInstance(Ci.nsIScriptableInputStream);
+  var sis = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(
+    Ci.nsIScriptableInputStream
+  );
   sis.init(seekable);
   // Read some data.
   var readData = sis.read(20);
   Assert.equal(readData, data + data);
   // -- Tests for NS_SEEK_SET
   // Seek to a non-zero, non-stream-boundary offset.
   seekable.seek(Ci.nsISeekableStream.NS_SEEK_SET, 2);
   Assert.equal(seekable.tell(), 2);
@@ -120,30 +124,34 @@ function test_multiplex_streams() {
   Assert.equal(seekable.tell(), 100);
   seekable.seek(Ci.nsISeekableStream.NS_SEEK_CUR, -2 * data.length * count);
   Assert.equal(seekable.tell(), 0);
 }
 
 function test_multiplex_bug797871() {
   var data2 = "1234567890123456789012345678901234567890";
 
-  var MultiplexStream = CC("@mozilla.org/io/multiplex-input-stream;1",
-                           "nsIMultiplexInputStream");
+  var MultiplexStream = CC(
+    "@mozilla.org/io/multiplex-input-stream;1",
+    "nsIMultiplexInputStream"
+  );
   Assert.equal(1, 1);
 
   var multiplex = new MultiplexStream();
-  let s = Cc["@mozilla.org/io/string-input-stream;1"]
-            .createInstance(Ci.nsIStringInputStream);
+  let s = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(
+    Ci.nsIStringInputStream
+  );
   s.setData(data2, data2.length);
 
   multiplex.appendStream(s);
 
   var seekable = multiplex.QueryInterface(Ci.nsISeekableStream);
-  var sis = Cc["@mozilla.org/scriptableinputstream;1"]
-              .createInstance(Ci.nsIScriptableInputStream);
+  var sis = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(
+    Ci.nsIScriptableInputStream
+  );
   sis.init(seekable);
 
   seekable.seek(Ci.nsISeekableStream.NS_SEEK_SET, 8);
   Assert.equal(seekable.tell(), 8);
   sis.read(2);
   Assert.equal(seekable.tell(), 10);
 
   seekable.seek(Ci.nsISeekableStream.NS_SEEK_SET, 20);
--- a/xpcom/tests/unit/test_storagestream.js
+++ b/xpcom/tests/unit/test_storagestream.js
@@ -13,28 +13,29 @@ function run_test() {
   test4();
 }
 
 /**
  * Checks that getting an input stream from a storage stream which has never had
  * anything written to it throws a not-initialized exception.
  */
 function test1() {
-  var ss = Cc["@mozilla.org/storagestream;1"]
-             .createInstance(Ci.nsIStorageStream);
+  var ss = Cc["@mozilla.org/storagestream;1"].createInstance(
+    Ci.nsIStorageStream
+  );
   ss.init(1024, 1024, null);
 
   var unusedVariable = ss.getOutputStream(0);
   var inp2 = ss.newInputStream(0);
   Assert.equal(inp2.available(), 0);
   Assert.ok(inp2.isNonBlocking());
 
-  var sis =
-      Cc["@mozilla.org/scriptableinputstream;1"]
-        .createInstance(Ci.nsIScriptableInputStream);
+  var sis = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(
+    Ci.nsIScriptableInputStream
+  );
   sis.init(inp2);
 
   var threw = false;
   try {
     sis.read(1);
   } catch (ex) {
     if (ex.result == Cr.NS_BASE_STREAM_WOULD_BLOCK) {
       threw = true;
@@ -45,36 +46,38 @@ function test1() {
   Assert.ok(threw);
 }
 
 /**
  * Checks that getting an input stream from a storage stream to which 0 bytes of
  * data have been explicitly written doesn't throw an exception.
  */
 function test2() {
-  var ss = Cc["@mozilla.org/storagestream;1"]
-             .createInstance(Ci.nsIStorageStream);
+  var ss = Cc["@mozilla.org/storagestream;1"].createInstance(
+    Ci.nsIStorageStream
+  );
   ss.init(1024, 1024, null);
 
   var out = ss.getOutputStream(0);
   out.write("", 0);
   try {
     ss.newInputStream(0);
   } catch (e) {
     do_throw("shouldn't throw exception when new input stream created");
   }
 }
 
 /**
  * Checks that reading any non-zero amount of data from a storage stream
  * which has had 0 bytes written to it explicitly works correctly.
  */
 function test3() {
-  var ss = Cc["@mozilla.org/storagestream;1"]
-             .createInstance(Ci.nsIStorageStream);
+  var ss = Cc["@mozilla.org/storagestream;1"].createInstance(
+    Ci.nsIStorageStream
+  );
   ss.init(1024, 1024, null);
 
   var out = ss.getOutputStream(0);
   out.write("", 0);
   try {
     var inp = ss.newInputStream(0);
   } catch (e) {
     do_throw("newInputStream(0) shouldn't throw if write() is called: " + e);
@@ -82,39 +85,41 @@ function test3() {
 
   Assert.ok(inp.isNonBlocking(), "next test expects a non-blocking stream");
 
   try {
     var threw = false;
     var bis = BIS(inp);
     bis.readByteArray(5);
   } catch (e) {
-    if (e.result != Cr.NS_BASE_STREAM_WOULD_BLOCK)
+    if (e.result != Cr.NS_BASE_STREAM_WOULD_BLOCK) {
       do_throw("wrong error thrown: " + e);
+    }
     threw = true;
   }
-  Assert.ok(threw,
-            "should have thrown (nsStorageInputStream is nonblocking)");
+  Assert.ok(threw, "should have thrown (nsStorageInputStream is nonblocking)");
 }
 
 /**
  * Basic functionality test for storagestream: write data to it, get an input
  * stream, and read the data back to see that it matches.
  */
 function test4() {
   var bytes = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74];
 
-  var ss = Cc["@mozilla.org/storagestream;1"]
-             .createInstance(Ci.nsIStorageStream);
+  var ss = Cc["@mozilla.org/storagestream;1"].createInstance(
+    Ci.nsIStorageStream
+  );
   ss.init(1024, 1024, null);
 
   var outStream = ss.getOutputStream(0);
 
-  var bos = Cc["@mozilla.org/binaryoutputstream;1"]
-              .createInstance(Ci.nsIBinaryOutputStream);
+  var bos = Cc["@mozilla.org/binaryoutputstream;1"].createInstance(
+    Ci.nsIBinaryOutputStream
+  );
   bos.setOutputStream(outStream);
 
   bos.writeByteArray(bytes, bytes.length);
   bos.close();
 
   var inp = ss.newInputStream(0);
   var bis = BIS(inp);
 
@@ -123,23 +128,25 @@ function test4() {
     var data = bis.read8(1);
     Assert.equal(data, bytes[count++]);
   }
 
   var threw = false;
   try {
     data = bis.read8(1);
   } catch (e) {
-    if (e.result != Cr.NS_ERROR_FAILURE)
+    if (e.result != Cr.NS_ERROR_FAILURE) {
       do_throw("wrong error thrown: " + e);
+    }
     threw = true;
   }
-  if (!threw)
+  if (!threw) {
     do_throw("should have thrown but instead returned: '" + data + "'");
+  }
 }
 
-
 function BIS(input) {
-  var bis = Cc["@mozilla.org/binaryinputstream;1"]
-              .createInstance(Ci.nsIBinaryInputStream);
+  var bis = Cc["@mozilla.org/binaryinputstream;1"].createInstance(
+    Ci.nsIBinaryInputStream
+  );
   bis.setInputStream(input);
   return bis;
 }
--- a/xpcom/tests/unit/test_streams.js
+++ b/xpcom/tests/unit/test_streams.js
@@ -1,36 +1,40 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var Pipe = CC("@mozilla.org/pipe;1",
-              "nsIPipe",
-              "init");
-var BinaryOutput = CC("@mozilla.org/binaryoutputstream;1",
-                      "nsIBinaryOutputStream",
-                      "setOutputStream");
-var BinaryInput = CC("@mozilla.org/binaryinputstream;1",
-                     "nsIBinaryInputStream",
-                     "setInputStream");
+var Pipe = CC("@mozilla.org/pipe;1", "nsIPipe", "init");
+var BinaryOutput = CC(
+  "@mozilla.org/binaryoutputstream;1",
+  "nsIBinaryOutputStream",
+  "setOutputStream"
+);
+var BinaryInput = CC(
+  "@mozilla.org/binaryinputstream;1",
+  "nsIBinaryInputStream",
+  "setInputStream"
+);
 
 /**
  * Binary stream tests.
  */
 function test_binary_streams() {
   var p, is, os;
 
   p = new Pipe(false, false, 1024, 1, null);
   is = new BinaryInput(p.inputStream);
   os = new BinaryOutput(p.outputStream);
 
   const LargeNum = Math.pow(2, 18) + Math.pow(2, 12) + 1;
   const HugeNum = Math.pow(2, 62);
   const HelloStr = "Hello World";
-  const HelloArray = Array.from(HelloStr, function(c) { return c.charCodeAt(0); });
+  const HelloArray = Array.from(HelloStr, function(c) {
+    return c.charCodeAt(0);
+  });
   var countObj = {};
   var msg = {};
   var buffer = new ArrayBuffer(HelloArray.length);
 
   // Test reading immediately after writing.
   os.writeBoolean(true);
   Assert.equal(is.readBoolean(), true);
   os.write8(4);
@@ -46,18 +50,18 @@ function test_binary_streams() {
   os.write64(LargeNum);
   Assert.equal(is.read64(), LargeNum);
   os.write64(1024);
   Assert.equal(is.read64(), 1024);
   os.write64(HugeNum);
   Assert.equal(is.read64(), HugeNum);
   os.writeFloat(2.5);
   Assert.equal(is.readFloat(), 2.5);
-//  os.writeDouble(Math.SQRT2);
-//  do_check_eq(is.readDouble(), Math.SQRT2);
+  //  os.writeDouble(Math.SQRT2);
+  //  do_check_eq(is.readDouble(), Math.SQRT2);
   os.writeStringZ("Mozilla");
   Assert.equal(is.readCString(), "Mozilla");
   os.writeWStringZ("Gecko");
   Assert.equal(is.readString(), "Gecko");
   os.writeBytes(HelloStr, HelloStr.length);
   Assert.equal(is.available(), HelloStr.length);
   msg = is.readBytes(HelloStr.length);
   Assert.equal(msg, HelloStr);
@@ -65,32 +69,35 @@ function test_binary_streams() {
   countObj.value = -1;
   os.writeByteArray(HelloArray, HelloArray.length);
   Assert.equal(is.available(), HelloStr.length);
   msg = is.readByteArray(HelloStr.length);
   Assert.equal(typeof msg, typeof HelloArray);
   Assert.equal(msg.toSource(), HelloArray.toSource());
   Assert.equal(is.available(), 0);
   os.writeByteArray(HelloArray, HelloArray.length);
-  Assert.equal(is.readArrayBuffer(buffer.byteLength, buffer), HelloArray.length);
-  Assert.equal([...(new Uint8Array(buffer))].toSource(), HelloArray.toSource());
+  Assert.equal(
+    is.readArrayBuffer(buffer.byteLength, buffer),
+    HelloArray.length
+  );
+  Assert.equal([...new Uint8Array(buffer)].toSource(), HelloArray.toSource());
   Assert.equal(is.available(), 0);
 
   // Test writing in one big chunk.
   os.writeBoolean(true);
   os.write8(4);
   os.write16(4);
   os.write16(1024);
   os.write32(7);
   os.write32(LargeNum);
   os.write64(LargeNum);
   os.write64(1024);
   os.write64(HugeNum);
   os.writeFloat(2.5);
-//  os.writeDouble(Math.SQRT2);
+  //  os.writeDouble(Math.SQRT2);
   os.writeStringZ("Mozilla");
   os.writeWStringZ("Gecko");
   os.writeBytes(HelloStr, HelloStr.length);
   os.writeByteArray(HelloArray, HelloArray.length);
   // Available should not be zero after a long write like this.
   Assert.notEqual(is.available(), 0);
 
   // Test reading in one big chunk.
@@ -99,17 +106,17 @@ function test_binary_streams() {
   Assert.equal(is.read16(), 4);
   Assert.equal(is.read16(), 1024);
   Assert.equal(is.read32(), 7);
   Assert.equal(is.read32(), LargeNum);
   Assert.equal(is.read64(), LargeNum);
   Assert.equal(is.read64(), 1024);
   Assert.equal(is.read64(), HugeNum);
   Assert.equal(is.readFloat(), 2.5);
-//  do_check_eq(is.readDouble(), Math.SQRT2);
+  //  do_check_eq(is.readDouble(), Math.SQRT2);
   Assert.equal(is.readCString(), "Mozilla");
   Assert.equal(is.readString(), "Gecko");
   // Remember, we wrote HelloStr twice - once as a string, and then as an array.
   Assert.equal(is.available(), HelloStr.length * 2);
   msg = is.readBytes(HelloStr.length);
   Assert.equal(msg, HelloStr);
   msg = null;
   countObj.value = -1;
@@ -122,40 +129,41 @@ function test_binary_streams() {
   // Test for invalid actions.
   os.close();
   is.close();
 
   try {
     os.writeBoolean(false);
     do_throw("Not reached!");
   } catch (e) {
-    if (!(e instanceof Ci.nsIException &&
-          e.result == Cr.NS_BASE_STREAM_CLOSED)) {
+    if (
+      !(e instanceof Ci.nsIException && e.result == Cr.NS_BASE_STREAM_CLOSED)
+    ) {
       throw e;
     }
     // do nothing
   }
 
   try {
     is.available();
     do_throw("Not reached!");
   } catch (e) {
-    if (!(e instanceof Ci.nsIException &&
-          e.result == Cr.NS_BASE_STREAM_CLOSED)) {
+    if (
+      !(e instanceof Ci.nsIException && e.result == Cr.NS_BASE_STREAM_CLOSED)
+    ) {
       throw e;
     }
     // do nothing
   }
 
   try {
     is.readBoolean();
     do_throw("Not reached!");
   } catch (e) {
-    if (!(e instanceof Ci.nsIException &&
-          e.result == Cr.NS_ERROR_FAILURE)) {
+    if (!(e instanceof Ci.nsIException && e.result == Cr.NS_ERROR_FAILURE)) {
       throw e;
     }
     // do nothing
   }
 }
 
 function run_test() {
   test_binary_streams();
--- a/xpcom/tests/unit/test_stringstream.js
+++ b/xpcom/tests/unit/test_stringstream.js
@@ -1,18 +1,20 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 function run_test() {
-    var s = Cc["@mozilla.org/io/string-input-stream;1"]
-              .createInstance(Ci.nsIStringInputStream);
-    var body = "This is a test";
-    s.setData(body, body.length);
-    Assert.equal(s.available(), body.length);
+  var s = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(
+    Ci.nsIStringInputStream
+  );
+  var body = "This is a test";
+  s.setData(body, body.length);
+  Assert.equal(s.available(), body.length);
 
-    var sis = Cc["@mozilla.org/scriptableinputstream;1"]
-                .createInstance(Ci.nsIScriptableInputStream);
-    sis.init(s);
+  var sis = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(
+    Ci.nsIScriptableInputStream
+  );
+  sis.init(s);
 
-    Assert.equal(sis.read(body.length), body);
+  Assert.equal(sis.read(body.length), body);
 }
--- a/xpcom/tests/unit/test_symlinks.js
+++ b/xpcom/tests/unit/test_symlinks.js
@@ -1,32 +1,30 @@
 const CWD = do_get_cwd();
 
-const DIR_TARGET     = "target";
-const DIR_LINK       = "link";
-const DIR_LINK_LINK  = "link_link";
-const FILE_TARGET    = "target.txt";
-const FILE_LINK      = "link.txt";
+const DIR_TARGET = "target";
+const DIR_LINK = "link";
+const DIR_LINK_LINK = "link_link";
+const FILE_TARGET = "target.txt";
+const FILE_LINK = "link.txt";
 const FILE_LINK_LINK = "link_link.txt";
 
 const DOES_NOT_EXIST = "doesnotexist";
-const DANGLING_LINK  = "dangling_link";
-const LOOP_LINK      = "loop_link";
+const DANGLING_LINK = "dangling_link";
+const LOOP_LINK = "loop_link";
 
 const nsIFile = Ci.nsIFile;
 
 var process;
 function createSymLink(from, to) {
   if (!process) {
-    var ln = Cc["@mozilla.org/file/local;1"]
-               .createInstance(Ci.nsIFile);
+    var ln = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
     ln.initWithPath("/bin/ln");
 
-    process = Cc["@mozilla.org/process/util;1"]
-                .createInstance(Ci.nsIProcess);
+    process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
     process.init(ln);
   }
 
   const args = ["-s", from, to];
   process.run(true, args, args.length);
   Assert.equal(process.exitValue, 0);
 }
 
@@ -76,66 +74,74 @@ function setupTestDir(testDir, relative)
   targetFile.create(nsIFile.NORMAL_FILE_TYPE, 0o666);
 
   var imaginary = testDir.clone();
   imaginary.append(DOES_NOT_EXIST);
 
   var loop = testDir.clone();
   loop.append(LOOP_LINK);
 
-  var dirLink  = makeSymLink(targetDir, DIR_LINK, relative);
+  var dirLink = makeSymLink(targetDir, DIR_LINK, relative);
   var fileLink = makeSymLink(targetFile, FILE_LINK, relative);
 
   makeSymLink(dirLink, DIR_LINK_LINK, relative);
   makeSymLink(fileLink, FILE_LINK_LINK, relative);
 
   makeSymLink(imaginary, DANGLING_LINK, relative);
 
   try {
     makeSymLink(loop, LOOP_LINK, relative);
     Assert.ok(false);
-  } catch (e) {
-  }
+  } catch (e) {}
 }
 
 function createSpaces(dirs, files, links) {
   function longest(a, b) {
     return a.length > b.length ? a : b;
   }
-  return dirs.concat(files, links).reduce(longest, "").replace(/./g, " ");
+  return dirs
+    .concat(files, links)
+    .reduce(longest, "")
+    .replace(/./g, " ");
 }
 
 function testSymLinks(testDir, relative) {
   setupTestDir(testDir, relative);
 
-  const dirLinks   = [DIR_LINK, DIR_LINK_LINK];
-  const fileLinks  = [FILE_LINK, FILE_LINK_LINK];
+  const dirLinks = [DIR_LINK, DIR_LINK_LINK];
+  const fileLinks = [FILE_LINK, FILE_LINK_LINK];
   const otherLinks = [DANGLING_LINK, LOOP_LINK];
-  const dirs  = [DIR_TARGET].concat(dirLinks);
+  const dirs = [DIR_TARGET].concat(dirLinks);
   const files = [FILE_TARGET].concat(fileLinks);
   const links = otherLinks.concat(dirLinks, fileLinks);
 
   const spaces = createSpaces(dirs, files, links);
-  const bools = {false: " false", true: " true "};
+  const bools = { false: " false", true: " true " };
   print(spaces + " dir   file  symlink");
   var dirEntries = testDir.directoryEntries;
   while (dirEntries.hasMoreElements()) {
     const file = dirEntries.nextFile;
     const name = file.leafName;
-    print(name + spaces.substring(name.length) + bools[file.isDirectory()] +
-          bools[file.isFile()] + bools[file.isSymlink()]);
+    print(
+      name +
+        spaces.substring(name.length) +
+        bools[file.isDirectory()] +
+        bools[file.isFile()] +
+        bools[file.isSymlink()]
+    );
     Assert.equal(file.isDirectory(), dirs.includes(name));
     Assert.equal(file.isFile(), files.includes(name));
     Assert.equal(file.isSymlink(), links.includes(name));
   }
 }
 
 function run_test() {
   // Skip this test on Windows
-  if (mozinfo.os == "win")
+  if (mozinfo.os == "win") {
     return;
+  }
 
   var testDir = CWD;
   testDir.append("test_symlinks");
 
   testSymLinks(testDir, false);
   testSymLinks(testDir, true);
 }
--- a/xpcom/tests/unit/test_systemInfo.js
+++ b/xpcom/tests/unit/test_systemInfo.js
@@ -1,17 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 function run_test() {
-  const PROPERTIES = ["name", "arch", "version", "pagesize",
-                      "pageshift", "memmapalign", "cpucount", "memsize"];
-  let sysInfo = Cc["@mozilla.org/system-info;1"].
-                getService(Ci.nsIPropertyBag2);
+  const PROPERTIES = [
+    "name",
+    "arch",
+    "version",
+    "pagesize",
+    "pageshift",
+    "memmapalign",
+    "cpucount",
+    "memsize",
+  ];
+  let sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
 
   PROPERTIES.forEach(function(aPropertyName) {
     print("Testing property: " + aPropertyName);
     let value = sysInfo.getProperty(aPropertyName);
     Assert.ok(!!value);
   });
 
   // This property must exist, but its value might be zero.
--- a/xpcom/tests/unit/test_versioncomparator.js
+++ b/xpcom/tests/unit/test_versioncomparator.js
@@ -1,15 +1,15 @@
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // Versions to test listed in ascending order, none can be equal
 var comparisons = [
   "pre",
   // A number that is too large to be supported should be normalized to 0.
-  String(0x1F0000000),
+  String(0x1f0000000),
   "0.9",
   "0.9.1",
   "1.0pre1",
   "1.0pre2",
   "1.0",
   "1.1pre",
   "1.1pre1a",
   "1.1pre1",
@@ -22,37 +22,36 @@ var comparisons = [
   "1.*",
   "2.0",
   "2.1",
   "3.0.-1",
   "3.0",
 ];
 
 // Every version in this list means the same version number
-var equality = [
-  "1.1pre",
-  "1.1pre0",
-  "1.0+",
-];
+var equality = ["1.1pre", "1.1pre0", "1.0+"];
 
 function run_test() {
   for (var i = 0; i < comparisons.length; i++) {
     for (var j = 0; j < comparisons.length; j++) {
       var result = Services.vc.compare(comparisons[i], comparisons[j]);
       if (i == j) {
-        if (result != 0)
+        if (result != 0) {
           do_throw(comparisons[i] + " should be the same as itself");
+        }
       } else if (i < j) {
-        if (!(result < 0))
+        if (!(result < 0)) {
           do_throw(comparisons[i] + " should be less than " + comparisons[j]);
+        }
       } else if (!(result > 0)) {
         do_throw(comparisons[i] + " should be greater than " + comparisons[j]);
       }
     }
   }
 
   for (i = 0; i < equality.length; i++) {
     for (j = 0; j < equality.length; j++) {
-      if (Services.vc.compare(equality[i], equality[j]) != 0)
+      if (Services.vc.compare(equality[i], equality[j]) != 0) {
         do_throw(equality[i] + " should equal " + equality[j]);
+      }
     }
   }
 }
--- a/xpcom/tests/unit/test_windows_cmdline_file.js
+++ b/xpcom/tests/unit/test_windows_cmdline_file.js
@@ -1,20 +1,24 @@
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 let executableFile = Services.dirsvc.get("CurProcD", Ci.nsIFile);
 executableFile.append("xpcshell.exe");
 function run_test() {
   let quote = '"'; // Windows' cmd processor doesn't actually use single quotes.
   for (let suffix of ["", " -osint", ` --blah "%PROGRAMFILES%"`]) {
     let cmdline = quote + executableFile.path + quote + suffix;
     info(`Testing with ${cmdline}`);
     let f = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFileWin);
     f.initWithCommandLine(cmdline);
-    Assert.equal(f.path, executableFile.path, "Should be able to recover executable path");
+    Assert.equal(
+      f.path,
+      executableFile.path,
+      "Should be able to recover executable path"
+    );
   }
 
   let f = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFileWin);
   f.initWithCommandLine("%ComSpec% -c echo 'hi'");
   let cmd = Services.dirsvc.get("SysD", Ci.nsIFile);
   cmd.append("cmd.exe");
   Assert.equal(f.path, cmd.path, "Should be able to replace env vars.");
 }
--- a/xpcom/tests/unit/test_windows_registry.js
+++ b/xpcom/tests/unit/test_windows_registry.js
@@ -4,193 +4,228 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const nsIWindowsRegKey = Ci.nsIWindowsRegKey;
 let regKeyComponent = Cc["@mozilla.org/windows-registry-key;1"];
 
 function run_test() {
-    //* create a key structure in a spot that's normally writable (somewhere under HKCU).
-    let testKey = regKeyComponent.createInstance(nsIWindowsRegKey);
+  //* create a key structure in a spot that's normally writable (somewhere under HKCU).
+  let testKey = regKeyComponent.createInstance(nsIWindowsRegKey);
 
-    // If it's already present because a previous test crashed or didn't clean up properly, clean it up first.
-    let keyName = BASE_PATH + "\\" + TESTDATA_KEYNAME;
-    setup_test_run(testKey, keyName);
+  // If it's already present because a previous test crashed or didn't clean up properly, clean it up first.
+  let keyName = BASE_PATH + "\\" + TESTDATA_KEYNAME;
+  setup_test_run(testKey, keyName);
 
-    //* test that the write* functions write stuff
-    test_writing_functions(testKey);
+  //* test that the write* functions write stuff
+  test_writing_functions(testKey);
 
-    //* check that the valueCount/getValueName functions work for the values we just wrote
-    test_value_functions(testKey);
+  //* check that the valueCount/getValueName functions work for the values we just wrote
+  test_value_functions(testKey);
 
-    //* check that the get* functions work for the values we just wrote.
-    test_reading_functions(testKey);
+  //* check that the get* functions work for the values we just wrote.
+  test_reading_functions(testKey);
 
-    //* check that the get* functions fail with the right exception codes if we ask for the wrong type or if the value name doesn't exist at all
-    test_invalidread_functions(testKey);
+  //* check that the get* functions fail with the right exception codes if we ask for the wrong type or if the value name doesn't exist at all
+  test_invalidread_functions(testKey);
 
-    //* check that creating/enumerating/deleting child keys works
-    test_childkey_functions(testKey);
+  //* check that creating/enumerating/deleting child keys works
+  test_childkey_functions(testKey);
 
-    test_watching_functions(testKey);
+  test_watching_functions(testKey);
 
-    //* clean up
-    cleanup_test_run(testKey, keyName);
+  //* clean up
+  cleanup_test_run(testKey, keyName);
 }
 
 function setup_test_run(testKey, keyName) {
-    info("Setup test run");
-    try {
-        testKey.open(nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, keyName, nsIWindowsRegKey.ACCESS_READ);
-        info("Test key exists. Needs cleanup.");
-        cleanup_test_run(testKey, keyName);
-    } catch (e) {
-        if (!(e instanceof Ci.nsIException && e.result == Cr.NS_ERROR_FAILURE)) {
-            throw e;
-        }
+  info("Setup test run");
+  try {
+    testKey.open(
+      nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
+      keyName,
+      nsIWindowsRegKey.ACCESS_READ
+    );
+    info("Test key exists. Needs cleanup.");
+    cleanup_test_run(testKey, keyName);
+  } catch (e) {
+    if (!(e instanceof Ci.nsIException && e.result == Cr.NS_ERROR_FAILURE)) {
+      throw e;
     }
+  }
 
-    testKey.create(nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, keyName, nsIWindowsRegKey.ACCESS_ALL);
+  testKey.create(
+    nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
+    keyName,
+    nsIWindowsRegKey.ACCESS_ALL
+  );
 }
 
 function test_writing_functions(testKey) {
-    strictEqual(testKey.valueCount, 0);
+  strictEqual(testKey.valueCount, 0);
 
-    strictEqual(testKey.hasValue(TESTDATA_STRNAME), false);
-    testKey.writeStringValue(TESTDATA_STRNAME, TESTDATA_STRVALUE);
-    strictEqual(testKey.hasValue(TESTDATA_STRNAME), true);
+  strictEqual(testKey.hasValue(TESTDATA_STRNAME), false);
+  testKey.writeStringValue(TESTDATA_STRNAME, TESTDATA_STRVALUE);
+  strictEqual(testKey.hasValue(TESTDATA_STRNAME), true);
 
-    strictEqual(testKey.hasValue(TESTDATA_INTNAME), false);
-    testKey.writeIntValue(TESTDATA_INTNAME, TESTDATA_INTVALUE);
+  strictEqual(testKey.hasValue(TESTDATA_INTNAME), false);
+  testKey.writeIntValue(TESTDATA_INTNAME, TESTDATA_INTVALUE);
 
-    strictEqual(testKey.hasValue(TESTDATA_INT64NAME), false);
-    testKey.writeInt64Value(TESTDATA_INT64NAME, TESTDATA_INT64VALUE);
+  strictEqual(testKey.hasValue(TESTDATA_INT64NAME), false);
+  testKey.writeInt64Value(TESTDATA_INT64NAME, TESTDATA_INT64VALUE);
 
-    strictEqual(testKey.hasValue(TESTDATA_BINARYNAME), false);
-    testKey.writeBinaryValue(TESTDATA_BINARYNAME, TESTDATA_BINARYVALUE);
+  strictEqual(testKey.hasValue(TESTDATA_BINARYNAME), false);
+  testKey.writeBinaryValue(TESTDATA_BINARYNAME, TESTDATA_BINARYVALUE);
 }
 
 function test_value_functions(testKey) {
-    strictEqual(testKey.valueCount, 4);
-    strictEqual(testKey.getValueName(0), TESTDATA_STRNAME);
-    strictEqual(testKey.getValueName(1), TESTDATA_INTNAME);
-    strictEqual(testKey.getValueName(2), TESTDATA_INT64NAME);
-    strictEqual(testKey.getValueName(3), TESTDATA_BINARYNAME);
+  strictEqual(testKey.valueCount, 4);
+  strictEqual(testKey.getValueName(0), TESTDATA_STRNAME);
+  strictEqual(testKey.getValueName(1), TESTDATA_INTNAME);
+  strictEqual(testKey.getValueName(2), TESTDATA_INT64NAME);
+  strictEqual(testKey.getValueName(3), TESTDATA_BINARYNAME);
 }
 
 function test_reading_functions(testKey) {
-    strictEqual(testKey.getValueType(TESTDATA_STRNAME), nsIWindowsRegKey.TYPE_STRING);
-    strictEqual(testKey.readStringValue(TESTDATA_STRNAME), TESTDATA_STRVALUE);
+  strictEqual(
+    testKey.getValueType(TESTDATA_STRNAME),
+    nsIWindowsRegKey.TYPE_STRING
+  );
+  strictEqual(testKey.readStringValue(TESTDATA_STRNAME), TESTDATA_STRVALUE);
 
-    strictEqual(testKey.getValueType(TESTDATA_INTNAME), nsIWindowsRegKey.TYPE_INT);
-    strictEqual(testKey.readIntValue(TESTDATA_INTNAME), TESTDATA_INTVALUE);
+  strictEqual(
+    testKey.getValueType(TESTDATA_INTNAME),
+    nsIWindowsRegKey.TYPE_INT
+  );
+  strictEqual(testKey.readIntValue(TESTDATA_INTNAME), TESTDATA_INTVALUE);
 
-    strictEqual(testKey.getValueType(TESTDATA_INT64NAME), nsIWindowsRegKey.TYPE_INT64);
-    strictEqual( testKey.readInt64Value(TESTDATA_INT64NAME), TESTDATA_INT64VALUE);
+  strictEqual(
+    testKey.getValueType(TESTDATA_INT64NAME),
+    nsIWindowsRegKey.TYPE_INT64
+  );
+  strictEqual(testKey.readInt64Value(TESTDATA_INT64NAME), TESTDATA_INT64VALUE);
 
-    strictEqual(testKey.getValueType(TESTDATA_BINARYNAME), nsIWindowsRegKey.TYPE_BINARY);
-    strictEqual( testKey.readBinaryValue(TESTDATA_BINARYNAME), TESTDATA_BINARYVALUE);
+  strictEqual(
+    testKey.getValueType(TESTDATA_BINARYNAME),
+    nsIWindowsRegKey.TYPE_BINARY
+  );
+  strictEqual(
+    testKey.readBinaryValue(TESTDATA_BINARYNAME),
+    TESTDATA_BINARYVALUE
+  );
 }
 
 function test_invalidread_functions(testKey) {
-    try {
-        testKey.readIntValue(TESTDATA_STRNAME);
-        do_throw("Reading an integer from a string registry value should throw.");
-    } catch (e) {
-        if (!(e instanceof Ci.nsIException && e.result == Cr.NS_ERROR_FAILURE)) {
-            throw e;
-        }
+  try {
+    testKey.readIntValue(TESTDATA_STRNAME);
+    do_throw("Reading an integer from a string registry value should throw.");
+  } catch (e) {
+    if (!(e instanceof Ci.nsIException && e.result == Cr.NS_ERROR_FAILURE)) {
+      throw e;
     }
-
-    try {
-        let val = testKey.readStringValue(TESTDATA_INTNAME);
-        do_throw("Reading an string from an Int registry value should throw." + val);
-    } catch (e) {
-        if (!(e instanceof Ci.nsIException && e.result == Cr.NS_ERROR_FAILURE)) {
-            throw e;
-        }
-    }
+  }
 
-    try {
-        testKey.readStringValue(TESTDATA_INT64NAME);
-        do_throw("Reading an string from an Int64 registry value should throw.");
-    } catch (e) {
-        if (!(e instanceof Ci.nsIException && e.result == Cr.NS_ERROR_FAILURE)) {
-            throw e;
-        }
+  try {
+    let val = testKey.readStringValue(TESTDATA_INTNAME);
+    do_throw(
+      "Reading an string from an Int registry value should throw." + val
+    );
+  } catch (e) {
+    if (!(e instanceof Ci.nsIException && e.result == Cr.NS_ERROR_FAILURE)) {
+      throw e;
     }
+  }
 
-    try {
-        testKey.readStringValue(TESTDATA_BINARYNAME);
-        do_throw("Reading a string from an Binary registry value should throw.");
-    } catch (e) {
-        if (!(e instanceof Ci.nsIException && e.result == Cr.NS_ERROR_FAILURE)) {
-            throw e;
-        }
+  try {
+    testKey.readStringValue(TESTDATA_INT64NAME);
+    do_throw("Reading an string from an Int64 registry value should throw.");
+  } catch (e) {
+    if (!(e instanceof Ci.nsIException && e.result == Cr.NS_ERROR_FAILURE)) {
+      throw e;
     }
+  }
+
+  try {
+    testKey.readStringValue(TESTDATA_BINARYNAME);
+    do_throw("Reading a string from an Binary registry value should throw.");
+  } catch (e) {
+    if (!(e instanceof Ci.nsIException && e.result == Cr.NS_ERROR_FAILURE)) {
+      throw e;
+    }
+  }
 }
 
 function test_childkey_functions(testKey) {
-    strictEqual(testKey.childCount, 0);
-    strictEqual(testKey.hasChild(TESTDATA_CHILD_KEY), false);
+  strictEqual(testKey.childCount, 0);
+  strictEqual(testKey.hasChild(TESTDATA_CHILD_KEY), false);
 
-    let childKey = testKey.createChild(TESTDATA_CHILD_KEY, nsIWindowsRegKey.ACCESS_ALL);
-    childKey.close();
+  let childKey = testKey.createChild(
+    TESTDATA_CHILD_KEY,
+    nsIWindowsRegKey.ACCESS_ALL
+  );
+  childKey.close();
 
-    strictEqual(testKey.childCount, 1);
-    strictEqual(testKey.hasChild(TESTDATA_CHILD_KEY), true);
-    strictEqual(testKey.getChildName(0), TESTDATA_CHILD_KEY);
+  strictEqual(testKey.childCount, 1);
+  strictEqual(testKey.hasChild(TESTDATA_CHILD_KEY), true);
+  strictEqual(testKey.getChildName(0), TESTDATA_CHILD_KEY);
 
-    childKey = testKey.openChild(TESTDATA_CHILD_KEY, nsIWindowsRegKey.ACCESS_ALL);
-    testKey.removeChild(TESTDATA_CHILD_KEY);
-    strictEqual(testKey.childCount, 0);
-    strictEqual(testKey.hasChild(TESTDATA_CHILD_KEY), false);
+  childKey = testKey.openChild(TESTDATA_CHILD_KEY, nsIWindowsRegKey.ACCESS_ALL);
+  testKey.removeChild(TESTDATA_CHILD_KEY);
+  strictEqual(testKey.childCount, 0);
+  strictEqual(testKey.hasChild(TESTDATA_CHILD_KEY), false);
 }
 
 function test_watching_functions(testKey) {
-    strictEqual(testKey.isWatching(), false);
-    strictEqual(testKey.hasChanged(), false);
-
-    testKey.startWatching(true);
-    strictEqual(testKey.isWatching(), true);
+  strictEqual(testKey.isWatching(), false);
+  strictEqual(testKey.hasChanged(), false);
 
-    testKey.stopWatching();
-    strictEqual(testKey.isWatching(), false);
+  testKey.startWatching(true);
+  strictEqual(testKey.isWatching(), true);
 
-    // Create a child key, and update a value
-    let childKey = testKey.createChild(TESTDATA_CHILD_KEY, nsIWindowsRegKey.ACCESS_ALL);
-    childKey.writeIntValue(TESTDATA_INTNAME, TESTDATA_INTVALUE);
+  testKey.stopWatching();
+  strictEqual(testKey.isWatching(), false);
 
-    // Start a recursive watch, and update the child's value
-    testKey.startWatching(true);
-    strictEqual(testKey.isWatching(), true);
+  // Create a child key, and update a value
+  let childKey = testKey.createChild(
+    TESTDATA_CHILD_KEY,
+    nsIWindowsRegKey.ACCESS_ALL
+  );
+  childKey.writeIntValue(TESTDATA_INTNAME, TESTDATA_INTVALUE);
 
-    childKey.writeIntValue(TESTDATA_INTNAME, 0);
-    strictEqual(testKey.hasChanged(), true);
-    testKey.stopWatching();
-    strictEqual(testKey.isWatching(), false);
+  // Start a recursive watch, and update the child's value
+  testKey.startWatching(true);
+  strictEqual(testKey.isWatching(), true);
 
-    childKey.removeValue(TESTDATA_INTNAME);
-    childKey.close();
-    testKey.removeChild(TESTDATA_CHILD_KEY);
+  childKey.writeIntValue(TESTDATA_INTNAME, 0);
+  strictEqual(testKey.hasChanged(), true);
+  testKey.stopWatching();
+  strictEqual(testKey.isWatching(), false);
+
+  childKey.removeValue(TESTDATA_INTNAME);
+  childKey.close();
+  testKey.removeChild(TESTDATA_CHILD_KEY);
 }
 
 function cleanup_test_run(testKey, keyName) {
-    info("Cleaning up test.");
+  info("Cleaning up test.");
+
+  for (var i = 0; i < testKey.childCount; i++) {
+    testKey.removeChild(testKey.getChildName(i));
+  }
+  testKey.close();
 
-    for (var i = 0; i < testKey.childCount; i++) {
-        testKey.removeChild(testKey.getChildName(i));
-    }
-    testKey.close();
-
-    let baseKey = regKeyComponent.createInstance(nsIWindowsRegKey);
-    baseKey.open(nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, BASE_PATH, nsIWindowsRegKey.ACCESS_ALL);
-    baseKey.removeChild(TESTDATA_KEYNAME);
-    baseKey.close();
+  let baseKey = regKeyComponent.createInstance(nsIWindowsRegKey);
+  baseKey.open(
+    nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
+    BASE_PATH,
+    nsIWindowsRegKey.ACCESS_ALL
+  );
+  baseKey.removeChild(TESTDATA_KEYNAME);
+  baseKey.close();
 }
 
 // Test data used above.
 const BASE_PATH = "SOFTWARE";
 const TESTDATA_KEYNAME = "TestRegXPC";
 const TESTDATA_STRNAME = "AString";
 const TESTDATA_STRVALUE = "The quick brown fox jumps over the lazy dog.";
 const TESTDATA_INTNAME = "AnInteger";