Bug 1363795 - Enable some Mozilla ESLint recommended rules for dom/indexedDB/test (no-undef). r=bevis
authorMark Banner <standard8@mozilla.com>
Wed, 10 May 2017 17:05:18 +0100
changeset 359167 be00938a685295f9bd6bf5e958c0e799e6afad45
parent 359166 c5796625b53511446c57e98d2555292c0a2410bd
child 359168 ab9b62e22a5d35a99f9f25c9aefaa8e92fb8e1f6
push id42991
push usermbanner@mozilla.com
push dateFri, 19 May 2017 06:25:17 +0000
treeherderautoland@de859ae64421 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbevis
bugs1363795
milestone55.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 1363795 - Enable some Mozilla ESLint recommended rules for dom/indexedDB/test (no-undef). r=bevis MozReview-Commit-ID: G6uRTV9i0uX
dom/indexedDB/test/.eslintrc.js
dom/indexedDB/test/blob_worker_crash_iframe.html
dom/indexedDB/test/browserHelpers.js
dom/indexedDB/test/browser_forgetThisSiteAdd.html
dom/indexedDB/test/browser_forgetThisSiteGet.html
dom/indexedDB/test/browser_permissionsPrompt.html
dom/indexedDB/test/browser_permissionsSharedWorker.html
dom/indexedDB/test/browser_permissionsSharedWorker.js
dom/indexedDB/test/browser_permissionsWorker.html
dom/indexedDB/test/browser_permissionsWorker.js
dom/indexedDB/test/chromeHelpers.js
dom/indexedDB/test/file.js
dom/indexedDB/test/helpers.js
dom/indexedDB/test/test_bfcache.html
dom/indexedDB/test/test_blob_simple.html
dom/indexedDB/test/test_blob_worker_crash.html
dom/indexedDB/test/test_blob_worker_xhr_post.html
dom/indexedDB/test/test_blob_worker_xhr_post_multifile.html
dom/indexedDB/test/test_blob_worker_xhr_read.html
dom/indexedDB/test/test_blob_worker_xhr_read_slice.html
dom/indexedDB/test/test_file_array.html
dom/indexedDB/test/test_file_cross_database_copying.html
dom/indexedDB/test/test_file_delete.html
dom/indexedDB/test/test_file_os_delete.html
dom/indexedDB/test/test_file_put_deleted.html
dom/indexedDB/test/test_file_put_get_object.html
dom/indexedDB/test/test_file_put_get_values.html
dom/indexedDB/test/test_file_replace.html
dom/indexedDB/test/test_file_resurrection_delete.html
dom/indexedDB/test/test_file_resurrection_transaction_abort.html
dom/indexedDB/test/test_file_sharing.html
dom/indexedDB/test/test_file_transaction_abort.html
dom/indexedDB/test/test_filehandle_compat.html
dom/indexedDB/test/test_filehandle_disabled_pref.html
dom/indexedDB/test/test_filehandle_getFile.html
dom/indexedDB/test/test_filehandle_iteration.html
dom/indexedDB/test/test_filehandle_lifetimes.html
dom/indexedDB/test/test_filehandle_lifetimes_nested.html
dom/indexedDB/test/test_filehandle_location.html
dom/indexedDB/test/test_filehandle_ordering.html
dom/indexedDB/test/test_filehandle_overlapping.html
dom/indexedDB/test/test_filehandle_progress_events.html
dom/indexedDB/test/test_filehandle_readonly_exceptions.html
dom/indexedDB/test/test_filehandle_request_readyState.html
dom/indexedDB/test/test_filehandle_serialization.html
dom/indexedDB/test/test_filehandle_store_snapshot.html
dom/indexedDB/test/test_filehandle_stream_tracking.html
dom/indexedDB/test/test_filehandle_success_events_after_abort.html
dom/indexedDB/test/test_filehandle_truncate.html
dom/indexedDB/test/test_filehandle_workers.html
dom/indexedDB/test/test_filehandle_write_read_data.html
dom/indexedDB/test/test_getFileId.html
dom/indexedDB/test/test_globalObjects_content.html
dom/indexedDB/test/test_leaving_page.html
dom/indexedDB/test/test_message_manager_ipc.html
dom/indexedDB/test/test_open_for_principal.html
dom/indexedDB/test/test_persistenceType.html
dom/indexedDB/test/test_sandbox.html
dom/indexedDB/test/unit/.eslintrc.js
tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
new file mode 100644
--- /dev/null
+++ b/dom/indexedDB/test/.eslintrc.js
@@ -0,0 +1,29 @@
+"use strict";
+
+module.exports = {
+  "extends": [
+    "plugin:mozilla/recommended",
+    "plugin:mozilla/browser-test",
+    "plugin:mozilla/chrome-test",
+    "plugin:mozilla/mochitest-test",
+  ],
+  "plugins": [
+    "mozilla"
+  ],
+  "rules": {
+    "brace-style": "off",
+    "consistent-return": "off",
+    "key-spacing": "off",
+    "keyword-spacing": "off",
+    "no-extra-semi": "off",
+    "no-native-reassign": "off",
+    "no-shadow": "off",
+    "no-trailing-spaces": "off",
+    "no-unused-vars": "off",
+    "object-shorthand": "off",
+    "quotes": "off",
+    "spaced-comment": "off",
+    "space-before-blocks": "off",
+    "space-before-function-paren": "off",
+  }
+};
--- a/dom/indexedDB/test/blob_worker_crash_iframe.html
+++ b/dom/indexedDB/test/blob_worker_crash_iframe.html
@@ -47,16 +47,17 @@ dump("EXCEPTION IN CREATION: " + e + "\n
     }
 
     function fetchedBlobCreateWorkerAndSendBlob(event) {
       var idbBlob = event.target.result.blob;
       var compositeBlob = new Blob(['I like the following blob: ', idbBlob],
                                    { type: "text/fancy" });
 
       function workerScript() {
+        /* eslint-env worker */
         onmessage = function(event) {
           // Save the Blob to the worker's global scope.
           self.holdOntoBlob = event.data;
           // Send any message so we can serialize and keep our runtime behaviour
           // consistent.
           postMessage('kung fu death grip established');
         }
       }
--- a/dom/indexedDB/test/browserHelpers.js
+++ b/dom/indexedDB/test/browserHelpers.js
@@ -1,13 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
+// testSteps is expected to be defined by the file including this file.
+/* global testSteps */
+
 var testGenerator = testSteps();
 
 var testResult;
 var testException;
 
 function runTest()
 {
   testGenerator.next();
--- a/dom/indexedDB/test/browser_forgetThisSiteAdd.html
+++ b/dom/indexedDB/test/browser_forgetThisSiteAdd.html
@@ -2,16 +2,17 @@
   Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/
 -->
 <html>
   <head>
     <title>Indexed Database Test</title>
 
     <script type="text/javascript">
+      /* import-globals-from browserHelpers.js */
       function* testSteps()
       {
         let request = indexedDB.open("browser_forgetThisSite.js", 11);
         request.onerror = grabEventAndContinueHandler;
         request.onupgradeneeded = grabEventAndContinueHandler;
         let event = yield undefined;
 
         if (event.type == "error") {
--- a/dom/indexedDB/test/browser_forgetThisSiteGet.html
+++ b/dom/indexedDB/test/browser_forgetThisSiteGet.html
@@ -2,16 +2,17 @@
   Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/
 -->
 <html>
   <head>
     <title>Indexed Database Test</title>
 
     <script type="text/javascript">
+      /* import-globals-from browserHelpers.js */
       function* testSteps()
       {
         let request = indexedDB.open("browser_forgetThisSite.js");
         request.onerror = grabEventAndContinueHandler;
         request.onsuccess = grabEventAndContinueHandler;
         let event = yield undefined;
 
         if (event.type == "error") {
--- a/dom/indexedDB/test/browser_permissionsPrompt.html
+++ b/dom/indexedDB/test/browser_permissionsPrompt.html
@@ -3,16 +3,17 @@
   http://creativecommons.org/publicdomain/zero/1.0/
 -->
 <html>
   <head>
     <meta charset=UTF-8>
     <title>Indexed Database Test</title>
 
     <script type="text/javascript">
+      /* import-globals-from browserHelpers.js */
       function* testSteps()
       {
         const name = window.location.pathname;
 
         let request = indexedDB.open(name, { version: 1,
                                              storage: "persistent" });
         request.onerror = grabEventAndContinueHandler;
         request.onsuccess = grabEventAndContinueHandler;
--- a/dom/indexedDB/test/browser_permissionsSharedWorker.html
+++ b/dom/indexedDB/test/browser_permissionsSharedWorker.html
@@ -2,16 +2,18 @@
   Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/
 -->
 <html>
   <head>
     <title>Indexed Database Test</title>
 
     <script type="text/javascript">
+    // testFinishedCallback is expected to be set in the scope by head.js.
+    /* global testFinishedCallback */
     let testIsIDBDatabase;
     let testException;
 
     function runTest() {
       let w = new SharedWorker('browser_permissionsSharedWorker.js');
       w.port.onmessage = function(e) {
         if (e.data.status == 'success') {
           testIsIDBDatabase = e.data.isIDBDatabase;
--- a/dom/indexedDB/test/browser_permissionsSharedWorker.js
+++ b/dom/indexedDB/test/browser_permissionsSharedWorker.js
@@ -1,8 +1,10 @@
+/* eslint-env worker */
+
 onconnect = function(e) {
   e.ports[0].onmessage = function(e) {
     var request = indexedDB.open(e.data, { version: 1,
                                            storage: "persistent" });
     request.onsuccess = function(event) {
       e.target.postMessage({ status: 'success',
                              isIDBDatabase: (event.target.result instanceof IDBDatabase) });
     }
--- a/dom/indexedDB/test/browser_permissionsWorker.html
+++ b/dom/indexedDB/test/browser_permissionsWorker.html
@@ -2,16 +2,18 @@
   Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/
 -->
 <html>
   <head>
     <title>Indexed Database Test</title>
 
     <script type="text/javascript">
+    // testFinishedCallback is expected to be set in the scope by head.js.
+    /* global testFinishedCallback */
     let testIsIDBDatabase;
     let testException;
 
     function runTest() {
       let w = new Worker('browser_permissionsWorker.js');
       w.onmessage = function(e) {
         if (e.data.status == 'success') {
           testIsIDBDatabase = e.data.isIDBDatabase;
--- a/dom/indexedDB/test/browser_permissionsWorker.js
+++ b/dom/indexedDB/test/browser_permissionsWorker.js
@@ -1,8 +1,10 @@
+/* eslint-env worker */
+
 onmessage = function(e) {
   var request = indexedDB.open(e.data, { version: 1,
                                          storage: "persistent" });
   request.onsuccess = function(event) {
     postMessage({ status: 'success',
                   isIDBDatabase: (event.target.result instanceof IDBDatabase) });
   }
 
--- a/dom/indexedDB/test/chromeHelpers.js
+++ b/dom/indexedDB/test/chromeHelpers.js
@@ -1,15 +1,18 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 var { 'classes': Cc, 'interfaces': Ci, 'utils': Cu } = Components;
 
+// testSteps is expected to be defined by the file including this file.
+/* global testSteps */
+
 var testGenerator = testSteps();
 
 if (!window.runTest) {
   window.runTest = function()
   {
     SimpleTest.waitForExplicitFinish();
 
     testGenerator.next();
--- a/dom/indexedDB/test/file.js
+++ b/dom/indexedDB/test/file.js
@@ -1,13 +1,15 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
+/* import-globals-from helpers.js */
+
 var bufferCache = [];
 var utils = SpecialPowers.getDOMWindowUtils(window);
 
 function getBuffer(size)
 {
   let buffer = new ArrayBuffer(size);
   is(buffer.byteLength, size, "Correct byte length");
   return buffer;
--- a/dom/indexedDB/test/helpers.js
+++ b/dom/indexedDB/test/helpers.js
@@ -1,13 +1,16 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
+// testSteps is expected to be defined by the test using this file.
+/* global testSteps:false */
+
 var testGenerator = testSteps();
 // The test js is shared between xpcshell (which has no SpecialPowers object)
 // and content mochitests (where the |Components| object is accessible only as
 // SpecialPowers.Components). Expose Components if necessary here to make things
 // work everywhere.
 //
 // Even if the real |Components| doesn't exist, we might shim in a simple JS
 // placebo for compat. An easy way to differentiate this from the real thing
@@ -183,17 +186,17 @@ function* testHarnessSteps() {
     worker.terminate();
     worker = null;
 
     clearAllDatabases(nextTestHarnessStep);
     yield undefined;
   } else if (testScriptFilename) {
     todo(false,
          "Skipping test in a worker because it is explicitly disabled: " +
-         disableWorkerTest);
+         window.disableWorkerTest);
   } else {
     todo(false,
          "Skipping test in a worker because it's not structured properly");
   }
 
   info("Running test in main thread");
 
   // Now run the test script in the main thread.
--- a/dom/indexedDB/test/test_bfcache.html
+++ b/dom/indexedDB/test/test_bfcache.html
@@ -4,16 +4,17 @@
 -->
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script type="text/javascript">
+    /* import-globals-from helpers.js */
     var gOrigMaxTotalViewers = undefined;
     function setCachePref(enabled) {
       if (enabled) {
         is(typeof gOrigMaxTotalViewers, "undefined",
            "don't double-enable bfcache");
         SpecialPowers.setBoolPref("browser.sessionhistory.cache_subframes",
                                   true);
         gOrigMaxTotalViewers =
@@ -39,17 +40,17 @@
       setCachePref(true);
       window.onmessage = grabEventAndContinueHandler;
 
       iframe.src = "bfcache_iframe1.html";
       var event = yield undefined;
       is(event.data, "go", "set up database successfully");
 
       iframe.src = "bfcache_iframe2.html";
-      res = JSON.parse((yield).data);
+      let res = JSON.parse((yield).data);
       is(res.version, 2, "version was set correctly");
       is(res.storeCount, 1, "correct set of stores");
       ok(!("blockedFired" in res), "blocked shouldn't fire");
       is(res.value, JSON.stringify({ hello: "world" }),
          "correct value found in store");
 
       setCachePref(false);
       finishTest();
--- a/dom/indexedDB/test/test_blob_simple.html
+++ b/dom/indexedDB/test/test_blob_simple.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     info("Setting up test fixtures: create an IndexedDB database and object store.");
 
     let request = indexedDB.open(window.location.pathname, 1);
     request.onerror = errorHandler;
     request.onupgradeneeded = grabEventAndContinueHandler;
     request.onsuccess = unexpectedSuccessHandler;
@@ -202,16 +203,17 @@
     event = yield undefined;
 
     is(event.target.result, BLOB_DATA[0], "Correct text");
 
 
     info("Send blob to a worker, read its contents there, and verify results.");
 
     function workerScript() {
+      /* eslint-env worker */
       onmessage = function(event) {
         var reader = new FileReaderSync();
         postMessage(reader.readAsText(event.data));
 
         var slice = event.data.slice(1, 2);
         postMessage(reader.readAsText(slice));
 
       }
--- a/dom/indexedDB/test/test_blob_worker_crash.html
+++ b/dom/indexedDB/test/test_blob_worker_crash.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Blob Worker Crash Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   /*
    * This tests ensures that if the last live reference to a Blob is on the
    * worker and the database has already been shutdown, that there is no crash
    * when the owning page gets cleaned up which causes the termination of the
    * worker which in turn garbage collects during its shutdown.
    *
    * We do the IndexedDB stuff in the iframe so we can kill it as part of our
    * test.  Doing it out here is no good.
--- a/dom/indexedDB/test/test_blob_worker_xhr_post.html
+++ b/dom/indexedDB/test/test_blob_worker_xhr_post.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const BLOB_DATA = ["fun ", "times ", "all ", "around!"];
     const BLOB_TYPE = "text/plain";
     const BLOB_SIZE = BLOB_DATA.join("").length;
 
     info("Setting up");
 
@@ -66,16 +67,17 @@
 
     ok(slice instanceof Blob, "Slice returned a blob");
     is(slice.size, BLOB_DATA[0].length, "Correct size for slice");
     is(slice.type, BLOB_TYPE, "Correct type for slice");
 
     info("Sending slice to a worker");
 
     function workerScript() {
+      /* eslint-env worker */
       onmessage = function(event) {
         var blob = event.data;
         var xhr = new XMLHttpRequest();
         // We just want to make sure the error case doesn't fire; it's fine for
         // us to just want a 404.
         xhr.open('POST', 'http://mochi.test:8888/does-not-exist', true);
         xhr.onload = function() {
           postMessage({ status: xhr.status });
--- a/dom/indexedDB/test/test_blob_worker_xhr_post_multifile.html
+++ b/dom/indexedDB/test/test_blob_worker_xhr_post_multifile.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   /**
    * Create a composite/multi-file Blob on the worker, then post it as an XHR
    * payload and ensure that we don't hang/generate an assertion/etc. but
    * instead generate the expected 404.  This test is basically the same as
    * test_blob_worker_xhr_post.html except for the composite Blob.
    */
   function* testSteps()
   {
@@ -64,16 +65,17 @@
 
     blob = event.target.result;
 
     ok(blob instanceof Blob, "Got a blob");
     is(blob.size, BLOB_SIZE, "Correct size");
     is(blob.type, BLOB_TYPE, "Correct type");
 
     function workerScript() {
+      /* eslint-env worker */
       onmessage = function(event) {
         var blob = event.data;
         var compositeBlob = new Blob(["preceding string. ", blob],
                                      { type: "text/plain" });
         var xhr = new XMLHttpRequest();
         // We just want to make sure the error case doesn't fire; it's fine for
         // us to just want a 404.
         xhr.open('POST', 'http://mochi.test:8888/does-not-exist', true);
--- a/dom/indexedDB/test/test_blob_worker_xhr_read.html
+++ b/dom/indexedDB/test/test_blob_worker_xhr_read.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Blob Read From Worker</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   /**
    * Create an IndexedDB-backed Blob, send it to the worker, try and read the
    * contents of the Blob from the worker using an XHR.  Ideally, we don't
    * deadlock the main thread.
    */
   function* testSteps()
   {
     const BLOB_DATA = ["Green"];
@@ -65,16 +66,17 @@
 
     ok(blob instanceof Blob, "Got a blob");
     is(blob.size, BLOB_SIZE, "Correct size");
     is(blob.type, BLOB_TYPE, "Correct type");
 
     info("Sending blob to a worker");
 
     function workerScript() {
+      /* eslint-env worker */
       onmessage = function(event) {
         var blob = event.data;
         var blobUrl = URL.createObjectURL(blob);
         var xhr = new XMLHttpRequest();
         xhr.open('GET', blobUrl, true);
         xhr.responseType = 'text';
         xhr.onload = function() {
           postMessage({ data: xhr.response });
--- a/dom/indexedDB/test/test_blob_worker_xhr_read_slice.html
+++ b/dom/indexedDB/test/test_blob_worker_xhr_read_slice.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Blob Read From Worker</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   /**
    * Create an IndexedDB-backed Blob, send it to the worker, try and read the
    * *SLICED* contents of the Blob from the worker using an XHR.  This is
    * (as of the time of writing this) basically the same as
    * test_blob_worker_xhr_read.html but with slicing added.
    */
   function* testSteps()
   {
@@ -66,16 +67,17 @@
 
     ok(blob instanceof Blob, "Got a blob");
     is(blob.size, BLOB_SIZE, "Correct size");
     is(blob.type, BLOB_TYPE, "Correct type");
 
     info("Sending blob to a worker");
 
     function workerScript() {
+      /* eslint-env worker */
       onmessage = function(event) {
         var blob = event.data;
         var slicedBlob = blob.slice(0, 3, "text/plain");
         var blobUrl = URL.createObjectURL(slicedBlob);
         var xhr = new XMLHttpRequest();
         xhr.open('GET', blobUrl, true);
         xhr.responseType = 'text';
         xhr.onload = function() {
--- a/dom/indexedDB/test/test_file_array.html
+++ b/dom/indexedDB/test/test_file_array.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
     const b1 = getRandomBlob(10000);
 
--- a/dom/indexedDB/test/test_file_cross_database_copying.html
+++ b/dom/indexedDB/test/test_file_cross_database_copying.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const databaseInfo = [
       { name: window.location.pathname + "1" },
       { name: window.location.pathname + "2" }
     ];
@@ -70,17 +72,17 @@
     }
 
     for (let i = 1; i < databases.length; i++) {
       let db = databases[i];
 
       let objectStore = db.transaction([objectStoreName], READ_WRITE)
                           .objectStore(objectStoreName);
 
-      request = objectStore.add(refResult, 2);
+      let request = objectStore.add(refResult, 2);
       request.onsuccess = grabEventAndContinueHandler;
       event = yield undefined;
 
       is(event.target.result, 2, "Got correct key");
 
       request = objectStore.get(2);
       request.onsuccess = grabEventAndContinueHandler;
       event = yield undefined;
--- a/dom/indexedDB/test/test_file_delete.html
+++ b/dom/indexedDB/test/test_file_delete.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
@@ -75,18 +77,18 @@
       request.onsuccess = grabEventAndContinueHandler;
       let event = yield undefined;
 
       is(event.type, "success", "Got correct event type");
 
       let db = event.target.result;
       db.onerror = errorHandler;
 
-      trans = db.transaction([objectStoreName], READ_WRITE);
-      objectStore = trans.objectStore(objectStoreName);
+      let trans = db.transaction([objectStoreName], READ_WRITE);
+      let objectStore = trans.objectStore(objectStoreName);
 
       request = objectStore.get(fileData2.key);
       request.onsuccess = grabEventAndContinueHandler;
       event = yield undefined;
 
       let result = event.target.result;
       ok(result, "Got result");
 
--- a/dom/indexedDB/test/test_file_os_delete.html
+++ b/dom/indexedDB/test/test_file_os_delete.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
--- a/dom/indexedDB/test/test_file_put_deleted.html
+++ b/dom/indexedDB/test/test_file_put_deleted.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   /**
    * Test that a put of a file-backed Blob/File whose backing file has been
    * deleted results in a failure of that put failure.
    *
    * In order to create a file-backed Blob and ensure that we actually try and
    * copy its contents (rather than triggering a reference-count increment), we
    * use two separate databases.  This test is derived from
    * test_file_cross_database_copying.html.
@@ -104,17 +106,17 @@
     // request and transaction.
     info("attempt to store deleted file-backed blob"); // context for NS_WARN_IF
     for (let i = 1; i < databases.length; i++) {
       let db = databases[i];
 
       let trans = db.transaction([objectStoreName], READ_WRITE);
       let objectStore = trans.objectStore(objectStoreName);
 
-      request = objectStore.add(fileBackedFile, 2);
+      let request = objectStore.add(fileBackedFile, 2);
       request.onsuccess = unexpectedSuccessHandler;
       request.onerror = expectedErrorHandler("UnknownError");
       trans.onsuccess = unexpectedSuccessHandler;
       trans.onerror = expectedErrorHandler("UnknownError");
       // the database will also throw an error.
       db.onerror = expectedErrorHandler("UnknownError");
       event = yield undefined;
       event = yield undefined;
@@ -128,17 +130,17 @@
     for (let i = 1; i < databases.length; i++) {
       let db = databases[i];
 
       let objectStore = db.transaction([objectStoreName], "readonly")
                           .objectStore(objectStoreName);
 
       // Attempt to fetch the key to verify there's nothing in the DB rather
       // than the value which could return undefined as a misleading error.
-      request = objectStore.getKey(2);
+      let request = objectStore.getKey(2);
       request.onsuccess = grabEventAndContinueHandler;
       request.onerror = errorHandler;
       event = yield undefined;
 
       let result = event.target.result;
       is(result, undefined, "no key found"); // (the get returns undefined)
     }
 
--- a/dom/indexedDB/test/test_file_put_get_object.html
+++ b/dom/indexedDB/test/test_file_put_get_object.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
--- a/dom/indexedDB/test/test_file_put_get_values.html
+++ b/dom/indexedDB/test/test_file_put_get_values.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
--- a/dom/indexedDB/test/test_file_replace.html
+++ b/dom/indexedDB/test/test_file_replace.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
     const blobData = { key: 42, blobs: [] };
 
--- a/dom/indexedDB/test/test_file_resurrection_delete.html
+++ b/dom/indexedDB/test/test_file_resurrection_delete.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
@@ -77,17 +79,17 @@
       let event = yield undefined;
 
       is(event.type, "success", "Got correct event type");
 
       let db = event.target.result;
       db.onerror = errorHandler;
 
       let trans = db.transaction([objectStoreName], READ_WRITE);
-      objectStore = trans.objectStore(objectStoreName);
+      let objectStore = trans.objectStore(objectStoreName);
 
       request = objectStore.get(fileData.key);
       request.onsuccess = grabEventAndContinueHandler;
       event = yield undefined;
 
       let result = event.target.result;
       ok(result, "Got result");
 
--- a/dom/indexedDB/test/test_file_resurrection_transaction_abort.html
+++ b/dom/indexedDB/test/test_file_resurrection_transaction_abort.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
--- a/dom/indexedDB/test/test_file_sharing.html
+++ b/dom/indexedDB/test/test_file_sharing.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreInfo = [
       { name: "Blobs", options: { } },
--- a/dom/indexedDB/test/test_file_transaction_abort.html
+++ b/dom/indexedDB/test/test_file_transaction_abort.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
--- a/dom/indexedDB/test/test_filehandle_compat.html
+++ b/dom/indexedDB/test/test_filehandle_compat.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
--- a/dom/indexedDB/test/test_filehandle_disabled_pref.html
+++ b/dom/indexedDB/test/test_filehandle_disabled_pref.html
@@ -8,16 +8,18 @@
 
     <script type="text/javascript"
             src="/tests/SimpleTest/SimpleTest.js">
     </script>
 
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
     <script type="text/javascript">
+      /* import-globals-from file.js */
+      /* import-globals-from helpers.js */
       function* testSteps()
       {
         const databaseName = window.location.pathname;
         const databaseVersion = 1;
         const objectStoreName = "foo";
         const mutableFileName = "bar";
         const mutableFileKey = 42;
 
--- a/dom/indexedDB/test/test_filehandle_getFile.html
+++ b/dom/indexedDB/test/test_filehandle_getFile.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
--- a/dom/indexedDB/test/test_filehandle_iteration.html
+++ b/dom/indexedDB/test/test_filehandle_iteration.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const dbName = window.location.pathname;
     const dbVersion = 1;
     const objectStoreName = "foo";
     const entryCount = 10;
 
     let request = indexedDB.open(dbName, dbVersion);
--- a/dom/indexedDB/test/test_filehandle_lifetimes.html
+++ b/dom/indexedDB/test/test_filehandle_lifetimes.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
--- a/dom/indexedDB/test/test_filehandle_lifetimes_nested.html
+++ b/dom/indexedDB/test/test_filehandle_lifetimes_nested.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
--- a/dom/indexedDB/test/test_filehandle_location.html
+++ b/dom/indexedDB/test/test_filehandle_location.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
--- a/dom/indexedDB/test/test_filehandle_ordering.html
+++ b/dom/indexedDB/test/test_filehandle_ordering.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
--- a/dom/indexedDB/test/test_filehandle_overlapping.html
+++ b/dom/indexedDB/test/test_filehandle_overlapping.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
--- a/dom/indexedDB/test/test_filehandle_progress_events.html
+++ b/dom/indexedDB/test/test_filehandle_progress_events.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     var testBuffer = getRandomBuffer(100000);
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
--- a/dom/indexedDB/test/test_filehandle_readonly_exceptions.html
+++ b/dom/indexedDB/test/test_filehandle_readonly_exceptions.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
--- a/dom/indexedDB/test/test_filehandle_request_readyState.html
+++ b/dom/indexedDB/test/test_filehandle_request_readyState.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     is(request.readyState, "pending", "Correct readyState");
 
     request.onerror = errorHandler;
--- a/dom/indexedDB/test/test_filehandle_serialization.html
+++ b/dom/indexedDB/test/test_filehandle_serialization.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const databaseInfo = [
       { name: window.location.pathname + "1" },
       { name: window.location.pathname + "2" }
     ];
--- a/dom/indexedDB/test/test_filehandle_store_snapshot.html
+++ b/dom/indexedDB/test/test_filehandle_store_snapshot.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const READ_WRITE = "readwrite";
 
     const name = window.location.pathname;
 
     const objectStoreName = "Blobs";
 
--- a/dom/indexedDB/test/test_filehandle_stream_tracking.html
+++ b/dom/indexedDB/test/test_filehandle_stream_tracking.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     var testBuffer = getRandomBuffer(100000);
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
--- a/dom/indexedDB/test/test_filehandle_success_events_after_abort.html
+++ b/dom/indexedDB/test/test_filehandle_success_events_after_abort.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     let event = yield undefined;
--- a/dom/indexedDB/test/test_filehandle_truncate.html
+++ b/dom/indexedDB/test/test_filehandle_truncate.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     var testBuffer = getRandomBuffer(100000);
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
--- a/dom/indexedDB/test/test_filehandle_workers.html
+++ b/dom/indexedDB/test/test_filehandle_workers.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     let testBuffer = getRandomBuffer(100000);
 
     let request = indexedDB.open(name, 1);
     request.onerror = errorHandler;
@@ -38,16 +40,17 @@
     request = db.createMutableFile("test.txt");
     request.onerror = errorHandler;
     request.onsuccess = grabEventAndContinueHandler;
     event = yield undefined;
 
     let mutableFile = event.target.result;
 
     function dummyWorkerScript() {
+      /* eslint-env worker */
       onmessage = function(event) {
         throw("Shouldn't be called!");
       }
     }
 
     let url =
       URL.createObjectURL(new Blob(["(", dummyWorkerScript.toSource(), ")()"]));
 
--- a/dom/indexedDB/test/test_filehandle_write_read_data.html
+++ b/dom/indexedDB/test/test_filehandle_write_read_data.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     var testString = "Lorem ipsum his ponderum delicatissimi ne, at noster dolores urbanitas pro, cibo elaboraret no his. Ea dicunt maiorum usu. Ad appareat facilisis mediocritatem eos. Tale graeci mentitum in eos, hinc insolens at nam. Graecis nominavi aliquyam eu vix. Id solet assentior sadipscing pro. Et per atqui graecis, usu quot viris repudiandae ei, mollis evertitur an nam. At nam dolor ignota, liber labore omnesque ea mei, has movet voluptaria in. Vel an impetus omittantur. Vim movet option salutandi ex, ne mei ignota corrumpit. Mucius comprehensam id per. Est ea putant maiestatis.";
     for (let i = 0; i < 5; i++) {
       testString += testString;
     }
--- a/dom/indexedDB/test/test_getFileId.html
+++ b/dom/indexedDB/test/test_getFileId.html
@@ -5,16 +5,18 @@
 <html>
 <head>
   <title>File Handle Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from file.js */
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     let id = getFileId(null);
     ok(id == -1, "Correct id");
 
     id = getFileId(getRandomBlob(100));
     ok(id == -1, "Correct id");
 
--- a/dom/indexedDB/test/test_globalObjects_content.html
+++ b/dom/indexedDB/test/test_globalObjects_content.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     const name = window.location.pathname;
 
     // Test for IDBKeyRange and indexedDB availability in content windows.
     let keyRange = IDBKeyRange.only(42);
     ok(keyRange, "Got keyRange");
 
--- a/dom/indexedDB/test/test_leaving_page.html
+++ b/dom/indexedDB/test/test_leaving_page.html
@@ -10,19 +10,20 @@
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 
 <body onload="runTest();">
   <iframe id="inner"></iframe>
   <a id="a" href="leaving_page_iframe.html"></a>
 
   <script type="text/javascript">
-    onmessage = function(e) {
+    /* import-globals-from helpers.js */
+    window.addEventListener("message", function(e) {
       ok(false, "gotmessage: " + e.data);
-    }
+    });
 
     function* testSteps()
     {
       var iframe = $("inner");
       iframe.src = "leaving_page_iframe.html";
       iframe.onload = continueToNextStep;
       yield undefined;
       is(iframe.contentWindow.location.href, $("a").href,
--- a/dom/indexedDB/test/test_message_manager_ipc.html
+++ b/dom/indexedDB/test/test_message_manager_ipc.html
@@ -6,16 +6,17 @@
     </script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   </head>
   <body onload="setup();">
     <script type="application/javascript">
 "use strict";
 
 function childFrameScript() {
+  /* eslint-env mozilla/frame-script */
   "use strict";
 
   const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
   const mmName = "test:idb-and-mm";
 
   const dbName = "test_message_manager_ipc.html - CHILD";
   const dbVersion = 1;
--- a/dom/indexedDB/test/test_open_for_principal.html
+++ b/dom/indexedDB/test/test_open_for_principal.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+  /* import-globals-from helpers.js */
   function* testSteps()
   {
     is("open" in indexedDB, true, "open() defined");
     is("openForPrincipal" in indexedDB, false, "openForPrincipal() not defined");
 
     is("deleteDatabase" in indexedDB, true, "deleteDatabase() defined");
     is("deleteForPrincipal" in indexedDB, false, "deleteForPrincipal() not defined");
 
--- a/dom/indexedDB/test/test_persistenceType.html
+++ b/dom/indexedDB/test/test_persistenceType.html
@@ -5,16 +5,17 @@
 <html>
 <head>
   <title>Indexed Database Property Test</title>
 
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <script type="text/javascript">
+    /* import-globals-from helpers.js */
     function* testSteps()
     {
       const name = window.location.pathname;
       const version = 1;
       const storages = ["persistent", "temporary", "default"];
 
       const objectStoreName = "Foo";
       const data = { key: 1, value: "bar" };
--- a/dom/indexedDB/test/test_sandbox.html
+++ b/dom/indexedDB/test/test_sandbox.html
@@ -65,16 +65,18 @@ function get(k) {
         tx.onabort = _ => reject(tx.error);
       });
   });
 }
 
 function runInSandbox(sandbox, testFunc) {
   is(typeof testFunc, 'function');
   var resolvePromise;
+  // Step-done is defined in the sandbox and used in the add() function above.
+  /* global step_done */
   var testPromise = new Promise(r => resolvePromise = r);
   SpecialPowers.Cu.exportFunction(_ => resolvePromise(), sandbox,
                                   { defineAs: 'step_done' });
   SpecialPowers.Cu.evalInSandbox('(' + testFunc.toSource() + ')()' +
                                  '.then(step_done);', sandbox);
   return testPromise;
 }
 
--- a/dom/indexedDB/test/unit/.eslintrc.js
+++ b/dom/indexedDB/test/unit/.eslintrc.js
@@ -1,15 +1,13 @@
 "use strict";
 
 module.exports = {
   "extends": [
-    "plugin:mozilla/recommended",
     "plugin:mozilla/xpcshell-test",
   ],
   "plugins": [
     "mozilla"
   ],
   "rules": {
-    "brace-style": "off",
     "no-shadow": "off",
   }
 };
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
@@ -11,17 +11,19 @@ module.exports = {
     "BrowserFeedWriter": false,
     "CSSPrimitiveValue": false,
     "CSSValueList": false,
     // Specific to Firefox (Chrome code only).
     "ChromeUtils": false,
     "ChromeWindow": false,
     "ChromeWorker": false,
     "Components": false,
+    "DOMRequest": false,
     "DedicatedWorkerGlobalScope": false,
+    "IDBFileRequest": false,
     "IDBLocaleAwareKeyRange": false,
     "IDBMutableFile": false,
     "ImageDocument": false,
     "InstallTrigger": false,
     // Specific to Firefox
     // eslint-disable-next-line max-len
     // https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/InternalError
     "InternalError": true,