Bug 1508991 - Enable ESLint for dom/manifest/ (manual changes) r=Standard8,Ehsan
authorJulia <jkmcgeoghan@myseneca.ca>
Tue, 18 Dec 2018 20:39:42 +0000
changeset 508295 bdc9835131211c2c2d8f22982c88559840554ead
parent 508294 6204be7c53a17aa7841e92b68e583be116383de3
child 508296 6ced915a7d2d241979c9df61b7d42cba0de38c88
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8, Ehsan
bugs1508991
milestone66.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 1508991 - Enable ESLint for dom/manifest/ (manual changes) r=Standard8,Ehsan Differential Revision: https://phabricator.services.mozilla.com/D13208
.eslintignore
dom/manifest/ImageObjectProcessor.jsm
dom/manifest/Manifest.jsm
dom/manifest/ManifestFinder.jsm
dom/manifest/ManifestIcons.jsm
dom/manifest/ManifestObtainer.jsm
dom/manifest/ManifestProcessor.jsm
dom/manifest/ValueExtractor.jsm
dom/manifest/test/browser_ManifestIcons_browserFetchIcon.js
dom/manifest/test/browser_ManifestObtainer_obtain.js
dom/manifest/test/browser_Manifest_install.js
dom/manifest/test/test_ImageObjectProcessor_sizes.html
dom/manifest/test/test_ImageObjectProcessor_src.html
dom/manifest/test/test_ManifestProcessor_icons.html
dom/manifest/test/test_ManifestProcessor_lang.html
dom/manifest/test/test_ManifestProcessor_scope.html
dom/manifest/test/test_ManifestProcessor_start_url.html
dom/manifest/test/test_window_onappinstalled_event.html
--- a/.eslintignore
+++ b/.eslintignore
@@ -186,17 +186,16 @@ dom/encoding/**
 dom/events/**
 dom/fetch/**
 dom/file/**
 dom/flex/**
 dom/grid/**
 dom/html/**
 dom/jsurl/**
 dom/localstorage/**
-dom/manifest/**
 dom/media/test/**
 dom/media/tests/**
 dom/media/webaudio/**
 dom/media/webspeech/**
 dom/messagechannel/**
 dom/midi/**
 dom/network/**
 dom/notification/Notification*.*
--- a/dom/manifest/ImageObjectProcessor.jsm
+++ b/dom/manifest/ImageObjectProcessor.jsm
@@ -15,27 +15,21 @@
  * Usage:
  *
  *   .process(aManifest, aBaseURL, aMemberName);
  *
  */
 /* exported EXPORTED_SYMBOLS*/
 /* globals Components */
 "use strict";
-const {
-  utils: Cu,
-  interfaces: Ci,
-  classes: Cc,
-} = Components;
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyGlobalGetters(this, ["URL"]);
-const netutil = Cc["@mozilla.org/network/util;1"]
-  .getService(Ci.nsINetUtil);
 
 function ImageObjectProcessor(aConsole, aExtractor) {
   this.console = aConsole;
   this.extractor = aExtractor;
 }
 
 // Static getters
 Object.defineProperties(ImageObjectProcessor, {
@@ -87,17 +81,17 @@ ImageObjectProcessor.prototype.process =
       objectName: "image",
       object: aImage,
       property: "type",
       expectedType: "string",
       trim: true,
     };
     let value = extractor.extractValue(spec);
     if (value) {
-      value = netutil.parseRequestContentType(value, charset, hadCharset);
+      value = Services.netUtils.parseRequestContentType(value, charset, hadCharset);
     }
     return value || undefined;
   }
 
   function processSrcMember(aImage, aBaseURL) {
     const spec = {
       objectName: "image",
       object: aImage,
--- a/dom/manifest/Manifest.jsm
+++ b/dom/manifest/Manifest.jsm
@@ -6,18 +6,16 @@
  * and to access the manifest data (including icons).
  *
  * TODO:
  *  - Trigger appropriate app installed events
  */
 
 "use strict";
 
-ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-
 const { ManifestObtainer } =
   ChromeUtils.import("resource://gre/modules/ManifestObtainer.jsm", {});
 const { ManifestIcons } =
   ChromeUtils.import("resource://gre/modules/ManifestIcons.jsm", {});
 
 ChromeUtils.defineModuleGetter(this, "OS",
                                "resource://gre/modules/osfile.jsm");
 ChromeUtils.defineModuleGetter(this, "JSONFile",
--- a/dom/manifest/ManifestFinder.jsm
+++ b/dom/manifest/ManifestFinder.jsm
@@ -1,16 +1,14 @@
 /* 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 https://mozilla.org/MPL/2.0/. */
 /* globals Components, Task, PromiseMessage */
 "use strict";
-const {
-  utils: Cu,
-} = Components;
+
 ChromeUtils.import("resource://gre/modules/PromiseMessage.jsm");
 
 var ManifestFinder = {// jshint ignore:line
   /**
   * Check from content process if DOM Window has a conforming
   * manifest link relationship.
   * @param aContent DOM Window to check.
   * @return {Promise<Boolean>}
--- a/dom/manifest/ManifestIcons.jsm
+++ b/dom/manifest/ManifestIcons.jsm
@@ -1,33 +1,27 @@
 "use strict";
 
-const {
-  utils: Cu,
-  classes: Cc,
-  interfaces: Ci,
-} = Components;
-
 ChromeUtils.import("resource://gre/modules/PromiseMessage.jsm");
 
 var ManifestIcons = {
 
   async browserFetchIcon(aBrowser, manifest, iconSize) {
     const msgKey = "DOM:WebManifest:fetchIcon";
     const mm = aBrowser.messageManager;
     const {data: {success, result}} =
       await PromiseMessage.send(mm, msgKey, {manifest, iconSize});
     if (!success) {
       throw result;
     }
     return result;
   },
 
   async contentFetchIcon(aWindow, manifest, iconSize) {
-    return await getIcon(aWindow, toIconArray(manifest.icons), iconSize);
+    return getIcon(aWindow, toIconArray(manifest.icons), iconSize);
   },
 };
 
 function parseIconSize(size) {
   if (size === "any" || size === "") {
     // We want icons without size specified to sorted
     // as the largest available icons
     return Number.MAX_SAFE_INTEGER;
--- a/dom/manifest/ManifestObtainer.jsm
+++ b/dom/manifest/ManifestObtainer.jsm
@@ -20,26 +20,19 @@
  *   dom/ipc/manifestMessages.js
  *
  * Which is injected into every browser instance via browser.js.
  *
  * exported ManifestObtainer
  */
 /* globals Components, Task, PromiseMessage, XPCOMUtils, ManifestProcessor, BrowserUtils*/
 "use strict";
-const {
-  utils: Cu,
-  classes: Cc,
-  interfaces: Ci,
-} = Components;
+
 ChromeUtils.import("resource://gre/modules/PromiseMessage.jsm");
-ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/ManifestProcessor.jsm");
-ChromeUtils.defineModuleGetter(this, "BrowserUtils", // jshint ignore:line
-  "resource://gre/modules/BrowserUtils.jsm");
 
 var ManifestObtainer = { // jshint ignore:line
   /**
   * Public interface for obtaining a web manifest from a XUL browser, to use
   * on the parent process.
   * @param  {XULBrowser} The browser to check for the manifest.
   * @return {Promise<Object>} The processed manifest.
   */
--- a/dom/manifest/ManifestProcessor.jsm
+++ b/dom/manifest/ManifestProcessor.jsm
@@ -16,19 +16,17 @@
  * icons and splash_screens.
  *
  * TODO: The constructor should accept the UA's supported orientations.
  * TODO: The constructor should accept the UA's supported display modes.
  * TODO: hook up developer tools to console. (1086997).
  */
 /* globals Components, ValueExtractor, ImageObjectProcessor, ConsoleAPI*/
 "use strict";
-const {
-  utils: Cu,
-} = Components;
+
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyGlobalGetters(this, ["URL"]);
 const displayModes = new Set(["fullscreen", "standalone", "minimal-ui",
   "browser",
 ]);
 const orientationTypes = new Set(["any", "natural", "landscape", "portrait",
   "portrait-primary", "portrait-secondary", "landscape-primary",
   "landscape-secondary",
--- a/dom/manifest/ValueExtractor.jsm
+++ b/dom/manifest/ValueExtractor.jsm
@@ -2,21 +2,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
 /*
  * Helper functions extract values from manifest members
  * and reports conformance violations.
  */
 /* globals Components*/
 "use strict";
-const {
-  classes: Cc,
-  interfaces: Ci,
-  utils: Cu,
-} = Components;
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyGlobalGetters(this, ["InspectorUtils"]);
 
 function ValueExtractor(aConsole, aBundle) {
   this.console = aConsole;
   this.domBundle = aBundle;
--- a/dom/manifest/test/browser_ManifestIcons_browserFetchIcon.js
+++ b/dom/manifest/test/browser_ManifestIcons_browserFetchIcon.js
@@ -2,29 +2,29 @@
 /* global Cu, BrowserTestUtils, ok, add_task, gBrowser */
 "use strict";
 const { ManifestIcons } = ChromeUtils.import("resource://gre/modules/ManifestIcons.jsm", {});
 const { ManifestObtainer } = ChromeUtils.import("resource://gre/modules/ManifestObtainer.jsm", {});
 
 const defaultURL = new URL("http://example.org/browser/dom/manifest/test/resource.sjs");
 defaultURL.searchParams.set("Content-Type", "application/manifest+json");
 
-const manifest = JSON.stringify({
+const manifestMock = JSON.stringify({
   icons: [{
     sizes: "50x50",
     src: "red-50.png?Content-type=image/png",
   }, {
     sizes: "150x150",
     src: "blue-150.png?Content-type=image/png",
   }],
 });
 
-function makeTestURL(manifest) {
+function makeTestURL() {
   const url = new URL(defaultURL);
-  const body = `<link rel="manifest" href='${defaultURL}&body=${manifest}'>`;
+  const body = `<link rel="manifest" href='${defaultURL}&body=${manifestMock}'>`;
   url.searchParams.set("Content-Type", "text/html; charset=utf-8");
   url.searchParams.set("body", encodeURIComponent(body));
   return url.href;
 }
 
 function getIconColor(icon) {
   return new Promise((resolve, reject) => {
     const canvas = content.document.createElement("canvas");
@@ -37,17 +37,17 @@ function getIconColor(icon) {
     image.onerror = function() {
       reject(new Error("could not create image"));
     };
     image.src = icon;
   });
 }
 
 add_task(async function() {
-  const tabOptions = {gBrowser, url: makeTestURL(manifest)};
+  const tabOptions = {gBrowser, url: makeTestURL()};
   await BrowserTestUtils.withNewTab(tabOptions, async function(browser) {
     const manifest = await ManifestObtainer.browserObtainManifest(browser);
     let icon = await ManifestIcons.browserFetchIcon(browser, manifest, 25);
     let color = await ContentTask.spawn(browser, icon, getIconColor);
     is(color[0], 255, "Fetched red icon");
 
     icon = await ManifestIcons.browserFetchIcon(browser, manifest, 500);
     color = await ContentTask.spawn(browser, icon, getIconColor);
--- a/dom/manifest/test/browser_ManifestObtainer_obtain.js
+++ b/dom/manifest/test/browser_ManifestObtainer_obtain.js
@@ -95,17 +95,17 @@ add_task(async function() {
       url: makeTestURL(test),
     }))
     .reduce((collector, tabOpts) => {
       const promise = BrowserTestUtils.withNewTab(tabOpts, tabOpts.testRunner);
       collector.push(promise);
       return collector;
     }, []);
 
-  const results = await Promise.all(promises);
+  await Promise.all(promises);
 
   function testObtainingManifest(aTest) {
     return async function(aBrowser) {
       try {
         const manifest = await ManifestObtainer.browserObtainManifest(aBrowser);
         aTest.run(manifest);
       } catch (e) {
         aTest.run(e);
--- a/dom/manifest/test/browser_Manifest_install.js
+++ b/dom/manifest/test/browser_Manifest_install.js
@@ -2,30 +2,30 @@
 /* global Cu, BrowserTestUtils, ok, add_task, gBrowser */
 "use strict";
 
 const { Manifests } = ChromeUtils.import("resource://gre/modules/Manifest.jsm", {});
 
 const defaultURL = new URL("http://example.org/browser/dom/manifest/test/resource.sjs");
 defaultURL.searchParams.set("Content-Type", "application/manifest+json");
 
-const manifest = JSON.stringify({short_name: "hello World", scope: "/browser/"});
-const manifestUrl = `${defaultURL}&body=${manifest}`;
+const manifestMock = JSON.stringify({short_name: "hello World", scope: "/browser/"});
+const manifestUrl = `${defaultURL}&body=${manifestMock}`;
 
-function makeTestURL(manifest) {
+function makeTestURL() {
   const url = new URL(defaultURL);
   const body = `<link rel="manifest" href='${manifestUrl}'>`;
   url.searchParams.set("Content-Type", "text/html; charset=utf-8");
   url.searchParams.set("body", encodeURIComponent(body));
   return url.href;
 }
 
 add_task(async function() {
 
-  const tabOptions = {gBrowser, url: makeTestURL(manifest)};
+  const tabOptions = {gBrowser, url: makeTestURL()};
 
   await BrowserTestUtils.withNewTab(tabOptions, async function(browser) {
 
     let manifest = await Manifests.getManifest(browser, manifestUrl);
     is(manifest.installed, false, "We havent installed this manifest yet");
 
     await manifest.install(browser);
     is(manifest.name, "hello World", "Manifest has correct name");
@@ -41,9 +41,8 @@ add_task(async function() {
     let foundManifest = Manifests.findManifestUrl("http://example.org/browser/dom/");
     is(foundManifest, manifestUrl, "Finds manifests within scope");
 
     foundManifest = Manifests.findManifestUrl("http://example.org/");
     is(foundManifest, null, "Does not find manifests outside scope");
   });
 
 });
-
--- a/dom/manifest/test/test_ImageObjectProcessor_sizes.html
+++ b/dom/manifest/test/test_ImageObjectProcessor_sizes.html
@@ -61,23 +61,16 @@ validSizes.forEach(({test, expect}) => {
   testIcon.icons[0].sizes = test;
   data.jsonText = JSON.stringify(testIcon);
   var result = processor.process(data);
   var sizes = result.icons[0].sizes;
   var expected = `Expect sizes to equal ${expect.join(" ")}`;
   is(sizes, expect.join(" "), expected);
 });
 
-var testIcon = {
-  icons: [{
-    src: "test",
-    sizes: undefined,
-  }],
-};
-
 var invalidSizes = ["invalid", "", " ", "16 x 16", "32", "21", "16xx16", "16 x x 6"];
 invalidSizes.forEach((invalidSize) => {
   var expected = "Expect invalid sizes to return undefined.";
   testIcon.icons[0].sizes = invalidSize;
   data.jsonText = JSON.stringify(testIcon);
   var result = processor.process(data);
   var sizes = result.icons[0].sizes;
   is(sizes, undefined, expected);
--- a/dom/manifest/test/test_ImageObjectProcessor_src.html
+++ b/dom/manifest/test/test_ImageObjectProcessor_src.html
@@ -10,16 +10,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script src="common.js"></script>
   <script>
 /**
  * Image object's src member
  * https://w3c.github.io/manifest/#src-member
  **/
 "use strict";
+
 var noSrc = {
   icons: [{}, {
     src: [],
   }, {
     src: {},
   }, {
     src: null,
   }, {
@@ -48,59 +49,62 @@ var invalidSrc = {
     src: {},
   }, {
     src: true,
   }, {
     src: "",
   }],
 };
 
-var expected = `Expect icons with invalid src prop to be filtered out.`;
-data.jsonText = JSON.stringify(noSrc);
-var result = processor.process(data);
+expected = `Expect icons with invalid src prop to be filtered out.`;
+data.jsonText = JSON.stringify(invalidSrc);
+result = processor.process(data);
 is(result.icons.length, 0, expected);
 
-var expected = `Expect icon's src to be a string.`;
+expected = `Expect icon's src to be a string.`;
 var withSrc = {
   icons: [{
     src: "pass",
   }],
 };
 data.jsonText = JSON.stringify(withSrc);
-var result = processor.process(data);
+result = processor.process(data);
 is(typeof result.icons[0].src, "string", expected);
 
-var expected = `Expect only icons with a src prop to be kept.`;
-var withSrc = {
+
+expected = `Expect only icons with a src prop to be kept.`;
+withSrc = {
   icons: [{
     src: "pass",
   }, {
     src: "pass",
   }, {}, {
     foo: "foo",
   }],
 };
 data.jsonText = JSON.stringify(withSrc);
-var result = processor.process(data);
+result = processor.process(data);
 is(result.icons.length, 2, expected);
 
 var expectedURL = new URL("pass", manifestURL);
 for (var icon of result.icons) {
-  var expected = `Expect src prop to be ${expectedURL.toString()}`;
+  expected = `Expect src prop to be ${expectedURL.toString()}`;
   is(icon.src.toString(), expectedURL.toString(), expected);
 }
 
+
 // Resolve URLs relative to manfiest
 var URLs = ["path", "/path", "../../path"];
 
 URLs.forEach((url) => {
-  var expected = `Resolve icon src URLs relative to manifest.`;
+  expected = `Resolve icon src URLs relative to manifest.`;
   data.jsonText = JSON.stringify({
     icons: [{
       src: url,
     }],
   });
   var absURL = new URL(url, manifestURL).toString();
-  var result = processor.process(data);
+  result = processor.process(data);
   is(result.icons[0].src.toString(), absURL, expected);
 });
+
   </script>
 </head>
--- a/dom/manifest/test/test_ManifestProcessor_icons.html
+++ b/dom/manifest/test/test_ManifestProcessor_icons.html
@@ -18,13 +18,13 @@ https://bugzilla.mozilla.org/show_bug.cg
 "use strict";
 
 typeTests.forEach((type) => {
   var expected = `Expect non-array icons to be empty array: ${typeof type}.`;
   data.jsonText = JSON.stringify({
     icons: type,
   });
   var result = processor.process(data);
-  var y = SpecialPowers.unwrap(result.icons);
+  SpecialPowers.unwrap(result.icons);
   is(result.icons.length, 0, expected);
 });
   </script>
 </head>
--- a/dom/manifest/test/test_ManifestProcessor_lang.html
+++ b/dom/manifest/test/test_ManifestProcessor_lang.html
@@ -11,16 +11,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 <script>
 /**
  * lang member
  * https://w3c.github.io/manifest/#lang-member
  **/
 /* globals is, typeTests, data, processor, seperators, lineTerminators, todo_is*/
 "use strict";
 // Type checks: checks that only strings are accepted.
+
 for (var type of typeTests) {
   var expected = `Expect non-string to be undefined.`;
   data.jsonText = JSON.stringify({
     lang: type,
   });
   var result = processor.process(data);
   is(result.lang, undefined, expected);
 }
@@ -47,66 +48,72 @@ var validTags = [
   "jp-JS", "pt-PT", "pt-BR", "de-CH", "de-DE-1901", "es-419", "sl-IT-nedis",
   "en-US-boont", "mn-Cyrl-MN", "x-fr-CH", "sr-Cyrl", "sr-Latn",
   "hy-Latn-IT-arevela", "zh-TW", "en-GB-boont-r-extended-sequence-x-private",
   "zh-nan-hans-bu-variant2-variant1-u-ca-chinese-t-zh-latn-x-private",
   "zh-cmn-Hans-CN", "cmn-Hans-CN", "zh-yue-HK", "yue-HK",
   "de-CH-x-phonebk", "az-Arab-x-AZE-derbend", "x-whatever",
   "qaa-Qaaa-QM-x-southern",
 ];
+
+
 for (var tag of validTags) {
-  var expected = `Expect lang to be ${tag}.`;
+  expected = `Expect lang to be ${tag}.`;
   data.jsonText = JSON.stringify({
     lang: tag,
   });
-  var result = processor.process(data);
+  result = processor.process(data);
   is(result.lang, tag, expected);
 }
 
+
+
 // trim tests - check that language tags get trimmed properly.
-for (var tag of validTags) {
-  var expected = `Expect trimmed tag to be returned.`;
+for (tag of validTags) {
+  expected = `Expect trimmed tag to be returned.`;
   var expandedtag = seperators + lineTerminators + tag;
   expandedtag += lineTerminators + seperators;
   data.jsonText = JSON.stringify({
     lang: expandedtag,
   });
-  var result = processor.process(data);
+  result = processor.process(data);
   is(result.lang, tag, expected);
 }
 
 // Invalid language tags, derived from BCP-47 and made up.
 var invalidTags = [
-  "de-419-DE", " a-DE ", "ar-a-aaa-b-bbb-a-ccc", "sdafsdfaadsfdsf", "i",
-  "i-phone", "en US", "EN-*-US-JP", "JA-INVALID-TAG", "123123123",
+"de-419-DE", " a-DE ", "ar-a-aaa-b-bbb-a-ccc", "sdafsdfaadsfdsf", "i",
+"i-phone", "en US", "EN-*-US-JP", "JA-INVALID-TAG", "123123123",
 ];
+
+
 for (var item of invalidTags) {
-  var expected = `Expect invalid tag (${item}) to be treated as undefined.`;
+  expected = `Expect invalid tag (${item}) to be treated as undefined.`;
   data.jsonText = JSON.stringify({
     lang: item,
   });
-  var result = processor.process(data);
+  result = processor.process(data);
   todo_is(result.lang, undefined, expected);
 }
 
 // Canonical form conversion tests. We convert the following tags, which are in
 // canonical form, to upper case and expect the processor to return them
 // in canonical form.
 var canonicalTags = [
-  "jp-JS", "pt-PT", "pt-BR", "de-CH", "de-DE-1901", "es-419", "sl-IT-nedis",
-  "en-US-boont", "mn-Cyrl-MN", "x-fr-CH", "sr-Cyrl", "sr-Latn",
-  "hy-Latn-IT-arevela", "zh-TW", "en-GB-boont-r-extended-sequence-x-private",
-  "zh-cmn-Hans-CN", "cmn-Hans-CN", "zh-yue-HK", "yue-HK",
-  "de-CH-x-phonebk", "az-Arab-x-AZE-derbend", "x-whatever",
-  "qaa-Qaaa-QM-x-southern",
+"jp-JS", "pt-PT", "pt-BR", "de-CH", "de-DE-1901", "es-419", "sl-IT-nedis",
+"en-US-boont", "mn-Cyrl-MN", "x-fr-CH", "sr-Cyrl", "sr-Latn",
+"hy-Latn-IT-arevela", "zh-TW", "en-GB-boont-r-extended-sequence-x-private",
+"zh-cmn-Hans-CN", "cmn-Hans-CN", "zh-yue-HK", "yue-HK",
+"de-CH-x-phonebk", "az-Arab-x-AZE-derbend", "x-whatever",
+"qaa-Qaaa-QM-x-southern",
 ];
 
-for (var tag of canonicalTags) {
+for (tag of canonicalTags) {
   var uppedTag = tag.toUpperCase();
-  var expected = `Expect tag (${uppedTag}) to be in canonical form (${tag}).`;
+  expected = `Expect tag (${uppedTag}) to be in canonical form (${tag}).`;
   data.jsonText = JSON.stringify({
     lang: uppedTag,
   });
-  var result = processor.process(data);
+  result = processor.process(data);
   todo_is(result.lang, tag, expected);
 }
 
 </script>
--- a/dom/manifest/test/test_ManifestProcessor_scope.html
+++ b/dom/manifest/test/test_ManifestProcessor_scope.html
@@ -5,85 +5,87 @@ https://bugzilla.mozilla.org/show_bug.cg
 -->
 <head>
   <meta charset="utf-8">
   <title>Test for Bug 1079453</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script src="common.js"></script>
   <script>
+
 /**
  * Manifest scope
  * https://w3c.github.io/manifest/#scope-member
  **/
 "use strict";
+
 var expected = "Expect non-string scope to be undefined";
 typeTests.forEach((type) => {
   data.jsonText = JSON.stringify({
     scope: type,
   });
   var result = processor.process(data);
   is(result.scope, undefined, expected);
 });
 
-var expected = "Expect different origin to be treated as undefined";
+expected = "Expect different origin to be treated as undefined";
 data.jsonText = JSON.stringify({
   scope: "http://not-same-origin",
 });
 var result = processor.process(data);
 is(result.scope, undefined, expected);
 
-var expected = "Expect the empty string to be treated as undefined.";
+expected = "Expect the empty string to be treated as undefined.";
 data.jsonText = JSON.stringify({
   scope: "",
 });
-var result = processor.process(data);
+result = processor.process(data);
 is(result.scope, undefined, expected);
 
-var expected = "Resolve URLs relative to manifest.";
+expected = "Resolve URLs relative to manifest.";
 var URLs = ["path", "/path", "../../path"];
 URLs.forEach((url) => {
   data.jsonText = JSON.stringify({
     scope: url,
     start_url: "/path",
   });
   var absURL = new URL(url, manifestURL).toString();
-  var result = processor.process(data);
+  result = processor.process(data);
   is(result.scope, absURL, expected);
 });
 
-var expected = "If start URL is not in scope, return undefined.";
+expected = "If start URL is not in scope, return undefined.";
 data.jsonText = JSON.stringify({
   scope: "foo",
   start_url: "bar",
 });
-var result = processor.process(data);
+result = processor.process(data);
 is(result.scope, undefined, expected);
 
-var expected = "If start URL is in scope, use the scope.";
+expected = "If start URL is in scope, use the scope.";
 data.jsonText = JSON.stringify({
   start_url: "foobar",
   scope: "foo",
 });
-var result = processor.process(data);
+result = processor.process(data);
 is(result.scope.toString(), new URL("foo", manifestURL).toString(), expected);
 
-var expected = "Expect start_url to be " + new URL("foobar", manifestURL).toString();
+expected = "Expect start_url to be " + new URL("foobar", manifestURL).toString();
 is(result.start_url.toString(), new URL("foobar", manifestURL).toString(), expected);
 
-var expected = "If start URL is in scope, use the scope.";
+expected = "If start URL is in scope, use the scope.";
 data.jsonText = JSON.stringify({
   start_url: "/foo/",
   scope: "/foo/",
 });
-var result = processor.process(data);
+result = processor.process(data);
 is(result.scope.toString(), new URL("/foo/", manifestURL).toString(), expected);
 
-var expected = "If start URL is in scope, use the scope.";
+expected = "If start URL is in scope, use the scope.";
 data.jsonText = JSON.stringify({
   start_url: ".././foo/",
   scope: "../foo/",
 });
-var result = processor.process(data);
+result = processor.process(data);
 is(result.scope.toString(), new URL("/foo/", manifestURL).toString(), expected);
 
   </script>
 </head>
--- a/dom/manifest/test/test_ManifestProcessor_start_url.html
+++ b/dom/manifest/test/test_ManifestProcessor_start_url.html
@@ -28,32 +28,35 @@ typeTests.forEach((type) => {
 var expected = `Expect different origin URLs to become document's URL.`;
 data.jsonText = JSON.stringify({
   start_url: "http://not-same-origin",
 });
 var result = processor.process(data);
 is(result.start_url.toString(), docURL.toString(), expected);
 
 // Empty string test
-var expected = `Expect empty string for start_url to become document's URL.`;
+expected = `Expect empty string for start_url to become document's URL.`;
 data.jsonText = JSON.stringify({
   start_url: "",
 });
-var result = processor.process(data);
+result = processor.process(data);
 is(result.start_url.toString(), docURL.toString(), expected);
 
+
 // Resolve URLs relative to manfiest
 var URLs = ["path", "/path", "../../path",
   `${whiteSpace}path${whiteSpace}`,
   `${whiteSpace}/path`,
   `${whiteSpace}../../path`,
 ];
+
 URLs.forEach((url) => {
-  var expected = `Resolve URLs relative to manifest.`;
+  expected = `Resolve URLs relative to manifest.`;
   data.jsonText = JSON.stringify({
     start_url: url,
   });
   var absURL = new URL(url, manifestURL).toString();
-  var result = processor.process(data);
+  result = processor.process(data);
   is(result.start_url.toString(), absURL, expected);
 });
+
   </script>
 </head>
--- a/dom/manifest/test/test_window_onappinstalled_event.html
+++ b/dom/manifest/test/test_window_onappinstalled_event.html
@@ -49,17 +49,18 @@ https://bugzilla.mozilla.org/show_bug.cg
   function checkImplementation(ifrWindow) {
     return new Promise((resolve, reject) => {
       const hasOnAppInstalledProp = ifrWindow.hasOwnProperty("onappinstalled");
       ok(hasOnAppInstalledProp, "window has own onappinstalled property");
 
       // no point in continuing
       if (!hasOnAppInstalledProp) {
         const err = new Error("No 'onappinstalled' IDL attribute. Aborting early.");
-        return reject(err);
+        reject(err);
+        return;
       }
       is(ifrWindow.onappinstalled, null, "window install is initially set to null");
 
       // Check that enumerable, configurable, and has a getter and setter.
       const objDescriptor = Object.getOwnPropertyDescriptor(ifrWindow, "onappinstalled");
       ok(objDescriptor.enumerable, "is enumerable");
       ok(objDescriptor.configurable, "is configurable");
       ok(objDescriptor.hasOwnProperty("get"), "has getter");