Bug 1561435 - Format widget/, a=automatic-formatting
authorVictor Porof <vporof@mozilla.com>
Fri, 05 Jul 2019 11:19:19 +0200
changeset 544290 b53e2f4066e82af48eb86f80840d4afbcb8d1ad1
parent 544289 06715c4f165df5f02bd18583a6676eaa034e7265
child 544291 285c79c476cd11b3bcf9f1541d5c8be39b6287fe
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [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 widget/, a=automatic-formatting # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D35944
.eslintrc.js
.prettierignore
widget/headless/tests/test_headless.js
widget/headless/tests/test_headless_clipboard.js
widget/tests/browser/browser_test_clipboardcache.js
widget/tests/browser/browser_test_procinfo.js
widget/tests/unit/test_macsharingservice.js
widget/tests/unit/test_macwebapputils.js
widget/tests/unit/test_taskbar_jumplistitems.js
widget/tests/utils.js
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -40,17 +40,16 @@ module.exports = {
     "plugin:mozilla/recommended"
   ],
   "plugins": [
     "mozilla"
   ],
   "overrides": [{
       "files": [
         "devtools/**",
-        "widget/**",
         "xpcom/**",
         "xpfe/**",
       ],
       "rules": {
         // Temporarily disable the curly everywhere, pending Prettier.
         "curly": "off"
       }
     }, {
--- 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.
-widget/**
 xpcom/**
 xpfe/**
 
 # Ignore all devtools directories for now, except the debugger.
 devtools/client/*.js
 devtools/client/aboutdebugging/**
 devtools/client/aboutdebugging-new/**
 devtools/client/accessibility/**
--- a/widget/headless/tests/test_headless.js
+++ b/widget/headless/tests/test_headless.js
@@ -1,89 +1,102 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {HttpServer} = ChromeUtils.import("resource://testing-common/httpd.js");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
 
 const server = new HttpServer();
 server.registerDirectory("/", do_get_cwd());
 server.start(-1);
 const ROOT = `http://localhost:${server.identity.primaryPort}`;
 const BASE = `${ROOT}/`;
 const HEADLESS_URL = `${BASE}/headless.html`;
 const HEADLESS_BUTTON_URL = `${BASE}/headless_button.html`;
-registerCleanupFunction(() => { server.stop(() => {}); });
+registerCleanupFunction(() => {
+  server.stop(() => {});
+});
 
 // Refrences to the progress listeners to keep them from being gc'ed
 // before they are called.
 const progressListeners = new Map();
 
 function loadContentWindow(windowlessBrowser, uri) {
   return new Promise((resolve, reject) => {
     let loadURIOptions = {
       triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
     };
     windowlessBrowser.loadURI(uri, loadURIOptions);
     let docShell = windowlessBrowser.docShell;
-    let webProgress = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
-                      .getInterface(Ci.nsIWebProgress);
+    let webProgress = docShell
+      .QueryInterface(Ci.nsIInterfaceRequestor)
+      .getInterface(Ci.nsIWebProgress);
     let progressListener = {
       onLocationChange(progress, request, location, flags) {
         // Ignore inner-frame events
         if (progress != webProgress) {
           return;
         }
         // Ignore events that don't change the document
         if (flags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) {
           return;
         }
         let contentWindow = docShell.domWindow;
         webProgress.removeProgressListener(progressListener);
         progressListeners.delete(progressListener);
-        contentWindow.addEventListener("load", (event) => {
-          resolve(contentWindow);
-        }, { once: true });
+        contentWindow.addEventListener(
+          "load",
+          event => {
+            resolve(contentWindow);
+          },
+          { once: true }
+        );
       },
-      QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
-                                             "nsISupportsWeakReference"]),
+      QueryInterface: ChromeUtils.generateQI([
+        "nsIWebProgressListener",
+        "nsISupportsWeakReference",
+      ]),
     };
     progressListeners.set(progressListener, progressListener);
-    webProgress.addProgressListener(progressListener,
-                                    Ci.nsIWebProgress.NOTIFY_LOCATION);
+    webProgress.addProgressListener(
+      progressListener,
+      Ci.nsIWebProgress.NOTIFY_LOCATION
+    );
   });
 }
 
 add_task(async function test_snapshot() {
   let windowlessBrowser = Services.appShell.createWindowlessBrowser(false);
   let contentWindow = await loadContentWindow(windowlessBrowser, HEADLESS_URL);
   const contentWidth = 400;
   const contentHeight = 300;
   // Verify dimensions.
   contentWindow.resizeTo(contentWidth, contentHeight);
   equal(contentWindow.innerWidth, contentWidth);
   equal(contentWindow.innerHeight, contentHeight);
 
   // Snapshot the test page.
-  let canvas = contentWindow.document.createElementNS("http://www.w3.org/1999/xhtml", "html:canvas");
+  let canvas = contentWindow.document.createElementNS(
+    "http://www.w3.org/1999/xhtml",
+    "html:canvas"
+  );
   let context = canvas.getContext("2d");
   let width = contentWindow.innerWidth;
   let height = contentWindow.innerHeight;
   canvas.width = width;
   canvas.height = height;
-  context.drawWindow(
-    contentWindow,
-    0,
-    0,
-    width,
-    height,
-    "rgb(255, 255, 255)"
+  context.drawWindow(contentWindow, 0, 0, width, height, "rgb(255, 255, 255)");
+  let imageData = context.getImageData(0, 0, width, height).data;
+  ok(
+    imageData[0] === 0 &&
+      imageData[1] === 255 &&
+      imageData[2] === 0 &&
+      imageData[3] === 255,
+    "Page is green."
   );
-  let imageData = context.getImageData(0, 0, width, height).data;
-  ok(imageData[0] === 0 && imageData[1] === 255 && imageData[2] === 0 && imageData[3] === 255, "Page is green.");
 
   // Search for a blue pixel (a quick and dirty check to see if the blue text is
   // on the page)
   let found = false;
   for (let i = 0; i < imageData.length; i += 4) {
     if (imageData[i + 2] === 255) {
       found = true;
       break;
@@ -101,77 +114,101 @@ add_task(async function test_snapshot_wi
   const contentWidth = 1;
   const contentHeight = 2;
   // Verify dimensions.
   contentWindow.resizeTo(contentWidth, contentHeight);
   equal(contentWindow.innerWidth, contentWidth);
   equal(contentWindow.innerHeight, contentHeight);
 
   // Snapshot the test page.
-  let canvas = contentWindow.document.createElementNS("http://www.w3.org/1999/xhtml", "html:canvas");
+  let canvas = contentWindow.document.createElementNS(
+    "http://www.w3.org/1999/xhtml",
+    "html:canvas"
+  );
   let context = canvas.getContext("2d");
   let width = contentWindow.innerWidth;
   let height = contentWindow.innerHeight;
   canvas.width = width;
   canvas.height = height;
   context.drawWindow(
     contentWindow,
     0,
     0,
     width,
     height,
     "rgb(255, 255, 255)",
-    context.DRAWWINDOW_DRAW_CARET | context.DRAWWINDOW_DRAW_VIEW | context.DRAWWINDOW_USE_WIDGET_LAYERS
+    context.DRAWWINDOW_DRAW_CARET |
+      context.DRAWWINDOW_DRAW_VIEW |
+      context.DRAWWINDOW_USE_WIDGET_LAYERS
   );
   ok(true, "Snapshot with widget layers didn't crash.");
 
   windowlessBrowser.close();
 });
 
 // Ensure keydown events are triggered on the windowless browser.
 add_task(async function test_keydown() {
   let windowlessBrowser = Services.appShell.createWindowlessBrowser(false);
   // nsIWindowlessBrowser inherits from nsIWebNavigation.
   let contentWindow = await loadContentWindow(windowlessBrowser, HEADLESS_URL);
 
-  let keydown = new Promise((resolve) => {
-    contentWindow.addEventListener("keydown", () => {
-      resolve();
-    }, { once: true });
+  let keydown = new Promise(resolve => {
+    contentWindow.addEventListener(
+      "keydown",
+      () => {
+        resolve();
+      },
+      { once: true }
+    );
   });
 
-  let tip = Cc["@mozilla.org/text-input-processor;1"]
-            .createInstance(Ci.nsITextInputProcessor);
+  let tip = Cc["@mozilla.org/text-input-processor;1"].createInstance(
+    Ci.nsITextInputProcessor
+  );
   let begun = tip.beginInputTransactionForTests(contentWindow);
-  ok(begun, "nsITextInputProcessor.beginInputTransactionForTests() should succeed");
-  tip.keydown(new contentWindow.KeyboardEvent("", {key: "a", code: "KeyA", keyCode: contentWindow.KeyboardEvent.DOM_VK_A}));
+  ok(
+    begun,
+    "nsITextInputProcessor.beginInputTransactionForTests() should succeed"
+  );
+  tip.keydown(
+    new contentWindow.KeyboardEvent("", {
+      key: "a",
+      code: "KeyA",
+      keyCode: contentWindow.KeyboardEvent.DOM_VK_A,
+    })
+  );
 
   await keydown;
   ok(true, "Send keydown didn't crash");
 
   windowlessBrowser.close();
 });
 
 // Test dragging the mouse on a button to ensure the creation of the drag
 // service doesn't crash in headless.
 add_task(async function test_mouse_drag() {
   let windowlessBrowser = Services.appShell.createWindowlessBrowser(false);
   // nsIWindowlessBrowser inherits from nsIWebNavigation.
-  let contentWindow = await loadContentWindow(windowlessBrowser, HEADLESS_BUTTON_URL);
+  let contentWindow = await loadContentWindow(
+    windowlessBrowser,
+    HEADLESS_BUTTON_URL
+  );
   contentWindow.resizeTo(400, 400);
 
   let target = contentWindow.document.getElementById("btn");
   let rect = target.getBoundingClientRect();
   let left = rect.left;
   let top = rect.top;
 
   let utils = contentWindow.windowUtils;
   utils.sendMouseEvent("mousedown", left, top, 0, 1, 0, false, 0, 0);
   utils.sendMouseEvent("mousemove", left, top, 0, 1, 0, false, 0, 0);
   // Wait for a turn of the event loop since the synthetic mouse event
   // that creates the drag service is processed during the refresh driver.
-  await new Promise((r) => { executeSoon(r); });
+  await new Promise(r => {
+    executeSoon(r);
+  });
   utils.sendMouseEvent("mouseup", left, top, 0, 1, 0, false, 0, 0);
 
   ok(true, "Send mouse event didn't crash");
 
   windowlessBrowser.close();
 });
--- a/widget/headless/tests/test_headless_clipboard.js
+++ b/widget/headless/tests/test_headless_clipboard.js
@@ -2,18 +2,19 @@
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function getString(clipboard) {
   var str = "";
 
   // Create transferable that will transfer the text.
-  var trans = Cc["@mozilla.org/widget/transferable;1"]
-                        .createInstance(Ci.nsITransferable);
+  var trans = Cc["@mozilla.org/widget/transferable;1"].createInstance(
+    Ci.nsITransferable
+  );
   trans.init(null);
   trans.addDataFlavor("text/unicode");
 
   clipboard.getData(trans, Ci.nsIClipboard.kGlobalClipboard);
 
   try {
     var data = {};
     trans.getTransferData("text/unicode", data);
@@ -29,16 +30,17 @@ function getString(clipboard) {
   return str;
 }
 
 add_task(async function test_clipboard() {
   let clipboard = Services.clipboard;
 
   // Test copy.
   const data = "random number: " + Math.random();
-  let helper = Cc["@mozilla.org/widget/clipboardhelper;1"]
-               .getService(Ci.nsIClipboardHelper);
+  let helper = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(
+    Ci.nsIClipboardHelper
+  );
   helper.copyString(data);
   equal(getString(clipboard), data, "Data was successfully copied.");
 
   clipboard.emptyClipboard(Ci.nsIClipboard.kGlobalClipboard);
   equal(getString(clipboard), "", "Data was successfully cleared.");
 });
--- a/widget/tests/browser/browser_test_clipboardcache.js
+++ b/widget/tests/browser/browser_test_clipboardcache.js
@@ -1,14 +1,15 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
-const { AppConstants } =
-  ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
+const { AppConstants } = ChromeUtils.import(
+  "resource://gre/modules/AppConstants.jsm"
+);
 
 // Note: widget/tests/test_bug1123480.xul checks whether nsTransferable behaves
 // as expected with regards to private browsing mode and the clipboard cache,
 // i.e. that the clipboard is not cached to the disk when private browsing mode
 // is enabled.
 //
 // This test tests that the clipboard is not cached to the disk by IPC,
 // as a regression test for bug 1396224.
@@ -40,18 +41,19 @@ function getClipboardCacheFDCount() {
     // Apparently, this flag is unreliable (e.g. when the application crashes),
     // so nsAnonymousTemporaryFile stores the temporary files in a subdirectory,
     // which is cleaned up some time after start-up.
 
     // This is just a test, and during the test we deterministically close the
     // handles, so if FILE_FLAG_DELETE_ON_CLOSE does the thing it promises, the
     // file is actually removed when the handle is closed.
 
-    let {FileUtils} =
-      ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
+    let { FileUtils } = ChromeUtils.import(
+      "resource://gre/modules/FileUtils.jsm"
+    );
     // Path from nsAnonymousTemporaryFile.cpp, GetTempDir.
     dir = FileUtils.getFile("TmpD", ["mozilla-temp-files"]);
   } else {
     dir = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
     dir.initWithPath("/dev/fd");
   }
   let count = 0;
   for (let fdFile of dir.directoryEntries) {
@@ -66,63 +68,67 @@ function getClipboardCacheFDCount() {
       // Assume that the file was created by us if the size matches.
       ++count;
     }
   }
   return count;
 }
 
 async function testCopyPaste(isPrivate) {
-  let win = await BrowserTestUtils.openNewBrowserWindow({private: isPrivate});
+  let win = await BrowserTestUtils.openNewBrowserWindow({ private: isPrivate });
   let tab = await BrowserTestUtils.openNewForegroundTab(win);
   let browser = tab.linkedBrowser;
 
   // Sanitize environment
-  await ContentTask.spawn(browser, SHORT_STRING_NO_CACHE, async (shortStr) => {
+  await ContentTask.spawn(browser, SHORT_STRING_NO_CACHE, async shortStr => {
     await content.navigator.clipboard.writeText(shortStr);
   });
 
   let initialFdCount = getClipboardCacheFDCount();
 
-  await ContentTask.spawn(browser, Ipsum, async (largeString) => {
+  await ContentTask.spawn(browser, Ipsum, async largeString => {
     await content.navigator.clipboard.writeText(largeString);
   });
 
   let fdCountAfterCopy = getClipboardCacheFDCount();
   if (isPrivate) {
     is(fdCountAfterCopy, initialFdCount, "Private write");
   } else {
     is(fdCountAfterCopy, initialFdCount + 1, "Cached write");
   }
 
   let readStr = await ContentTask.spawn(browser, null, async () => {
-    let {document} = content;
+    let { document } = content;
     document.body.contentEditable = true;
     document.body.focus();
     let pastePromise = new Promise(resolve => {
-      document.addEventListener("paste", e => {
-        resolve(e.clipboardData.getData("text/plain"));
-      }, {once: true});
+      document.addEventListener(
+        "paste",
+        e => {
+          resolve(e.clipboardData.getData("text/plain"));
+        },
+        { once: true }
+      );
     });
     document.execCommand("paste");
     return pastePromise;
   });
   ok(readStr === Ipsum, "Read what we pasted");
 
   if (isPrivate) {
     is(getClipboardCacheFDCount(), fdCountAfterCopy, "Private read");
   } else {
     // Upon reading from the clipboard, a temporary nsTransferable is used, for
     // which the cache is disabled. The content process does not cache clipboard
     // data either. So the file descriptor count should be identical.
     is(getClipboardCacheFDCount(), fdCountAfterCopy, "Read not cached");
   }
 
   // Cleanup.
-  await ContentTask.spawn(browser, SHORT_STRING_NO_CACHE, async (shortStr) => {
+  await ContentTask.spawn(browser, SHORT_STRING_NO_CACHE, async shortStr => {
     await content.navigator.clipboard.writeText(shortStr);
   });
   is(getClipboardCacheFDCount(), initialFdCount, "Drop clipboard cache if any");
 
   BrowserTestUtils.removeTab(tab);
   await BrowserTestUtils.closeWindow(win);
 }
 
--- a/widget/tests/browser/browser_test_procinfo.js
+++ b/widget/tests/browser/browser_test_procinfo.js
@@ -1,21 +1,23 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
 const ROOT_URL = "http://example.com/browser/widget/tests/browser";
 const DUMMY_URL = ROOT_URL + "/dummy.html";
-const { AppConstants } = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
+const { AppConstants } = ChromeUtils.import(
+  "resource://gre/modules/AppConstants.jsm"
+);
 const MAC = AppConstants.platform == "macosx";
 
-
 add_task(async function test_proc_info() {
   waitForExplicitFinish();
-  await BrowserTestUtils.withNewTab({ gBrowser, url: DUMMY_URL},
+  await BrowserTestUtils.withNewTab(
+    { gBrowser, url: DUMMY_URL },
     async function(browser) {
       let cpuThreads = 0;
       let cpuUser = 0;
       for (let z = 0; z < 10; z++) {
         let parentProc = await ChromeUtils.requestProcInfo();
         cpuUser += parentProc.cpuUser;
 
         for (var x = 0; x < parentProc.threads.length; x++) {
@@ -30,10 +32,11 @@ add_task(async function test_proc_info()
           cpuUser += childProc.cpuUser;
         }
       }
       // see https://bugzilla.mozilla.org/show_bug.cgi?id=1529023
       if (!MAC) {
         Assert.ok(cpuThreads > 0, "Got some cpu time in the threads");
       }
       Assert.ok(cpuUser > 0, "Got some cpu time");
-    });
+    }
+  );
 });
--- a/widget/tests/unit/test_macsharingservice.js
+++ b/widget/tests/unit/test_macsharingservice.js
@@ -1,24 +1,29 @@
 /* -*- 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/. */
 
 // Basic tests to verify that MacSharingService returns expected data
 
 function test_getSharingProviders() {
-  let sharingService = Cc["@mozilla.org/widget/macsharingservice;1"].
-      getService(Ci.nsIMacSharingService);
+  let sharingService = Cc["@mozilla.org/widget/macsharingservice;1"].getService(
+    Ci.nsIMacSharingService
+  );
   let providers = sharingService.getSharingProviders("http://example.org");
   Assert.ok(providers.length > 1, "There are providers returned");
   providers.forEach(provider => {
     Assert.ok("name" in provider, "Provider has name");
     Assert.ok("menuItemTitle" in provider, "Provider has menuItemTitle");
     Assert.ok("image" in provider, "Provider has image");
 
-    Assert.notEqual(provider.title, "Mail", "Known filtered provider not returned");
+    Assert.notEqual(
+      provider.title,
+      "Mail",
+      "Known filtered provider not returned"
+    );
   });
 }
 
 function run_test() {
   test_getSharingProviders();
 }
--- a/widget/tests/unit/test_macwebapputils.js
+++ b/widget/tests/unit/test_macwebapputils.js
@@ -1,33 +1,34 @@
 /* -*- 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/. */
 
 // Basic tests to verify that MacWebAppUtils works
 
 function test_find_app() {
-  var mwaUtils = Cc["@mozilla.org/widget/mac-web-app-utils;1"].
-  createInstance(Ci.nsIMacWebAppUtils);
+  var mwaUtils = Cc["@mozilla.org/widget/mac-web-app-utils;1"].createInstance(
+    Ci.nsIMacWebAppUtils
+  );
   let sig = "com.apple.TextEdit";
 
   let path;
   path = mwaUtils.pathForAppWithIdentifier(sig);
   info("TextEdit path: " + path + "\n");
   Assert.notEqual(path, "");
 }
 
 function test_dont_find_fake_app() {
-  var mwaUtils = Cc["@mozilla.org/widget/mac-web-app-utils;1"].
-  createInstance(Ci.nsIMacWebAppUtils);
+  var mwaUtils = Cc["@mozilla.org/widget/mac-web-app-utils;1"].createInstance(
+    Ci.nsIMacWebAppUtils
+  );
   let sig = "calliope.penitentiary.dramamine";
 
   let path;
   path = mwaUtils.pathForAppWithIdentifier(sig);
   Assert.equal(path, "");
 }
 
-
 function run_test() {
   test_find_app();
   test_dont_find_fake_app();
 }
--- a/widget/tests/unit/test_taskbar_jumplistitems.js
+++ b/widget/tests/unit/test_taskbar_jumplistitems.js
@@ -2,27 +2,31 @@
 /* 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/. */
 
 // This tests taskbar jump list functionality available on win7 and up.
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function test_basics() {
-  var item = Cc["@mozilla.org/windows-jumplistitem;1"].
-  createInstance(Ci.nsIJumpListItem);
+  var item = Cc["@mozilla.org/windows-jumplistitem;1"].createInstance(
+    Ci.nsIJumpListItem
+  );
 
-  var sep = Cc["@mozilla.org/windows-jumplistseparator;1"].
-  createInstance(Ci.nsIJumpListSeparator);
+  var sep = Cc["@mozilla.org/windows-jumplistseparator;1"].createInstance(
+    Ci.nsIJumpListSeparator
+  );
 
-  var shortcut = Cc["@mozilla.org/windows-jumplistshortcut;1"].
-  createInstance(Ci.nsIJumpListShortcut);
+  var shortcut = Cc["@mozilla.org/windows-jumplistshortcut;1"].createInstance(
+    Ci.nsIJumpListShortcut
+  );
 
-  var link = Cc["@mozilla.org/windows-jumplistlink;1"].
-  createInstance(Ci.nsIJumpListLink);
+  var link = Cc["@mozilla.org/windows-jumplistlink;1"].createInstance(
+    Ci.nsIJumpListLink
+  );
 
   Assert.ok(!item.equals(sep));
   Assert.ok(!item.equals(shortcut));
   Assert.ok(!item.equals(link));
 
   Assert.ok(!sep.equals(item));
   Assert.ok(!sep.equals(shortcut));
   Assert.ok(!sep.equals(link));
@@ -39,126 +43,180 @@ function test_basics() {
   Assert.ok(sep.equals(sep));
   Assert.ok(link.equals(link));
   Assert.ok(shortcut.equals(shortcut));
 }
 
 function test_separator() {
   // separators:
 
-  var item = Cc["@mozilla.org/windows-jumplistseparator;1"].
-  createInstance(Ci.nsIJumpListSeparator);
+  var item = Cc["@mozilla.org/windows-jumplistseparator;1"].createInstance(
+    Ci.nsIJumpListSeparator
+  );
 
   Assert.ok(item.type == Ci.nsIJumpListItem.JUMPLIST_ITEM_SEPARATOR);
 }
 
 function test_hashes() {
-  var link = Cc["@mozilla.org/windows-jumplistlink;1"]
-             .createInstance(Ci.nsIJumpListLink);
+  var link = Cc["@mozilla.org/windows-jumplistlink;1"].createInstance(
+    Ci.nsIJumpListLink
+  );
   var uri1 = Cc["@mozilla.org/network/simple-uri-mutator;1"]
-               .createInstance(Ci.nsIURIMutator)
-               .setSpec("http://www.123.com/")
-               .finalize();
+    .createInstance(Ci.nsIURIMutator)
+    .setSpec("http://www.123.com/")
+    .finalize();
   var uri2 = Cc["@mozilla.org/network/simple-uri-mutator;1"]
-               .createInstance(Ci.nsIURIMutator)
-               .setSpec("http://www.123.com/")
-               .finalize();
+    .createInstance(Ci.nsIURIMutator)
+    .setSpec("http://www.123.com/")
+    .finalize();
 
   link.uri = uri1;
 
   Assert.ok(link.compareHash(uri2));
-  uri2 = uri2.mutate().setSpec("http://www.456.com/").finalize();
+  uri2 = uri2
+    .mutate()
+    .setSpec("http://www.456.com/")
+    .finalize();
   Assert.ok(!link.compareHash(uri2));
-  uri2 = uri2.mutate().setSpec("http://www.123.com/").finalize();
+  uri2 = uri2
+    .mutate()
+    .setSpec("http://www.123.com/")
+    .finalize();
   Assert.ok(link.compareHash(uri2));
-  uri2 = uri2.mutate().setSpec("https://www.123.com/").finalize();
+  uri2 = uri2
+    .mutate()
+    .setSpec("https://www.123.com/")
+    .finalize();
   Assert.ok(!link.compareHash(uri2));
-  uri2 = uri2.mutate().setSpec("http://www.123.com/test/").finalize();
+  uri2 = uri2
+    .mutate()
+    .setSpec("http://www.123.com/test/")
+    .finalize();
   Assert.ok(!link.compareHash(uri2));
-  uri1 = uri1.mutate().setSpec("http://www.123.com/test/").finalize();
+  uri1 = uri1
+    .mutate()
+    .setSpec("http://www.123.com/test/")
+    .finalize();
   link.uri = uri1;
-  uri2 = uri2.mutate().setSpec("http://www.123.com/test/").finalize();
+  uri2 = uri2
+    .mutate()
+    .setSpec("http://www.123.com/test/")
+    .finalize();
   Assert.ok(link.compareHash(uri2));
-  uri1 = uri1.mutate().setSpec("https://www.123.com/test/").finalize();
+  uri1 = uri1
+    .mutate()
+    .setSpec("https://www.123.com/test/")
+    .finalize();
   link.uri = uri1;
-  uri2 = uri2.mutate().setSpec("https://www.123.com/test/").finalize();
+  uri2 = uri2
+    .mutate()
+    .setSpec("https://www.123.com/test/")
+    .finalize();
   Assert.ok(link.compareHash(uri2));
-  uri2 = uri2.mutate().setSpec("ftp://www.123.com/test/").finalize();
+  uri2 = uri2
+    .mutate()
+    .setSpec("ftp://www.123.com/test/")
+    .finalize();
   Assert.ok(!link.compareHash(uri2));
-  uri2 = uri2.mutate().setSpec("http://123.com/test/").finalize();
+  uri2 = uri2
+    .mutate()
+    .setSpec("http://123.com/test/")
+    .finalize();
   Assert.ok(!link.compareHash(uri2));
-  uri1 = uri1.mutate().setSpec("https://www.123.com/test/").finalize();
+  uri1 = uri1
+    .mutate()
+    .setSpec("https://www.123.com/test/")
+    .finalize();
   link.uri = uri1;
-  uri2 = uri2.mutate().setSpec("https://www.123.com/Test/").finalize();
+  uri2 = uri2
+    .mutate()
+    .setSpec("https://www.123.com/Test/")
+    .finalize();
   Assert.ok(!link.compareHash(uri2));
 
-  uri1 = uri1.mutate().setSpec("http://www.123.com/").finalize();
+  uri1 = uri1
+    .mutate()
+    .setSpec("http://www.123.com/")
+    .finalize();
   link.uri = uri1;
   Assert.equal(link.uriHash, "QGLmWuwuTozr3tOfXSf5mg==");
-  uri1 = uri1.mutate().setSpec("http://www.123.com/test/").finalize();
+  uri1 = uri1
+    .mutate()
+    .setSpec("http://www.123.com/test/")
+    .finalize();
   link.uri = uri1;
   Assert.equal(link.uriHash, "AG87Ls+GmaUYSUJFETRr3Q==");
-  uri1 = uri1.mutate().setSpec("https://www.123.com/").finalize();
+  uri1 = uri1
+    .mutate()
+    .setSpec("https://www.123.com/")
+    .finalize();
   link.uri = uri1;
   Assert.equal(link.uriHash, "iSx6UH1a9enVPzUA9JZ42g==");
 }
 
 function test_links() {
   // links:
-  var link1 = Cc["@mozilla.org/windows-jumplistlink;1"]
-             .createInstance(Ci.nsIJumpListLink);
-  var link2 = Cc["@mozilla.org/windows-jumplistlink;1"]
-              .createInstance(Ci.nsIJumpListLink);
+  var link1 = Cc["@mozilla.org/windows-jumplistlink;1"].createInstance(
+    Ci.nsIJumpListLink
+  );
+  var link2 = Cc["@mozilla.org/windows-jumplistlink;1"].createInstance(
+    Ci.nsIJumpListLink
+  );
 
   var uri1 = Cc["@mozilla.org/network/simple-uri-mutator;1"]
-               .createInstance(Ci.nsIURIMutator)
-               .setSpec("http://www.test.com/")
-               .finalize();
+    .createInstance(Ci.nsIURIMutator)
+    .setSpec("http://www.test.com/")
+    .finalize();
   var uri2 = Cc["@mozilla.org/network/simple-uri-mutator;1"]
-               .createInstance(Ci.nsIURIMutator)
-               .setSpec("http://www.test.com/")
-               .finalize();
+    .createInstance(Ci.nsIURIMutator)
+    .setSpec("http://www.test.com/")
+    .finalize();
 
   link1.uri = uri1;
   link1.uriTitle = "Test";
   link2.uri = uri2;
   link2.uriTitle = "Test";
 
   Assert.ok(link1.equals(link2));
 
   link2.uriTitle = "Testing";
 
   Assert.ok(!link1.equals(link2));
 
   link2.uriTitle = "Test";
-  uri2 = uri2.mutate().setSpec("http://www.testing.com/").finalize();
+  uri2 = uri2
+    .mutate()
+    .setSpec("http://www.testing.com/")
+    .finalize();
   link2.uri = uri2;
 
   Assert.ok(!link1.equals(link2));
 }
 
 function test_shortcuts() {
   // shortcuts:
-  var sc = Cc["@mozilla.org/windows-jumplistshortcut;1"]
-           .createInstance(Ci.nsIJumpListShortcut);
+  var sc = Cc["@mozilla.org/windows-jumplistshortcut;1"].createInstance(
+    Ci.nsIJumpListShortcut
+  );
 
-  var handlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"]
-                   .createInstance(Ci.nsILocalHandlerApp);
+  var handlerApp = Cc[
+    "@mozilla.org/uriloader/local-handler-app;1"
+  ].createInstance(Ci.nsILocalHandlerApp);
 
   handlerApp.name = "TestApp";
   handlerApp.detailedDescription = "TestApp detailed description.";
   handlerApp.appendParameter("-test");
 
   sc.iconIndex = 1;
   Assert.equal(sc.iconIndex, 1);
 
   var faviconPageUri = Cc["@mozilla.org/network/simple-uri-mutator;1"]
-                         .createInstance(Ci.nsIURIMutator)
-                         .setSpec("http://www.123.com/")
-                         .finalize();
+    .createInstance(Ci.nsIURIMutator)
+    .setSpec("http://www.123.com/")
+    .finalize();
   sc.faviconPageUri = faviconPageUri;
   Assert.equal(sc.faviconPageUri, faviconPageUri);
 
   var notepad = Services.dirsvc.get("WinD", Ci.nsIFile);
   notepad.append("notepad.exe");
   if (notepad.exists()) {
     handlerApp.executable = notepad;
     sc.app = handlerApp;
@@ -171,80 +229,89 @@ function test_shortcuts() {
 
 async function test_jumplist() {
   // Jump lists can't register links unless the application is the default
   // protocol handler for the protocol of the link, so we skip off testing
   // those in these tests. We'll init the jump list for the xpc shell harness,
   // add a task item, and commit it.
 
   // not compiled in
-  if (Ci.nsIWinTaskbar == null)
+  if (Ci.nsIWinTaskbar == null) {
     return;
+  }
 
-  var taskbar = Cc["@mozilla.org/windows-taskbar;1"]
-                .getService(Ci.nsIWinTaskbar);
+  var taskbar = Cc["@mozilla.org/windows-taskbar;1"].getService(
+    Ci.nsIWinTaskbar
+  );
 
   var builder = taskbar.createJumpListBuilder();
 
   Assert.notEqual(builder, null);
 
   // Win7 and up only
   try {
-    var sysInfo = Cc["@mozilla.org/system-info;1"].
-                  getService(Ci.nsIPropertyBag2);
+    var sysInfo = Cc["@mozilla.org/system-info;1"].getService(
+      Ci.nsIPropertyBag2
+    );
     var ver = parseFloat(sysInfo.getProperty("version"));
     if (ver < 6.1) {
       Assert.ok(!builder.available);
       return;
     }
-  } catch (ex) { }
+  } catch (ex) {}
 
   Assert.ok(taskbar.available);
 
   builder.deleteActiveList();
 
-  var items = Cc["@mozilla.org/array;1"]
-              .createInstance(Ci.nsIMutableArray);
+  var items = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
 
-  var sc = Cc["@mozilla.org/windows-jumplistshortcut;1"]
-           .createInstance(Ci.nsIJumpListShortcut);
+  var sc = Cc["@mozilla.org/windows-jumplistshortcut;1"].createInstance(
+    Ci.nsIJumpListShortcut
+  );
 
-  var handlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"]
-                   .createInstance(Ci.nsILocalHandlerApp);
+  var handlerApp = Cc[
+    "@mozilla.org/uriloader/local-handler-app;1"
+  ].createInstance(Ci.nsILocalHandlerApp);
 
   handlerApp.name = "Notepad";
   handlerApp.detailedDescription = "Testing detailed description.";
 
   var notepad = Services.dirsvc.get("WinD", Ci.nsIFile);
   notepad.append("notepad.exe");
   if (notepad.exists()) {
     // To ensure "profile-before-change" will fire before
     // "xpcom-shutdown-threads"
     do_get_profile();
 
     handlerApp.executable = notepad;
     sc.app = handlerApp;
     items.appendElement(sc);
 
-    var removed = Cc["@mozilla.org/array;1"]
-                  .createInstance(Ci.nsIMutableArray);
+    var removed = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
     Assert.ok(builder.initListBuild(removed));
     Assert.ok(builder.addListToBuild(builder.JUMPLIST_CATEGORY_TASKS, items));
     Assert.ok(builder.addListToBuild(builder.JUMPLIST_CATEGORY_RECENT));
     Assert.ok(builder.addListToBuild(builder.JUMPLIST_CATEGORY_FREQUENT));
-    let rv = new Promise((resolve) => {
+    let rv = new Promise(resolve => {
       builder.commitListBuild(resolve);
     });
     Assert.ok(await rv);
 
     builder.deleteActiveList();
 
     Assert.ok(builder.initListBuild(removed));
-    Assert.ok(builder.addListToBuild(builder.JUMPLIST_CATEGORY_CUSTOMLIST, items, "Custom List"));
-    rv = new Promise((resolve) => {
+    Assert.ok(
+      builder.addListToBuild(
+        builder.JUMPLIST_CATEGORY_CUSTOMLIST,
+        items,
+        "Custom List"
+      )
+    );
+    rv = new Promise(resolve => {
       builder.commitListBuild(resolve);
     });
     Assert.ok(await rv);
 
     builder.deleteActiveList();
   }
 }
 
--- a/widget/tests/utils.js
+++ b/widget/tests/utils.js
@@ -1,12 +1,12 @@
-
 function getTestPlugin(pluginName) {
-  var ph = SpecialPowers.Cc["@mozilla.org/plugin/host;1"]
-                                 .getService(SpecialPowers.Ci.nsIPluginHost);
+  var ph = SpecialPowers.Cc["@mozilla.org/plugin/host;1"].getService(
+    SpecialPowers.Ci.nsIPluginHost
+  );
   var tags = ph.getPluginTags();
   var name = pluginName || "Test Plug-in";
   for (var tag of tags) {
     if (tag.name == name) {
       return tag;
     }
   }