Backed out 2 changesets (bug 1496082) for test_bug270414.html failures CLOSED TREE
authorBogdan Tara <btara@mozilla.com>
Tue, 06 Nov 2018 17:58:24 +0200
changeset 503894 ea6dfa0f1fcbde785069aed0f4eec2ed5d3c39c4
parent 503893 92bbf7ef881a6258b93bfca8b567fff241b63e2e
child 503895 eed87ec0ae5c71536d59711c0b7c960f39900ea3
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1496082, 270414
milestone65.0a1
backs out74780d0a4848ac873154e4ff95c3287c375b976b
4f87e383a8074045b1327a1c04e5b01a3b0f23a6
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
Backed out 2 changesets (bug 1496082) for test_bug270414.html failures CLOSED TREE Backed out changeset 74780d0a4848 (bug 1496082) Backed out changeset 4f87e383a807 (bug 1496082)
.eslintignore
docshell/test/navigation/.eslintrc.js
docshell/test/navigation/NavigationUtils.js
docshell/test/navigation/bluebox_bug430723.html
docshell/test/navigation/browser_bug343515.js
docshell/test/navigation/browser_test-content-chromeflags.js
docshell/test/navigation/file_bug1300461.html
docshell/test/navigation/file_bug1300461_back.html
docshell/test/navigation/file_bug1326251.html
docshell/test/navigation/file_bug1375833.html
docshell/test/navigation/file_bug1379762-1.html
docshell/test/navigation/file_bug1379762-2.html
docshell/test/navigation/file_bug386782_contenteditable.html
docshell/test/navigation/file_bug386782_designmode.html
docshell/test/navigation/file_bug462076_1.html
docshell/test/navigation/file_bug462076_2.html
docshell/test/navigation/file_bug462076_3.html
docshell/test/navigation/file_bug508537_1.html
docshell/test/navigation/file_bug534178.html
docshell/test/navigation/file_scrollRestoration.html
docshell/test/navigation/file_shiftReload_and_pushState.html
docshell/test/navigation/file_static_and_dynamic_1.html
docshell/test/navigation/file_triggeringprincipal_frame_1.html
docshell/test/navigation/file_triggeringprincipal_subframe.html
docshell/test/navigation/file_triggeringprincipal_subframe_nav.html
docshell/test/navigation/navigate.html
docshell/test/navigation/redbox_bug430723.html
docshell/test/navigation/test_bug270414.html
docshell/test/navigation/test_bug278916.html
docshell/test/navigation/test_bug279495.html
docshell/test/navigation/test_bug344861.html
docshell/test/navigation/test_bug386782.html
docshell/test/navigation/test_bug430624.html
docshell/test/navigation/test_bug430723.html
docshell/test/navigation/test_child.html
docshell/test/navigation/test_contentpolicy_block_window.html
docshell/test/navigation/test_grandchild.html
docshell/test/navigation/test_not-opener.html
docshell/test/navigation/test_opener.html
docshell/test/navigation/test_popup-navigates-children.html
docshell/test/navigation/test_reserved.html
docshell/test/navigation/test_sessionhistory.html
docshell/test/navigation/test_sibling-matching-parent.html
docshell/test/navigation/test_sibling-off-domain.html
docshell/test/navigation/test_triggeringprincipal_frame_nav.html
docshell/test/navigation/test_triggeringprincipal_iframe_iframe_window_open.html
docshell/test/navigation/test_triggeringprincipal_parent_iframe_window_open.html
docshell/test/navigation/test_triggeringprincipal_window_open.html
docshell/test/unit/head_docshell.js
docshell/test/unit/test_bug442584.js
docshell/test/unit/test_nsDefaultURIFixup.js
docshell/test/unit/test_nsDefaultURIFixup_info.js
docshell/test/unit/test_nsDefaultURIFixup_search.js
docshell/test/unit/test_pb_notification.js
docshell/test/unit/test_privacy_transition.js
docshell/test/unit_ipc/test_pb_notification_ipc.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -9,21 +9,17 @@
 **/reftests/**
 
 # Exclude expected objdirs.
 obj*/**
 
 # We ignore all these directories by default, until we get them enabled.
 # If you are enabling a directory, please add directory specific exclusions
 # below.
-docshell/resources/**
-docshell/test/browser/**
-docshell/test/chrome/**
-docshell/test/iframesandbox/**
-docshell/test/mochitest/**
+docshell/**
 extensions/cookie/**
 extensions/spellcheck/**
 extensions/universalchardet/**
 gfx/layers/**
 gfx/tests/browser/**
 gfx/tests/chrome/**
 gfx/tests/mochitest/**
 image/**
--- a/docshell/test/navigation/.eslintrc.js
+++ b/docshell/test/navigation/.eslintrc.js
@@ -1,16 +1,8 @@
 "use strict";
 
 module.exports = {
   "extends": [
     "plugin:mozilla/browser-test",
     "plugin:mozilla/mochitest-test",
-  ],
-  
-  "plugins": [
-    "no-unsanitized",
-  ],
-
-  "rules": {
-    "no-unsanitized/method": "off",
-  },
+  ]
 };
--- a/docshell/test/navigation/NavigationUtils.js
+++ b/docshell/test/navigation/NavigationUtils.js
@@ -1,32 +1,32 @@
 /* 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/. */
 
-// /////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////
 //
 // Utilities for navigation tests
-//
-// /////////////////////////////////////////////////////////////////////////
+// 
+///////////////////////////////////////////////////////////////////////////
 
 var body = "This frame was navigated.";
-var target_url = "navigation_target_url.html";
+var target_url = "navigation_target_url.html"
 
 var popup_body = "This is a popup";
 var target_popup_url = "navigation_target_popup_url.html";
 
-// /////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////
 // Functions that navigate frames
-// /////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////
 
 function navigateByLocation(wnd) {
   try {
     wnd.location = target_url;
-  } catch (ex) {
+  } catch(ex) {
     // We need to keep our finished frames count consistent.
     // Oddly, this ends up simulating the behavior of IE7.
     window.open(target_url, "_blank", "width=10,height=10");
   }
 }
 
 function navigateByOpen(name) {
   window.open(target_url, name, "width=10,height=10");
@@ -43,69 +43,68 @@ function navigateByForm(name) {
 var hyperlink_count = 0;
 
 function navigateByHyperlink(name) {
   var link = document.createElement("a");
   link.href = target_url;
   link.target = name;
   link.id = "navigation_hyperlink_" + hyperlink_count++;
   document.body.appendChild(link);
-  sendMouseEvent({type: "click"}, link.id);
+  sendMouseEvent({type:"click"}, link.id);
 }
 
-// /////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////
 // Functions that call into Mochitest framework
-// /////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////
 
 function isNavigated(wnd, message) {
   var result = null;
   try {
     result = SpecialPowers.wrap(wnd).document.body.innerHTML.trim();
-  } catch (ex) {
+  } catch(ex) {
     result = ex;
   }
   is(result, body, message);
 }
 
 function isBlank(wnd, message) {
   var result = null;
   try {
     result = wnd.document.body.innerHTML.trim();
-  } catch (ex) {
+  } catch(ex) {
     result = ex;
   }
   is(result, "This is a blank document.", message);
 }
 
 function isAccessible(wnd, message) {
   try {
     wnd.document.body.innerHTML;
     ok(true, message);
-  } catch (ex) {
+  } catch(ex) {
     ok(false, message);
   }
 }
 
 function isInaccessible(wnd, message) {
   try {
     wnd.document.body.innerHTML;
     ok(false, message);
-  } catch (ex) {
+  } catch(ex) {
     ok(true, message);
   }
 }
 
-// /////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////
 // Functions that require UniversalXPConnect privilege
-// /////////////////////////////////////////////////////////////////////////
-/* eslint-disable mozilla/use-services */
+///////////////////////////////////////////////////////////////////////////
+
 function xpcEnumerateContentWindows(callback) {
 
   var Ci = SpecialPowers.Ci;
-  // Replacing this with Services.ww format causes test errors, so ignore for now
   var ww = SpecialPowers.Cc["@mozilla.org/embedcomp/window-watcher;1"]
                         .getService(Ci.nsIWindowWatcher);
 
   var contentWindows = [];
 
   for (let win of ww.getWindowEnumerator()) {
     if (win.isChromeWindow) {
       var docshellTreeNode = win.docShell;
@@ -123,17 +122,16 @@ function xpcEnumerateContentWindows(call
     } else {
       contentWindows.push(win);
     }
   }
 
   while (contentWindows.length > 0)
     callback(contentWindows.pop());
 }
-/* eslint-enable mozilla/use-services */
 
 // Note: This only searches for top-level frames with this name.
 function xpcGetFramesByName(name) {
   var results = [];
 
   xpcEnumerateContentWindows(function(win) {
     if (win.name == name)
       results.push(win);
@@ -175,20 +173,20 @@ function xpcWaitForFinishedFrames(callba
         return true;
     }
     return false;
   }
 
   function searchForFinishedFrames(win) {
     if ((win.location.href.endsWith(target_url) ||
          win.location.href.endsWith(target_popup_url)) &&
-        win.document &&
-        win.document.body &&
+        win.document && 
+        win.document.body && 
         (win.document.body.textContent.trim() == body ||
-         win.document.body.textContent.trim() == popup_body) &&
+         win.document.body.textContent.trim() == popup_body) && 
         win.document.readyState == "complete") {
 
       var windowId = win.windowUtils.outerWindowID;
       if (!contains(windowId, finishedWindows)) {
         finishedWindows.push(windowId);
         frameFinished();
       }
     }
@@ -196,17 +194,17 @@ function xpcWaitForFinishedFrames(callba
       searchForFinishedFrames(win.frames[i]);
   }
 
   function poll() {
     try {
       // This only gives us UniversalXPConnect for the current stack frame
       // We're using setInterval, so the main page's privileges are still normal
       xpcEnumerateContentWindows(searchForFinishedFrames);
-    } catch (ex) {
+    } catch(ex) {
       // We might be accessing windows before they are fully constructed,
       // which can throw.  We'll find those frames on our next poll().
     }
   }
 
   var frameWaitInterval = setInterval(poll, 500);
 }
 
--- a/docshell/test/navigation/bluebox_bug430723.html
+++ b/docshell/test/navigation/bluebox_bug430723.html
@@ -1,6 +1,6 @@
 <html><head>
-<script> window.addEventListener("pageshow", function() { opener.nextTest(); }); </script>
+<script> window.addEventListener("pageshow", function(){opener.nextTest();}, false); </script>
 </head><body>
 <div style="position:absolute; left:0px; top:0px; width:50%; height:150%; background-color:blue">
 <p>This is a very tall blue box.</p>
 </div></body></html>
--- a/docshell/test/navigation/browser_bug343515.js
+++ b/docshell/test/navigation/browser_bug343515.js
@@ -90,31 +90,31 @@ function step3() {
   ok(ctx.tab1Browser.docShellIsActive, "Tab 1 should be active");
 
   // Tab 2's window _and_ its iframes should be inactive
   ok(!ctx.tab2Browser.docShellIsActive, "Tab 2 should be inactive");
   ContentTask.spawn(ctx.tab2Browser, null, async function() {
     Assert.equal(content.frames.length, 2, "Tab 2 should have 2 iframes");
     for (var i = 0; i < content.frames.length; i++) {
       info("step 3, frame " + i + " info: " + content.frames[i].location);
-      let docShell = content.frames[i].docShell;
+      let docshell = content.frames[i].docShell;
+
       Assert.ok(!docShell.isActive, `Tab2 iframe ${i} should be inactive`);
     }
   }).then(() => {
     // Navigate tab 2 to a different page
     BrowserTestUtils.loadURI(ctx.tab2Browser, testPath + "bug343515_pg3.html");
 
     // bug343515_pg3.html consists of a page with two iframes, one of which
     // contains another iframe, so there'll be a total of 4 load events
     nShotsListener(ctx.tab2Browser, "load", step4, 4);
   });
 }
 
 function step4() {
-  /* eslint-disable no-shadow */
   function checkTab2Active(expected) {
     return ContentTask.spawn(ctx.tab2Browser, expected, async function(expected) {
       function isActive(aWindow) {
         var docshell = aWindow.docShell;
         return docshell.isActive;
       }
 
       let active = expected ? "active" : "inactive";
@@ -123,17 +123,17 @@ function step4() {
         info("step 4, frame " + i + " info: " + content.frames[i].location);
       Assert.equal(content.frames[0].frames.length, 1, "Tab 2 iframe 0 should have 1 iframes");
       Assert.equal(isActive(content.frames[0]), expected, `Tab2 iframe 0 should be ${active}`);
       Assert.equal(isActive(content.frames[0].frames[0]), expected,
          `Tab2 iframe 0 subiframe 0 should be ${active}`);
       Assert.equal(isActive(content.frames[1]), expected, `Tab2 iframe 1 should be ${active}`);
     });
   }
-  /* eslint-enable no-shadow */
+
   is(testPath + "bug343515_pg3.html", ctx.tab2Browser.currentURI.spec,
      "Got expected tab 2 url in step 4");
 
   // Tab 0 should be inactive, Tab 1 should be active
   ok(!ctx.tab0Browser.docShellIsActive, "Tab 0 should be inactive");
   ok(ctx.tab1Browser.docShellIsActive, "Tab 1 should be active");
 
   // Tab2 and all descendants should be inactive
@@ -156,17 +156,18 @@ function step4() {
 
 function step5() {
   // Check everything
   ok(!ctx.tab0Browser.docShellIsActive, "Tab 0 should be inactive");
   ok(!ctx.tab1Browser.docShellIsActive, "Tab 1 should be inactive");
   ok(ctx.tab2Browser.docShellIsActive, "Tab 2 should be active");
   ContentTask.spawn(ctx.tab2Browser, null, async function() {
     for (var i = 0; i < content.frames.length; i++) {
-      let docShell = content.frames[i].docShell;
+      let docshell = content.frames[i].docShell;
+
       Assert.ok(docShell.isActive, `Tab2 iframe ${i} should be active`);
     }
   }).then(() => {
     // Switch to tab 1
     return BrowserTestUtils.switchTab(gBrowser, ctx.tab1);
   }).then(() => {
     // Navigate to page 3
     BrowserTestUtils.loadURI(ctx.tab1Browser, testPath + "bug343515_pg3.html");
@@ -190,29 +191,29 @@ function step6() {
 
     Assert.ok(isActive(content.frames[0]), "Tab1 iframe 0 should be active");
     Assert.ok(isActive(content.frames[0].frames[0]), "Tab1 iframe 0 subiframe 0 should be active");
     Assert.ok(isActive(content.frames[1]), "Tab1 iframe 1 should be active");
   }).then(() => {
     ok(!ctx.tab2Browser.docShellIsActive, "Tab 2 should be inactive");
     return ContentTask.spawn(ctx.tab2Browser, null, async function() {
       for (var i = 0; i < content.frames.length; i++) {
-        let docShell = content.frames[i].docShell;
+        let docshell = content.frames[i].docShell;
+
         Assert.ok(!docShell.isActive, `Tab2 iframe ${i} should be inactive`);
       }
     });
   }).then(() => {
     // Go forward on tab 2
     waitForPageshow(ctx.tab2Browser, step7);
     ctx.tab2Browser.goForward();
   });
 }
 
 function step7() {
-  /* eslint-disable no-shadow */
   function checkBrowser(browser, tabNum, active) {
     return ContentTask.spawn(browser, { tabNum, active },
                              async function({ tabNum, active }) {
              function isActive(aWindow) {
                var docshell = aWindow.docShell;
                return docshell.isActive;
              }
 
@@ -220,30 +221,29 @@ function step7() {
              Assert.equal(isActive(content.frames[0]), active,
                 `Tab${tabNum} iframe 0 should be ${activestr}`);
              Assert.equal(isActive(content.frames[0].frames[0]), active,
                 `Tab${tabNum} iframe 0 subiframe 0 should be ${activestr}`);
              Assert.equal(isActive(content.frames[1]), active,
                 `Tab${tabNum} iframe 1 should be ${activestr}`);
            });
   }
-  /* eslint-enable no-shadow */
+
   // Check everything
   ok(!ctx.tab0Browser.docShellIsActive, "Tab 0 should be inactive");
   ok(ctx.tab1Browser.docShellIsActive, "Tab 1 should be active");
   checkBrowser(ctx.tab1Browser, 1, true).then(() => {
     ok(!ctx.tab2Browser.docShellIsActive, "Tab 2 should be inactive");
     return checkBrowser(ctx.tab2Browser, 2, false);
   }).then(() => {
     // That's probably enough
     allDone();
   });
 }
 
-
 function allDone() {
 
   // Close the tabs we made
   gBrowser.removeTab(ctx.tab1);
   gBrowser.removeTab(ctx.tab2);
 
   // Tell the framework we're done
   finish();
--- a/docshell/test/navigation/browser_test-content-chromeflags.js
+++ b/docshell/test/navigation/browser_test-content-chromeflags.js
@@ -8,23 +8,23 @@ const CHROME_REMOTE_WINDOW = Ci.nsIWebBr
  */
 add_task(async function() {
   // Make sure that the window.open call will open a new
   // window instead of a new tab.
   await new Promise(resolve => {
     SpecialPowers.pushPrefEnv({
       "set": [
         ["browser.link.open_newwindow", 2],
-      ],
+      ]
     }, resolve);
   });
 
   await BrowserTestUtils.withNewTab({
     gBrowser,
-    url: TEST_PAGE,
+    url: TEST_PAGE
   }, async function(browser) {
     let openedPromise = BrowserTestUtils.waitForNewWindow();
     BrowserTestUtils.synthesizeMouse("a", 0, 0, {}, browser);
     let win = await openedPromise;
 
     let chromeFlags = win.docShell
                          .treeOwner
                          .QueryInterface(Ci.nsIInterfaceRequestor)
--- a/docshell/test/navigation/file_bug1300461.html
+++ b/docshell/test/navigation/file_bug1300461.html
@@ -25,39 +25,39 @@
        */
       let Ci = SpecialPowers.Ci;
       let webNav = SpecialPowers.wrap(window)
                      .docShell
                      .QueryInterface(Ci.nsIWebNavigation);
       let shistory = webNav.sessionHistory;
       let testSteps = [
         function() {
-          opener.is(shistory.count, 1, "check history length");
-          opener.is(shistory.index, 0, "check history index");
-          opener.ok(!webNav.canGoForward, "check canGoForward");
-          setTimeout(() => window.location = "file_bug1300461_back.html", 0);
+          opener.is(shistory.count, 1, 'check history length');
+          opener.is(shistory.index, 0, 'check history index');
+          opener.ok(!webNav.canGoForward, 'check canGoForward');
+          setTimeout(() => window.location = 'file_bug1300461_back.html', 0);
         },
         function() {
-          opener.is(shistory.count, 2, "check history length");
-          opener.is(shistory.index, 0, "check history index");
-          opener.ok(webNav.canGoForward, "check canGoForward");
+          opener.is(shistory.count, 2, 'check history length');
+          opener.is(shistory.index, 0, 'check history index');
+          opener.ok(webNav.canGoForward, 'check canGoForward');
           window.history.forward();
-          opener.is(shistory.legacySHistory.requestedIndex, 1, "check requestedIndex");
+          opener.is(shistory.legacySHistory.requestedIndex, 1, 'check requestedIndex');
         },
         function() {
-          opener.is(shistory.count, 2, "check history length");
-          opener.is(shistory.index, 0, "check history index");
-          opener.ok(webNav.canGoForward, "check canGoForward");
-          opener.info("file_bug1300461.html tests finished");
+          opener.is(shistory.count, 2, 'check history length');
+          opener.is(shistory.index, 0, 'check history index');
+          opener.ok(webNav.canGoForward, 'check canGoForward');
+          opener.info('file_bug1300461.html tests finished');
           opener.nextTest();
           window.close();
-        },
+        }
       ];
 
       function test() {
         if (opener) {
-          opener.info("file_bug1300461.html test " + opener.testCount);
+          opener.info('file_bug1300461.html test ' + opener.testCount);
           testSteps[opener.testCount++]();
         }
       }
     </script>
   </body>
 </html>
--- a/docshell/test/navigation/file_bug1300461_back.html
+++ b/docshell/test/navigation/file_bug1300461_back.html
@@ -10,22 +10,22 @@
       let Ci = SpecialPowers.Ci;
       let webNav = SpecialPowers.wrap(window)
                      .docShell
                      .QueryInterface(Ci.nsIWebNavigation);
       let shistory = webNav.sessionHistory;
       function test() {
         if (opener) {
           opener.info("file_bug1300461_back.html");
-          opener.is(shistory.count, 2, "check history length");
-          opener.is(shistory.index, 1, "check history index");
-          opener.is(shistory.legacySHistory.requestedIndex, -1, "check requestedIndex");
-          opener.ok(webNav.canGoBack, "check canGoBack");
+          opener.is(shistory.count, 2, 'check history length');
+          opener.is(shistory.index, 1, 'check history index');
+          opener.is(shistory.legacySHistory.requestedIndex, -1, 'check requestedIndex');
+          opener.ok(webNav.canGoBack, 'check canGoBack');
           if (opener.testCount == 1) {
-            opener.info("replaceState to redirect.html");
-            window.history.replaceState({}, "", "file_bug1300461_redirect.html");
+            opener.info('replaceState to redirect.html');
+            window.history.replaceState({}, '', 'file_bug1300461_redirect.html');
           }
           window.history.back();
         }
       }
     </script>
   </body>
 </html>
--- a/docshell/test/navigation/file_bug1326251.html
+++ b/docshell/test/navigation/file_bug1326251.html
@@ -1,174 +1,174 @@
 <!DOCTYPE html>
 <html lang="en">
   <head>
     <meta charset="utf-8">
     <title>Bug 1326251</title>
     <script>
-    const BASE_URL = "http://mochi.test:8888/tests/docshell/test/navigation/";
+    const BASE_URL = 'http://mochi.test:8888/tests/docshell/test/navigation/';
     let testSteps = [
       async function() {
         // Test 1: Create dynamic iframe with bfcache enabled.
         // Navigate static / dynamic iframes, then navigate top level window
         // and navigate back. Both iframes should still exist with history
         // entries preserved.
         window.onunload = null; // enable bfcache
-        await createDynamicFrame(document);
-        await loadUriInFrame(document.getElementById("staticFrame"), "frame1.html");
-        await loadUriInFrame(document.getElementById("dynamicFrame"), "frame1.html");
-        await loadUriInFrame(document.getElementById("staticFrame"), "frame2.html");
-        await loadUriInFrame(document.getElementById("dynamicFrame"), "frame2.html");
-        opener.is(history.length, 5, "history.length");
-        window.location = "goback.html";
+        let dynamicFrame = await createDynamicFrame(document);
+        await loadUriInFrame(document.getElementById('staticFrame'), 'frame1.html');
+        await loadUriInFrame(document.getElementById('dynamicFrame'), 'frame1.html');
+        await loadUriInFrame(document.getElementById('staticFrame'), 'frame2.html');
+        await loadUriInFrame(document.getElementById('dynamicFrame'), 'frame2.html');
+        opener.is(history.length, 5, 'history.length');
+        window.location = 'goback.html';
       },
       async function() {
         let webNav = SpecialPowers.wrap(window)
                        .docShell
                        .QueryInterface(SpecialPowers.Ci.nsIWebNavigation);
         let shistory = webNav.sessionHistory;
-        opener.is(webNav.canGoForward, true, "canGoForward");
-        opener.is(shistory.index, 4, "shistory.index");
-        opener.is(history.length, 6, "history.length");
-        opener.is(document.getElementById("staticFrame").contentWindow.location.href, BASE_URL + "frame2.html", "staticFrame location");
-        opener.is(document.getElementById("dynamicFrame").contentWindow.location.href, BASE_URL + "frame2.html", "dynamicFrame location");
+        opener.is(webNav.canGoForward, true, 'canGoForward');
+        opener.is(shistory.index, 4, 'shistory.index');
+        opener.is(history.length, 6, 'history.length');
+        opener.is(document.getElementById('staticFrame').contentWindow.location.href, BASE_URL + 'frame2.html', 'staticFrame location');
+        opener.is(document.getElementById('dynamicFrame').contentWindow.location.href, BASE_URL + 'frame2.html', 'dynamicFrame location');
 
         // Test 2: Load another page in dynamic iframe, canGoForward should be
         // false.
-        await loadUriInFrame(document.getElementById("dynamicFrame"), "frame3.html");
-        opener.is(webNav.canGoForward, false, "canGoForward");
-        opener.is(shistory.index, 5, "shistory.index");
-        opener.is(history.length, 6, "history.length");
+        await loadUriInFrame(document.getElementById('dynamicFrame'), 'frame3.html');
+        opener.is(webNav.canGoForward, false, 'canGoForward');
+        opener.is(shistory.index, 5, 'shistory.index');
+        opener.is(history.length, 6, 'history.length');
 
         // Test 3: Navigate to antoher page with bfcache disabled, all dynamic
         // iframe entries should be removed.
-        window.onunload = function() {}; // disable bfcache
-        window.location = "goback.html";
+        window.onunload = function(){}; // disable bfcache
+        window.location = 'goback.html';
       },
       async function() {
         let windowWrap = SpecialPowers.wrap(window);
         let docShell = windowWrap.docShell;
         let shistory = docShell.QueryInterface(SpecialPowers.Ci.nsIWebNavigation)
                                .sessionHistory;
         // Now staticFrame has frame0 -> frame1 -> frame2.
-        opener.is(docShell.previousEntryIndex, 3, "docShell.previousEntryIndex");
-        opener.is(docShell.loadedEntryIndex, 2, "docShell.loadedEntryIndex");
-        opener.is(shistory.index, 2, "shistory.index");
-        opener.is(history.length, 4, "history.length");
-        opener.is(document.getElementById("staticFrame").contentWindow.location.href, BASE_URL + "frame2.html", "staticFrame location");
-        opener.ok(!document.getElementById("dynamicFrame"), "dynamicFrame should not exist");
+        opener.is(docShell.previousEntryIndex, 3, 'docShell.previousEntryIndex');
+        opener.is(docShell.loadedEntryIndex, 2, 'docShell.loadedEntryIndex');
+        opener.is(shistory.index, 2, 'shistory.index');
+        opener.is(history.length, 4, 'history.length');
+        opener.is(document.getElementById('staticFrame').contentWindow.location.href, BASE_URL + 'frame2.html', 'staticFrame location');
+        opener.ok(!document.getElementById('dynamicFrame'), 'dynamicFrame should not exist');
 
         // Test 4: Load a nested frame in the static frame, navigate the inner
         // static frame, add a inner dynamic frame and navigate the dynamic
         // frame. Then navigate the outer static frame and go back. The inner
         // iframe should show the last entry of inner static frame.
-        let staticFrame = document.getElementById("staticFrame");
-        staticFrame.width = "320px";
-        staticFrame.height = "360px";
-        await loadUriInFrame(staticFrame, "iframe_static.html");
-        let innerStaticFrame = staticFrame.contentDocument.getElementById("staticFrame");
-        await loadUriInFrame(innerStaticFrame, "frame1.html");
-        let innerDynamicFrame = await createDynamicFrame(staticFrame.contentDocument, "frame2.html");
-        await loadUriInFrame(innerDynamicFrame, "frame3.html");
+        let staticFrame = document.getElementById('staticFrame');
+        staticFrame.width = '320px';
+        staticFrame.height = '360px';
+        await loadUriInFrame(staticFrame, 'iframe_static.html');
+        let innerStaticFrame = staticFrame.contentDocument.getElementById('staticFrame');
+        await loadUriInFrame(innerStaticFrame, 'frame1.html');
+        let innerDynamicFrame = await createDynamicFrame(staticFrame.contentDocument, 'frame2.html');
+        await loadUriInFrame(innerDynamicFrame, 'frame3.html');
         // staticFrame:       frame0 -> frame1 -> frame2 -> iframe_static
         // innerStaticFrame:                                frame0        -> frame1
         // innerDynamicFrame:                                                frame2 -> frame3
-        opener.is(shistory.index, 5, "shistory.index");
-        opener.is(history.length, 6, "history.length");
+        opener.is(shistory.index, 5, 'shistory.index');
+        opener.is(history.length, 6, 'history.length');
 
         // Wait for 2 load events - navigation and goback.
         let onloadPromise = awaitOnload(staticFrame, 2);
-        await loadUriInFrame(staticFrame, "goback.html");
+        await loadUriInFrame(staticFrame, 'goback.html');
         await onloadPromise;
         // staticFrame:       frame0 -> frame1 -> frame2 -> iframe_static           -> goback
         // innerStaticFrame:                                frame0        -> frame1
-        opener.is(shistory.index, 4, "shistory.index");
-        opener.is(history.length, 6, "history.length");
-        innerStaticFrame = staticFrame.contentDocument.getElementById("staticFrame");
-        opener.is(innerStaticFrame.contentDocument.location.href, BASE_URL + "frame1.html", "innerStaticFrame location");
-        opener.ok(!staticFrame.contentDocument.getElementById("dynamicFrame"), "innerDynamicFrame should not exist");
+        opener.is(shistory.index, 4, 'shistory.index');
+        opener.is(history.length, 6, 'history.length');
+        innerStaticFrame = staticFrame.contentDocument.getElementById('staticFrame');
+        opener.is(innerStaticFrame.contentDocument.location.href, BASE_URL + 'frame1.html', 'innerStaticFrame location');
+        opener.ok(!staticFrame.contentDocument.getElementById('dynamicFrame'), 'innerDynamicFrame should not exist');
 
         // Test 5: Insert and navigate inner dynamic frame again with bfcache
         // enabled, and navigate top level window to a special page which will
         // evict bfcache then goback. Verify that dynamic entries are correctly
         // removed in this case.
         window.onunload = null; // enable bfcache
-        staticFrame.width = "320px";
-        staticFrame.height = "360px";
-        innerDynamicFrame = await createDynamicFrame(staticFrame.contentDocument, "frame2.html");
-        await loadUriInFrame(innerDynamicFrame, "frame3.html");
+        staticFrame.width = '320px';
+        staticFrame.height = '360px';
+        innerDynamicFrame = await createDynamicFrame(staticFrame.contentDocument, 'frame2.html');
+        await loadUriInFrame(innerDynamicFrame, 'frame3.html');
         // staticFrame:       frame0 -> frame1 -> frame2 -> iframe_static
         // innerStaticFrame:                                frame0        -> frame1
         // innerDynamicFrame:                                                frame2 -> frame3
-        opener.is(shistory.index, 5, "shistory.index");
-        opener.is(history.length, 6, "history.length");
-        window.location = "file_bug1326251_evict_cache.html";
+        opener.is(shistory.index, 5, 'shistory.index');
+        opener.is(history.length, 6, 'history.length');
+        window.location = 'file_bug1326251_evict_cache.html';
       },
       async function() {
         let windowWrap = SpecialPowers.wrap(window);
         let docShell = windowWrap.docShell;
         let shistory = docShell.QueryInterface(SpecialPowers.Ci.nsIWebNavigation)
                                .sessionHistory;
         // staticFrame:       frame0 -> frame1 -> frame2 -> iframe_static
         // innerStaticFrame:                                frame0        -> frame1
-        opener.is(docShell.previousEntryIndex, 5, "docShell.previousEntryIndex");
-        opener.is(docShell.loadedEntryIndex, 4, "docShell.loadedEntryIndex");
-        opener.is(shistory.index, 4, "shistory.index");
-        opener.is(history.length, 6, "history.length");
-        let staticFrame = document.getElementById("staticFrame");
-        let innerStaticFrame = staticFrame.contentDocument.getElementById("staticFrame");
-        opener.is(innerStaticFrame.contentDocument.location.href, BASE_URL + "frame1.html", "innerStaticFrame location");
-        opener.ok(!staticFrame.contentDocument.getElementById("dynamicFrame"), "innerDynamicFrame should not exist");
+        opener.is(docShell.previousEntryIndex, 5, 'docShell.previousEntryIndex');
+        opener.is(docShell.loadedEntryIndex, 4, 'docShell.loadedEntryIndex');
+        opener.is(shistory.index, 4, 'shistory.index');
+        opener.is(history.length, 6, 'history.length');
+        let staticFrame = document.getElementById('staticFrame');
+        let innerStaticFrame = staticFrame.contentDocument.getElementById('staticFrame');
+        opener.is(innerStaticFrame.contentDocument.location.href, BASE_URL + 'frame1.html', 'innerStaticFrame location');
+        opener.ok(!staticFrame.contentDocument.getElementById('dynamicFrame'), 'innerDynamicFrame should not exist');
 
         // Test 6: Insert and navigate inner dynamic frame and then reload outer
         // frame. Verify that inner dynamic frame entries are all removed.
-        staticFrame.width = "320px";
-        staticFrame.height = "360px";
-        let innerDynamicFrame = await createDynamicFrame(staticFrame.contentDocument, "frame2.html");
-        await loadUriInFrame(innerDynamicFrame, "frame3.html");
+        staticFrame.width = '320px';
+        staticFrame.height = '360px';
+        let innerDynamicFrame = await createDynamicFrame(staticFrame.contentDocument, 'frame2.html');
+        await loadUriInFrame(innerDynamicFrame, 'frame3.html');
         // staticFrame:       frame0 -> frame1 -> frame2 -> iframe_static
         // innerStaticFrame:                                frame0        -> frame1
         // innerDynamicFrame:                                                frame2 -> frame3
-        opener.is(shistory.index, 5, "shistory.index");
-        opener.is(history.length, 6, "history.length");
+        opener.is(shistory.index, 5, 'shistory.index');
+        opener.is(history.length, 6, 'history.length');
         let staticFrameLoadPromise = new Promise(resolve => {
           staticFrame.onload = resolve;
         });
         staticFrame.contentWindow.location.reload();
         await staticFrameLoadPromise;
         // staticFrame:       frame0 -> frame1 -> frame2 -> iframe_static
         // innerStaticFrame:                                frame0        -> frame1
-        opener.is(shistory.index, 4, "shistory.index");
-        opener.is(history.length, 5, "history.length");
-        innerStaticFrame = staticFrame.contentDocument.getElementById("staticFrame");
-        opener.is(innerStaticFrame.contentDocument.location.href, BASE_URL + "frame1.html", "innerStaticFrame location");
-        opener.ok(!staticFrame.contentDocument.getElementById("dynamicFrame"), "innerDynamicFrame should not exist");
+        opener.is(shistory.index, 4, 'shistory.index');
+        opener.is(history.length, 5, 'history.length');
+        innerStaticFrame = staticFrame.contentDocument.getElementById('staticFrame');
+        opener.is(innerStaticFrame.contentDocument.location.href, BASE_URL + 'frame1.html', 'innerStaticFrame location');
+        opener.ok(!staticFrame.contentDocument.getElementById('dynamicFrame'), 'innerDynamicFrame should not exist');
         opener.nextTest();
         window.close();
-      },
+      }
     ];
 
-    function awaitOnload(frame, occurances = 1) {
+    function awaitOnload(frame, occurances=1) {
       return new Promise(function(resolve, reject) {
         let count = 0;
-        frame.addEventListener("load", function listener(e) {
+        frame.addEventListener('load', function listener(e) {
           if (++count == occurances) {
-            frame.removeEventListener("load", listener);
+            frame.removeEventListener('load', listener);
             setTimeout(resolve, 0);
           }
         });
       });
     }
 
-    async function createDynamicFrame(targetDocument, frameSrc = "frame0.html") {
-      let dynamicFrame = targetDocument.createElement("iframe");
+    async function createDynamicFrame(targetDocument, frameSrc='frame0.html') {
+      let dynamicFrame = targetDocument.createElement('iframe');
       let onloadPromise = awaitOnload(dynamicFrame);
-      dynamicFrame.id = "dynamicFrame";
+      dynamicFrame.id = 'dynamicFrame';
       dynamicFrame.src = frameSrc;
-      let container = targetDocument.getElementById("frameContainer");
+      let container = targetDocument.getElementById('frameContainer');
       container.appendChild(dynamicFrame);
       await onloadPromise;
       return dynamicFrame;
     }
 
     async function loadUriInFrame(frame, uri) {
       let onloadPromise = awaitOnload(frame);
       frame.src = uri;
--- a/docshell/test/navigation/file_bug1375833.html
+++ b/docshell/test/navigation/file_bug1375833.html
@@ -10,13 +10,13 @@
     function test() {
       let iframe = document.querySelector("#testFrame");
       setTimeout(function() { iframe.src = "file_bug1375833-frame1.html"; }, 0);
       iframe.onload = function(e) {
         setTimeout(function() { iframe.src = "file_bug1375833-frame2.html"; }, 0);
         iframe.onload = function() {
           opener.postMessage(iframe.contentWindow.location.href, "*");
         };
-      };
+      }
     }
     </script>
   </body>
 </html>
--- a/docshell/test/navigation/file_bug1379762-1.html
+++ b/docshell/test/navigation/file_bug1379762-1.html
@@ -9,25 +9,24 @@
     onunload = null; // enable bfcache
     opener.is(opener.testCount, 0,
               "We should only run once; otherwise the loadCount variable makes no sense");
     var loadCount = 0;
     onpageshow = function() {
       ++opener.testCount;
       if (opener.testCount == 1) {
         // Navigate forward and then back.
-        // eslint-disable-next-line no-global-assign
         setTimeout(function() { location = "goback.html"; }, 0);
       } else if (opener.testCount == 2) {
         // Do this async so our load event gets a chance to fire if it plans to
         // do it.
         setTimeout(function() {
           opener.nextTest();
           window.close();
         });
       }
     };
     onload = function() {
       ++loadCount;
       opener.is(loadCount, 1, "Should only get one onload");
-    };
+    }
   </script>
 </html>
--- a/docshell/test/navigation/file_bug1379762-2.html
+++ b/docshell/test/navigation/file_bug1379762-2.html
@@ -32,13 +32,12 @@
         window.close();
       }
     }
   </script>
   <script>
     var data = document.querySelector("script[type='text/just-data']").textContent;
     // Store the string that does all out work in a global variable, so we can
     // get at it later.
-    // eslint-disable-next-line no-useless-concat
     var testScript = "<script>" + data + "</" + "script>";
     document.write(testScript);
   </script>
 </html>
--- a/docshell/test/navigation/file_bug386782_contenteditable.html
+++ b/docshell/test/navigation/file_bug386782_contenteditable.html
@@ -1,1 +1,1 @@
-<html><head><meta charset="utf-8"><script>window.addEventListener("pageshow", function(event) { window.opener.postMessage({persisted: event.persisted}, "*"); });</script></head><body contentEditable="true"><p>contentEditable</p></body></html>
\ No newline at end of file
+<html><head><meta charset="utf-8"><script>window.addEventListener("pageshow", function(event) { window.opener.postMessage({persisted:event.persisted}, "*"); });</script></head><body contentEditable="true"><p>contentEditable</p></body></html>
\ No newline at end of file
--- a/docshell/test/navigation/file_bug386782_designmode.html
+++ b/docshell/test/navigation/file_bug386782_designmode.html
@@ -1,1 +1,1 @@
-<html><head><meta charset="utf-8"><script>window.addEventListener("pageshow", function(event) { window.opener.postMessage({persisted: event.persisted}, "*"); });</script></head><body><p>designModeDocument</p></body></html>
\ No newline at end of file
+<html><head><meta charset="utf-8"><script>window.addEventListener("pageshow", function(event) { window.opener.postMessage({persisted:event.persisted}, "*"); });</script></head><body><p>designModeDocument</p></body></html>
\ No newline at end of file
--- a/docshell/test/navigation/file_bug462076_1.html
+++ b/docshell/test/navigation/file_bug462076_1.html
@@ -16,25 +16,25 @@
         document.getElementById("container" + index).appendChild(ifr);
       }
 
       function runTest() {
         var randomNumber = Math.floor(Math.random() * 4);
         for (var i = randomNumber; i < 4; ++i) {
           makeFrame(i);
         }
-        for (var k = 0; k < randomNumber; ++k) {
-          makeFrame(k);
+        for (var i = 0; i < randomNumber; ++i) {
+          makeFrame(i);
         }
       }
 
       function checkFrame(evt) {
         var ifr = evt.target;
-        opener.ok(String(ifr.contentWindow.location).includes(ifr.src),
-           "Wrong document loaded (" + ifr.src + ", " +
+        opener.ok(new String(ifr.contentWindow.location).includes(ifr.src),
+           "Wrong document loaded (" + ifr.src + ", " + 
            ifr.contentWindow.location + ")!");
 
         if (++checkCount == 4) {
           if (++opener.testCount == 10) {
             opener.nextTest();
             window.close();
           } else {
             window.location.reload();
--- a/docshell/test/navigation/file_bug462076_2.html
+++ b/docshell/test/navigation/file_bug462076_2.html
@@ -16,25 +16,25 @@
         document.getElementById("container" + index).appendChild(ifr);
       }
 
       function runTest() {
         var randomNumber = Math.floor(Math.random() * 4);
         for (var i = randomNumber; i < 4; ++i) {
           makeFrame(i);
         }
-        for (var k = 0; k < randomNumber; ++k) {
-          makeFrame(k);
+        for (var i = 0; i < randomNumber; ++i) {
+          makeFrame(i);
         }
       }
 
       function checkFrame(evt) {
         var ifr = evt.target;
-        opener.ok(String(ifr.contentWindow.location).includes(ifr.src),
-           "Wrong document loaded (" + ifr.src + ", " +
+        opener.ok(new String(ifr.contentWindow.location).includes(ifr.src),
+           "Wrong document loaded (" + ifr.src + ", " + 
            ifr.contentWindow.location + ")!");
 
         if (++checkCount == 4) {
           if (++opener.testCount == 10) {
             opener.nextTest();
             window.close();
           } else {
             window.location.reload();
--- a/docshell/test/navigation/file_bug462076_3.html
+++ b/docshell/test/navigation/file_bug462076_3.html
@@ -16,25 +16,25 @@
         document.getElementById("container" + index).appendChild(ifr);
       }
 
       function runTest() {
         var randomNumber = Math.floor(Math.random() * 4);
         for (var i = randomNumber; i < 4; ++i) {
           makeFrame(i);
         }
-        for (var k = 0; k < randomNumber; ++k) {
-          makeFrame(k);
+        for (var i = 0; i < randomNumber; ++i) {
+          makeFrame(i);
         }
       }
 
       function checkFrame(evt) {
         var ifr = evt.target;
-        opener.ok(String(ifr.contentWindow.location).includes(ifr.src),
-           "Wrong document loaded (" + ifr.src + ", " +
+        opener.ok(new String(ifr.contentWindow.location).includes(ifr.src),
+           "Wrong document loaded (" + ifr.src + ", " + 
            ifr.contentWindow.location + ")!");
 
         if (++checkCount == 4) {
           if (++opener.testCount == 10) {
             opener.nextTest();
             window.close();
           } else {
             window.location.reload();
--- a/docshell/test/navigation/file_bug508537_1.html
+++ b/docshell/test/navigation/file_bug508537_1.html
@@ -1,27 +1,27 @@
 <html>
   <head>
     <script>
       function dynFrameLoad() {
         var ifrs = document.getElementsByTagName("iframe");
-        opener.ok(String(ifrs[0].contentWindow.location).includes(ifrs[0].src),
+        opener.ok(new String(ifrs[0].contentWindow.location).includes(ifrs[0].src),
                   "Wrong document loaded (1)\n");
-        opener.ok(String(ifrs[1].contentWindow.location).includes(ifrs[1].src),
+        opener.ok(new String(ifrs[1].contentWindow.location).includes(ifrs[1].src),
                   "Wrong document loaded (2)\n");
         if (opener && ++opener.testCount == 1) {
           window.location = "goback.html";
         } else {
           opener.nextTest();
           window.close();
         }
       }
 
       window.addEventListener("load",
-        function() {
+        function () {
           var container = document.getElementById("t1");
           container.addEventListener("load", dynFrameLoad, true);
           container.appendChild(container.appendChild(document.getElementById("i1")));
         });
     </script>
   </head>
   <body>
     <h5>Container:</h5>
--- a/docshell/test/navigation/file_bug534178.html
+++ b/docshell/test/navigation/file_bug534178.html
@@ -2,17 +2,17 @@
   <head>
     <script>
     
       function testDone() {
         document.body.firstChild.remove();
         var isOK = false;
         try {
           isOK = history.previous != location;
-        } catch (ex) {
+        } catch(ex) {
           // history.previous should throw if this is the first page in shistory.
           isOK = true;
         }
         document.body.textContent = isOK ? "PASSED" : "FAILED";
         opener.ok(isOK, "Duplicate session history entries should have been removed!");
         opener.nextTest();
         window.close();
       }
--- a/docshell/test/navigation/file_scrollRestoration.html
+++ b/docshell/test/navigation/file_scrollRestoration.html
@@ -24,45 +24,45 @@
             window.location.reload(false);
             break;
           }
           case 2: {
             opener.is(event.persisted, false, "Shouldn't have persisted session history entry.");
             opener.isnot(Math.round(window.scrollY), 0, "Should have restored scrolling.");
             opener.is(history.scrollRestoration, "auto", "Should have the same scrollRestoration as before reload.");
             history.scrollRestoration = "manual";
-            window.onunload = function() {}; // Disable bfcache.
+            window.onunload = function() {} // Disable bfcache.
             window.location.reload(false);
             break;
           }
           case 3: {
             opener.is(event.persisted, false, "Shouldn't have persisted session history entry.");
             opener.is(window.scrollY, 0, "Should not have restored scrolling.");
             opener.is(history.scrollRestoration, "manual", "Should have the same scrollRestoration as before reload.");
             document.getElementById("bottom").scrollIntoView();
             window.onunload = null; // Should get bfcache behavior.
             opener.setTimeout("SpecialPowers.wrap(testWindow).history.back();", 250);
-            window.location.href = "about:blank";
+            window.location.href = 'about:blank';
             break;
           }
           case 4: {
             opener.is(event.persisted, true, "Should have persisted session history entry.");
             opener.isnot(Math.round(window.scrollY), 0, "Should have kept the old scroll position.");
             opener.is(history.scrollRestoration, "manual", "Should have the same scrollRestoration as before reload.");
             window.scrollTo(0, 0);
             window.location.hash = "hash";
             requestAnimationFrame(test);
             break;
           }
           case 5: {
             opener.isnot(Math.round(window.scrollY), 0, "Should have scrolled to #hash.");
             opener.is(history.scrollRestoration, "manual", "Should have the same scrollRestoration mode as before fragment navigation.");
-            window.onunload = function() {}; // Disable bfcache.
+            window.onunload = function() {} // Disable bfcache.
             opener.setTimeout("is(SpecialPowers.wrap(testWindow).history.scrollRestoration, 'auto'); SpecialPowers.wrap(testWindow).history.back();", 250);
-            window.location.href = "about:blank";
+            window.location.href = 'about:blank';
             break;
           }
           case 6: {
             opener.is(event.persisted, false, "Shouldn't have persisted session history entry.");
             opener.is(window.scrollY, 0, "Shouldn't have kept the old scroll position.");
             opener.is(history.scrollRestoration, "manual", "Should have the same scrollRestoration mode as before fragment navigation.");
             history.scrollRestoration = "auto";
             document.getElementById("bottom").scrollIntoView();
@@ -99,25 +99,25 @@
           }
           case 7: {
             oldHistoryObject = SpecialPowers.wrap(event.target).contentWindow.history;
             event.target.src = "about:blank";
             break;
           }
           case 8: {
             try {
-              oldHistoryObject.scrollRestoration;
+              var sr = oldHistoryObject.scrollRestoration;
               opener.ok(false, "Should have thrown an exception.");
-            } catch (ex) {
+            } catch(ex) {
               opener.isnot(ex, null, "Did get an exception");
             }
             try {
               oldHistoryObject.scrollRestoration = "auto";
               opener.ok(false, "Should have thrown an exception.");
-            } catch (ex) {
+            } catch(ex) {
               opener.isnot(ex, null, "Did get an exception");
             }
             opener.nextTest();
             window.close();
             break;
           }
         }
       }
--- a/docshell/test/navigation/file_shiftReload_and_pushState.html
+++ b/docshell/test/navigation/file_shiftReload_and_pushState.html
@@ -1,15 +1,15 @@
 <html>
   <head>
     <script>
       function test() {
         try {
           frames[0].history.pushState({}, "state", "?pushed");
-        } catch (ex) {
+        } catch(ex) {
           opener.ok(false, "history.pushState shouldn't throw");
         }
 
         if (!opener.shiftReloadPushStateFirstRound) {
           opener.shiftReloadPushStateFirstRound = true;
           window.location.reload(true);
         } else {
           opener.ok(true, "Did run history.push");
--- a/docshell/test/navigation/file_static_and_dynamic_1.html
+++ b/docshell/test/navigation/file_static_and_dynamic_1.html
@@ -10,17 +10,17 @@
       staticFrame.contentWindow.location = "frame1.html";
     }
 
     function start() {
       if (++opener.testCount == 1) {
         test();
       } else {
         var staticFrame = document.getElementById("staticframe");
-        opener.ok(String(staticFrame.contentWindow.location).includes(staticFrame.src),
+        opener.ok(new String(staticFrame.contentWindow.location).includes(staticFrame.src),
                   "Wrong document loaded!");
         opener.nextTest();
         window.close();
       }
     }
     </script>
   </head>
   <body onload="setTimeout('start()', 0)">
--- a/docshell/test/navigation/file_triggeringprincipal_frame_1.html
+++ b/docshell/test/navigation/file_triggeringprincipal_frame_1.html
@@ -3,25 +3,25 @@
 <head><meta charset="utf-8"></head>
 <body>
 <b>Frame 1</b><br/>
 <a href="#"" id="testlink" onclick="parent.frames[1].frames[0].location='http://test2.mochi.test:8888/tests/docshell/test/navigation/file_triggeringprincipal_subframe_nav.html'">click me</a>
 
 <script type="application/javascript">
   // make sure to set document.domain to the same domain as the subframe
   window.onload = function() {
-    document.domain = "mochi.test";
+    document.domain = 'mochi.test';
   };
-  window.addEventListener("message", receiveMessage);
+  window.addEventListener('message', receiveMessage);
   function receiveMessage(event) {
     // make sure to get the right start command, otherwise
     // let the parent know and fail the test
-    if (event.data.start !== "startTest") {
+    if (event.data.start !== 'startTest') {
       window.removeEventListener("message", receiveMessage);
-      window.parent.postMessage({triggeringPrincipalURI: "false"}, "*");
+      window.parent.postMessage({triggeringPrincipalURI: 'false'}, '*');
     }
     // click the link to navigate the subframe
-    document.getElementById("testlink").click();
+    document.getElementById('testlink').click();
   }
 </script>
 
 </body>
 </html>
--- a/docshell/test/navigation/file_triggeringprincipal_subframe.html
+++ b/docshell/test/navigation/file_triggeringprincipal_subframe.html
@@ -1,15 +1,15 @@
 <!DOCTYPE HTML>
 <html>
 <head><meta charset='utf-8'></head>
 <body>
 <b>Sub Frame 2</b><br/>
 <script type='application/javascript'>
   // make sure to set document.domain to same domain as frame 1
   window.onload = function() {
-    document.domain = "mochi.test";
+    document.domain = 'mochi.test';
     //   let Frame 1 know that we are ready to run the test
-    window.parent.parent.frames[0].postMessage({start: "startTest"}, "*");
+    window.parent.parent.frames[0].postMessage({start: 'startTest'}, '*');
   };
 </script>
 </body>
 </html>
--- a/docshell/test/navigation/file_triggeringprincipal_subframe_nav.html
+++ b/docshell/test/navigation/file_triggeringprincipal_subframe_nav.html
@@ -1,21 +1,21 @@
 <!DOCTYPE HTML>
 <html>
 <head><meta charset="utf-8"></head>
 <body onload="checkResults()">
 <b>Sub Frame 2 Navigated</b><br/>
 
 <script type='application/javascript'>
   function checkResults() {
-    // query the uri of the loadingPrincipal and the TriggeringPrincipal and pass
-    // that information on to the parent for verification.
+  	// query the uri of the loadingPrincipal and the TriggeringPrincipal and pass
+  	// that information on to the parent for verification.
     var channel = SpecialPowers.wrap(window).docShell.currentDocumentChannel;
     var triggeringPrincipalURI = channel.loadInfo.triggeringPrincipal.URI.asciiSpec;
     var loadingPrincipalURI = channel.loadInfo.loadingPrincipal.URI.asciiSpec;
     var referrerURI = document.referrer;
     window.parent.parent.postMessage({triggeringPrincipalURI,
-                                    loadingPrincipalURI,
-                                    referrerURI}, "*");
+    	                              loadingPrincipalURI,
+    	                              referrerURI}, '*');
   }
 </script>
 </body>
 </html>
--- a/docshell/test/navigation/navigate.html
+++ b/docshell/test/navigation/navigate.html
@@ -1,21 +1,20 @@
 <html>
 <head>
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <script src="NavigationUtils.js"></script>
     <script>
     function navigate() {
-        var args = window.location.hash.substring(1).split(",");
-        var target = args[0];
-        var mechanism = args[1];
+        var arguments = window.location.hash.substring(1).split(",");
+        var target = arguments[0];
+        var mechanism = arguments[1];
 
-        switch (mechanism) {
+        switch(mechanism) {
         case "location":
-          // eslint-disable-next-line no-eval
           navigateByLocation(eval(target));
           break;
         case "open":
           navigateByOpen(target);
           break;
         case "form":
           navigateByForm(target);
           break;
@@ -23,15 +22,15 @@
           navigateByHyperlink(target);
           break;
         }
     }
     </script>
 </head>
 <body onload="navigate();">
 <script>
-var args = window.location.hash.substring(1).split(",");
-var target = args[0];
-var mechanism = args[1];
+var arguments = window.location.hash.substring(1).split(",");
+var target = arguments[0];
+var mechanism = arguments[1];
 document.write("target=" + target + " mechanism=" + mechanism);
 </script>
 </body>
 </html>
--- a/docshell/test/navigation/redbox_bug430723.html
+++ b/docshell/test/navigation/redbox_bug430723.html
@@ -1,6 +1,6 @@
 <html><head>
-<script> window.addEventListener("pageshow", function() { opener.nextTest(); }); </script> 
+<script> window.addEventListener("pageshow", function(){opener.nextTest();}, false); </script> 
 </head><body>
 <div style="position:absolute; left:0px; top:0px; width:50%; height:150%; background-color:red">
 <p>This is a very tall red box.</p>
 </div></body></html>
--- a/docshell/test/navigation/test_bug270414.html
+++ b/docshell/test/navigation/test_bug270414.html
@@ -4,28 +4,22 @@
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     <script type="text/javascript" src="NavigationUtils.js"></script>        
     <style type="text/css">
       iframe { width: 90%; height: 50px; }
     </style>
 <script>
-/* eslint-disable no-useless-concat */
 var headerHTML = "<html><head>" +
-                 "<script src='/tests/SimpleTest/EventUtils.js'></scr" + "ipt>" +
+                 "<script src='/tests/SimpleTest/EventUtils.js'></scr" + "ipt>" + 
                  "<script src='NavigationUtils.js'></scr" + "ipt>" +
                  "</head><body>";
 var footerHTML = "</body></html>";
 
-let window0 = null;
-let window1 = null;
-let window2 = null;
-let window3 = null;
-
 function testChild0() {
   if (!window.window0) {
     window0 = window.open("", "window0", "width=10,height=10");
     window0.document.open();
     window0.document.write(headerHTML);
     window0.document.write("<script>navigateByLocation(opener.frames[0])</scr" + "ipt>");
     window0.document.write(footerHTML);
     window0.document.close();
--- a/docshell/test/navigation/test_bug278916.html
+++ b/docshell/test/navigation/test_bug278916.html
@@ -1,31 +1,31 @@
 <!DOCTYPE html>
 <html>
 <head>
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     <script type="text/javascript" src="NavigationUtils.js"></script>
 <script>
-window.onload = function() {
+window.onload = function () {
   document.getElementById("link0").href = target_url;
-  sendMouseEvent({type: "click"}, "link0");
-
+  sendMouseEvent({type:"click"}, "link0");
+  
   xpcWaitForFinishedFrames(function() {
     var array_of_frames = xpcGetFramesByName("window0");
     is(array_of_frames.length, 1, "Should only open one window using a fancy hyperlink.");
 
-    for (var i = 0; i < array_of_frames.length; ++i)
+    for (var i=0; i < array_of_frames.length; ++i)
       array_of_frames[i].close();
 
     xpcCleanupWindows();
     SimpleTest.finish();
   }, 1);
-};
+}
 </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=278916">Mozilla Bug 278916</a>
 <div id="links">
 <a id="link0" target="window0" onclick="window.open('', 'window0', 'width=10,height=10');">This is a fancy hyperlink</a>
 </div>
 <pre id="test">
--- a/docshell/test/navigation/test_bug279495.html
+++ b/docshell/test/navigation/test_bug279495.html
@@ -1,39 +1,39 @@
 <!DOCTYPE html>
 <html>
 <head>
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     <script type="text/javascript" src="NavigationUtils.js"></script>
 <script>
-window.onload = function() {
+window.onload = function () {
   document.getElementById("link0").href = target_url;
   document.getElementById("link1").href = target_url;
 
-  sendMouseEvent({type: "click"}, "link0");
-  sendMouseEvent({type: "click"}, "link1");
+  sendMouseEvent({type:"click"}, "link0");
+  sendMouseEvent({type:"click"}, "link1");
 
   xpcWaitForFinishedFrames(function() {
     countAndClose("window0", 1);
     countAndClose("window1", 1);
 
     xpcCleanupWindows();
     SimpleTest.finish();
   }, 2);
-};
+}
 
 function countAndClose(name, expected_count) {
   var array_of_frames = xpcGetFramesByName(name);
   is(array_of_frames.length, expected_count,
      "Should only open " + expected_count +
      " window(s) with name " + name + " using a fancy hyperlink.");
 
-  for (var i = 0; i < array_of_frames.length; ++i)
+  for (var i=0; i < array_of_frames.length; ++i)
     array_of_frames[i].close();
 }
 </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=279495">Mozilla Bug 279495</a>
 <div id="links">
 <a id="link0" target="window0" onclick="window.open('blank.html', 'window0', 'width=10,height=10');">This is a fancy hyperlink</a>
--- a/docshell/test/navigation/test_bug344861.html
+++ b/docshell/test/navigation/test_bug344861.html
@@ -16,20 +16,20 @@ https://bugzilla.mozilla.org/show_bug.cg
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 /** Test for Bug 344861 **/
 SimpleTest.waitForExplicitFinish();
 
 var newwindow = window.open("/", "testwindow", "width=200,height=200");
-newwindow.onload = function() {
+newwindow.onload = function() { 
   is(newwindow.innerHeight, 200, "window.open has correct height dimensions");
   is(newwindow.innerWidth, 200, "window.open has correct width dimensions");
   SimpleTest.finish();
   newwindow.close();
-};
+}
 </script>
 </pre>
 </body>
 </html>
 
    
--- a/docshell/test/navigation/test_bug386782.html
+++ b/docshell/test/navigation/test_bug386782.html
@@ -16,30 +16,30 @@ https://bugzilla.mozilla.org/show_bug.cg
     // undo/redo. Note that this is different from the case where the
     // designMode document is in a frame inside the window, as this means
     // the editable region is not in the root docshell (a less complicated case).
 
     var gTests = [
       {
         // <html><body><p>designModeDocument</p></body></html>
         url: "file_bug386782_designmode.html",
-        name: "designModeNavigate",
+        name: 'designModeNavigate',
         onload(doc) { doc.designMode = "on"; },
-        expectedBodyBeforeEdit: "<p>designModeDocument</p>",
-        expectedBodyAfterEdit:  "<p>EDITED designModeDocument</p>",
-        expectedBodyAfterSecondEdit: "<p>EDITED TWICE designModeDocument</p>",
+        expectedBodyBeforeEdit: '<p>designModeDocument</p>',
+        expectedBodyAfterEdit:  '<p>EDITED designModeDocument</p>',
+        expectedBodyAfterSecondEdit: '<p>EDITED TWICE designModeDocument</p>',
       },
       {
         // <html><body contentEditable="true"><p>contentEditable</p></body></html>
         url: "file_bug386782_contenteditable.html",
-        name: "contentEditableNavigate",
-        expectedBodyBeforeEdit: "<p>contentEditable</p>",
-        expectedBodyAfterEdit:  "EDITED <br><p>contentEditable</p>",
-        expectedBodyAfterSecondEdit: "EDITED TWICE <br><p>contentEditable</p>",
-      },
+        name: 'contentEditableNavigate',
+        expectedBodyBeforeEdit: '<p>contentEditable</p>',
+        expectedBodyAfterEdit:  'EDITED <br><p>contentEditable</p>',
+        expectedBodyAfterSecondEdit: 'EDITED TWICE <br><p>contentEditable</p>',
+      }
     ];
 
     var gTestNum = -1;
     var gTest = null;
 
     window.onload = goNext;
 
     function goNext() {
@@ -61,20 +61,20 @@ https://bugzilla.mozilla.org/show_bug.cg
     }
 
     function beginTest() {
       gTest.window.document.body.focus();
 
       // WARNING: If the following test fails, give the setTimeout() in the onload()
       // a bit longer; the doc hasn't had enough time to setup its editor.
       is(gTest.window.document.body.innerHTML, gTest.expectedBodyBeforeEdit, "Is doc setup yet");
-      sendString("EDITED ", gTest.window);
+      sendString('EDITED ', gTest.window);
       is(gTest.window.document.body.innerHTML, gTest.expectedBodyAfterEdit, "Editing failed.");
 
-      gTest.window.location = "about:blank";
+      gTest.window.location = 'about:blank';
       SimpleTest.waitForFocus(goBack, gTest.window);
     }
 
     function goBack() {
       window.onmessage = function(e) {
         window.onmessage = null;
         // Skip the test if the page is not loaded from the bf-cache when going back.
         if (e.data.persisted) {
@@ -96,17 +96,17 @@ https://bugzilla.mozilla.org/show_bug.cg
       gTest.window.document.execCommand("undo", false, null);
       is(gTest.window.document.body.innerHTML, gTest.expectedBodyBeforeEdit, "Can we undo?");
 
       gTest.window.document.execCommand("redo", false, null);
       is(gTest.window.document.body.innerHTML, gTest.expectedBodyAfterEdit, "Can we redo?");
 
       // Check that we can still edit the page.
       gTest.window.document.body.focus();
-      sendString("TWICE ", gTest.window);
+      sendString('TWICE ', gTest.window);
       is(gTest.window.document.body.innerHTML, gTest.expectedBodyAfterSecondEdit, "Can we still edit?");
 
       gTest.window.close();
       goNext();
 
     }
 
   </script>
--- a/docshell/test/navigation/test_bug430624.html
+++ b/docshell/test/navigation/test_bug430624.html
@@ -20,30 +20,29 @@ https://bugzilla.mozilla.org/show_bug.cg
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 /** Test for Bug 430624 **/
 
 function onLoad() {
   window.frames[0].frameElement.onload = onReload;
-  // eslint-disable-next-line no-self-assign
   window.frames[0].frameElement.srcdoc = window.frames[0].frameElement.srcdoc;
 }
 
 function onReload() {
   var iframe = window.frames[0].frameElement;
   SimpleTest.waitForFocus(doTest, iframe.contentWindow);
   iframe.contentDocument.body.focus();
 }
 
 function doTest() {
   var bodyElement = window.frames[0].frameElement.contentDocument.body;
   bodyElement.focus();
-  sendString("Still ", window.frames[0].frameElement.contentWindow);
+  sendString('Still ', window.frames[0].frameElement.contentWindow);
 
   is(bodyElement.innerHTML, "Still contentEditable", "Check we're contentEditable after reload");
 
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 
--- a/docshell/test/navigation/test_bug430723.html
+++ b/docshell/test/navigation/test_bug430723.html
@@ -12,113 +12,111 @@ https://bugzilla.mozilla.org/show_bug.cg
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=430723">Mozilla Bug 430723</a>
 <p id="display"></p>
 <div id="content" style="display: none">
   
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
-// <![CDATA[
+//<![CDATA[
 
 /** Test for Bug 430723 **/
 
 var BASE_URI = "http://mochi.test:8888/tests/docshell/test/navigation/";
 var gTallRedBoxURI = BASE_URI + "redbox_bug430723.html";
 var gTallBlueBoxURI = BASE_URI + "bluebox_bug430723.html";
 
 window.onload = runTest;
 
 var testWindow;
 var testNum = 0;
 
 var smoothScrollPref = "general.smoothScroll";
 function runTest() {
-  SpecialPowers.pushPrefEnv({"set": [[smoothScrollPref, false]]}, function() {
+  SpecialPowers.pushPrefEnv({"set":[[smoothScrollPref, false]]}, function(){
     testWindow = window.open(gTallRedBoxURI, "testWindow", "width=300,height=300,location=yes,scrollbars=yes");
   });
 }
 
-var nextTest = function() {
+var nextTest =function() {
   testNum++;
   switch (testNum) {
     case 1: setTimeout(step1, 0); break;
     case 2: setTimeout(step2, 0); break;
     case 3: setTimeout(step3, 0); break;
-  }
-};
+  };
+}
 
-var step1 = function() {
+var step1 =function() {
   window.is(String(testWindow.location), gTallRedBoxURI, "Ensure red page loaded.");
-
+  
   // Navigate down and up.
   is(testWindow.document.body.scrollTop, 0,
      "Page1: Ensure the scrollpane is at the top before we start scrolling.");
-  testWindow.addEventListener("scroll", function() {
+  testWindow.addEventListener("scroll", function () {
     isnot(testWindow.document.body.scrollTop, 0,
           "Page1: Ensure we can scroll down.");
     SimpleTest.executeSoon(step1_2);
   }, {capture: true, once: true});
-  sendKey("DOWN", testWindow);
+  sendKey('DOWN', testWindow);
 
   function step1_2() {
-    testWindow.addEventListener("scroll", function() {
+    testWindow.addEventListener("scroll", function () {
       is(testWindow.document.body.scrollTop, 0,
-         "Page1: Ensure we can scroll up, back to the top.");
+         "Page1: Ensure we can scroll up, back to the top.");  
 
       // Nav to blue box page. This should fire step2.
       testWindow.location = gTallBlueBoxURI;
     }, {capture: true, once: true});
-    sendKey("UP", testWindow);
+    sendKey('UP', testWindow);
   }
-};
+}
 
 
-var step2 = function() {
+var step2 =function() {    
   window.is(String(testWindow.location), gTallBlueBoxURI, "Ensure blue page loaded.");
 
   // Scroll around a bit.
   is(testWindow.document.body.scrollTop, 0,
      "Page2: Ensure the scrollpane is at the top before we start scrolling.");
 
-  var scrollTest = function() {
+  var count = 0;
+  testWindow.addEventListener("scroll", function () {
     if (++count < 2) {
-      SimpleTest.executeSoon(function() { sendKey("DOWN", testWindow); });
+      SimpleTest.executeSoon(function () { sendKey('DOWN', testWindow); });
     } else {
-      testWindow.removeEventListener("scroll", scrollTest, true);
+      testWindow.removeEventListener("scroll", arguments.callee, true);
 
       isnot(testWindow.document.body.scrollTop, 0,
             "Page2: Ensure we could scroll.");
 
       // Navigate backwards. This should fire step3.
       testWindow.history.back();
     }
-  };
+  }, true);
+  sendKey('DOWN', testWindow);
+}
 
-  var count = 0;
-  testWindow.addEventListener("scroll", scrollTest, true);
-  sendKey("DOWN", testWindow);
-};
-
-var step3 = function() {
+var step3 =function() {
   window.is(String(testWindow.location), gTallRedBoxURI,
             "Ensure red page restored from history.");
 
   // Check we can still scroll with the keys.
   is(testWindow.document.body.scrollTop, 0,
-     "Page1Again: Ensure scroll pane at top before we scroll.");
-  testWindow.addEventListener("scroll", function() {
+     "Page1Again: Ensure scroll pane at top before we scroll.");  
+  testWindow.addEventListener("scroll", function () {
     isnot(testWindow.document.body.scrollTop, 0,
-          "Page2Again: Ensure we can still scroll.");
+          "Page2Again: Ensure we can still scroll.");  
 
     testWindow.close();
     window.SimpleTest.finish();
   }, {capture: true, once: true});
-  sendKey("DOWN", testWindow);
-};
+  sendKey('DOWN', testWindow);
+}
 
 SimpleTest.waitForExplicitFinish();
 
-// ]]>
+//]]>
 </script>
 </pre>
 </body>
 </html>
--- a/docshell/test/navigation/test_child.html
+++ b/docshell/test/navigation/test_child.html
@@ -23,17 +23,17 @@ window.onload = function() {
     isNavigated(frames[0], "Should be able to navigate off-domain child by setting location.");
     isNavigated(frames[1], "Should be able to navigate off-domain child by calling window.open.");
     isNavigated(frames[2], "Should be able to navigate off-domain child by submitting form.");
     isNavigated(frames[3], "Should be able to navigate off-domain child by targeted hyperlink.");
 
     xpcCleanupWindows();
     SimpleTest.finish();
   }, 4);
-};
+}
 </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=408052">Mozilla Bug 408052</a>
 <div id="frames">
 <iframe name="child0" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
 <iframe name="child1" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
 <iframe name="child2" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
--- a/docshell/test/navigation/test_contentpolicy_block_window.html
+++ b/docshell/test/navigation/test_contentpolicy_block_window.html
@@ -19,48 +19,44 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 <script class="testbody" type="text/javascript">
 /*
  * Description of the test:
  * The test tries to open a new window and makes sure that a registered contentPolicy
  * gets called with the right (a non null) 'context' for the TYPE_DOCUMENT load.
  */
 
-// Services.jsm is disabled as ChromeUtils appears to be out of scope
-/* eslint-disable mozilla/use-services */
-
 const Cc = SpecialPowers.Cc;
 const Ci = SpecialPowers.Ci;
 
 var categoryManager = Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager);
 var componentManager = SpecialPowers.wrap(SpecialPowers.Components).manager
                                     .QueryInterface(Ci.nsIComponentRegistrar);
 
 // Content policy / factory implementation for the test
 var policyID = SpecialPowers.wrap(SpecialPowers.Components).ID("{b80e19d0-878f-d41b-2654-194714a4115c}");
 var policyName = "@mozilla.org/testpolicy;1";
 var policy = {
   // nsISupports implementation
-  // eslint-disable-next-line mozilla/use-chromeutils-generateqi
-  QueryInterface(iid) {
+  QueryInterface: function(iid) {
     iid = SpecialPowers.wrap(iid);
     if (iid.equals(Ci.nsISupports) ||
         iid.equals(Ci.nsIFactory) ||
         iid.equals(Ci.nsIContentPolicy))
       return this;
     throw SpecialPowers.Cr.NS_ERROR_NO_INTERFACE;
   },
 
   // nsIFactory implementation
-  createInstance(outer, iid) {
+  createInstance: function(outer, iid) {
     return this.QueryInterface(iid);
   },
 
   // nsIContentPolicy implementation
-  shouldLoad(contentLocation, loadInfo, mimeTypeGuess) {
+  shouldLoad: function(contentLocation, loadInfo, mimeTypeGuess) {
     let contentType = loadInfo.externalContentPolicyType;
     let context = loadInfo.loadingContext;
 
     if (SpecialPowers.wrap(contentLocation).spec !== document.getElementById("testlink").href) {
       // not the URI we are looking for, allow the load
       return Ci.nsIContentPolicy.ACCEPT;
     }
 
@@ -78,25 +74,25 @@ var policy = {
       // policy will not be removed from the category correctly
       componentManager.unregisterFactory(policyID, policy);
     }, 0);
 
     SimpleTest.finish();
     return Ci.nsIContentPolicy.REJECT_REQUEST;
   },
 
-  shouldProcess(contentLocation, loadInfo, mimeTypeGuess) {
+  shouldProcess: function(contentLocation, loadInfo, mimeTypeGuess) {
     return Ci.nsIContentPolicy.ACCEPT;
-  },
-};
+  }
+}
 
 policy = SpecialPowers.wrapCallbackObject(policy);
 componentManager.registerFactory(policyID, "Test content policy", policyName, policy);
 categoryManager.addCategoryEntry("content-policy", policyName, policyName, false, true);
 
 SimpleTest.waitForExplicitFinish();
 
 // now everything is set up, let's start the test
-document.getElementById("testlink").click();
+document.getElementById("testlink").click()
 
 </script>
 </body>
 </html>
--- a/docshell/test/navigation/test_grandchild.html
+++ b/docshell/test/navigation/test_grandchild.html
@@ -8,32 +8,32 @@
     <style type="text/css">
       iframe { width: 90%; height: 200px; }
     </style>
 <script>
 if (!navigator.platform.startsWith("Win")) {
   SimpleTest.expectAssertions(0, 1);
 }
 
-window.onload = function() {
+window.onload = function () {
   navigateByLocation(frames[0].frames[0]);
   navigateByOpen("child1_child0");
   navigateByForm("child2_child0");
   navigateByHyperlink("child3_child0");
 
   xpcWaitForFinishedFrames(function() {
     isNavigated(frames[0].frames[0], "Should be able to navigate off-domain grandchild by setting location.");
     isNavigated(frames[1].frames[0], "Should be able to navigate off-domain grandchild by calling window.open.");
     isNavigated(frames[2].frames[0], "Should be able to navigate off-domain grandchild by submitting form.");
     isNavigated(frames[3].frames[0], "Should be able to navigate off-domain grandchild by targeted hyperlink.");
 
     xpcCleanupWindows();
     SimpleTest.finish();
   }, 4);
-};
+}
 </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=408052">Mozilla Bug 408052</a>
 <div id="frames">
 <iframe name="child0" src="http://test1.example.org:80/tests/docshell/test/navigation/parent.html"></iframe>
 <iframe name="child1" src="http://test1.example.org:80/tests/docshell/test/navigation/parent.html"></iframe>
 <iframe name="child2" src="http://test1.example.org:80/tests/docshell/test/navigation/parent.html"></iframe>
--- a/docshell/test/navigation/test_not-opener.html
+++ b/docshell/test/navigation/test_not-opener.html
@@ -8,41 +8,41 @@
     <style type="text/css">
       iframe { width: 90%; height: 50px; }
     </style>
 <script>
 if (!navigator.platform.startsWith("Win")) {
   SimpleTest.expectAssertions(0, 1);
 }
 
-window.onload = function() {
-  // navigateByLocation(window0);  // Don't have a handle to the window.
+window.onload = function () {
+  //navigateByLocation(window0);  // Don't have a handle to the window.
   navigateByOpen("window1");
   navigateByForm("window2");
   navigateByHyperlink("window3");
 
   xpcWaitForFinishedFrames(function() {
     is(xpcGetFramesByName("window1").length, 2, "Should not be able to navigate popup's popup by calling window.open.");
     is(xpcGetFramesByName("window2").length, 2, "Should not be able to navigate popup's popup by submitting form.");
     is(xpcGetFramesByName("window3").length, 2, "Should not be able to navigate popup's popup by targeted hyperlink.");
 
-    // opener0.close();
+    //opener0.close();
     opener1.close();
     opener2.close();
     opener3.close();
 
     xpcCleanupWindows();
     SimpleTest.finish();
   }, 6);
-};
+}
 
-// opener0 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window0", "_blank", "width=10,height=10");
-let opener1 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window1", "_blank", "width=10,height=10");
-let opener2 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window2", "_blank", "width=10,height=10");
-let opener3 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window3", "_blank", "width=10,height=10");
+//opener0 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window0", "_blank", "width=10,height=10");
+opener1 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window1", "_blank", "width=10,height=10");
+opener2 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window2", "_blank", "width=10,height=10");
+opener3 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window3", "_blank", "width=10,height=10");
 </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=408052">Mozilla Bug 408052</a>
 <pre id="test">
 <script type="text/javascript">
 SimpleTest.waitForExplicitFinish();
 </script>
--- a/docshell/test/navigation/test_opener.html
+++ b/docshell/test/navigation/test_opener.html
@@ -8,17 +8,17 @@
     <style type="text/css">
       iframe { width: 90%; height: 50px; }
     </style>
 <script>
 if (navigator.platform.startsWith("Linux")) {
   SimpleTest.expectAssertions(0, 1);
 }
 
-window.onload = function() {
+window.onload = function () {
   navigateByLocation(window0);
   navigateByOpen("window1");
   navigateByForm("window2");
   navigateByHyperlink("window3");
 
   xpcWaitForFinishedFrames(function() {
     isNavigated(window0, "Should be able to navigate popup by setting location.");
     isNavigated(window1, "Should be able to navigate popup by calling window.open.");
@@ -28,17 +28,17 @@ window.onload = function() {
     window0.close();
     window1.close();
     window2.close();
     window3.close();
 
     xpcCleanupWindows();
     SimpleTest.finish();
   }, 4);
-};
+}
 
 var window0 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/blank.html", "window0", "width=10,height=10");
 var window1 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/blank.html", "window1", "width=10,height=10");
 var window2 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/blank.html", "window2", "width=10,height=10");
 var window3 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/blank.html", "window3", "width=10,height=10");
 </script>
 </head>
 <body>
--- a/docshell/test/navigation/test_popup-navigates-children.html
+++ b/docshell/test/navigation/test_popup-navigates-children.html
@@ -4,22 +4,16 @@
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     <script type="text/javascript" src="NavigationUtils.js"></script>        
     <style type="text/css">
       iframe { width: 90%; height: 50px; }
     </style>
 <script>
-
-let window0 = null;
-let window1 = null;
-let window2 = null;
-let window3 = null;
-
 function testChild0() {
   if (!window.window0)
     window0 = window.open("navigate.html#opener.frames[0],location", "window0", "width=10,height=10");
 }
 
 function testChild1() {
   if (!window.window1)
     window1 = window.open("navigate.html#child1,open", "window1", "width=10,height=10");
--- a/docshell/test/navigation/test_reserved.html
+++ b/docshell/test/navigation/test_reserved.html
@@ -9,38 +9,38 @@
       iframe { width: 90%; height: 200px; }
     </style>
 <script>
 if (navigator.platform.startsWith("Mac")) {
   SimpleTest.expectAssertions(0, 2);
 }
 
 function testTop() {
-  let window0 = window.open("iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#top,location", "_blank", "width=10,height=10");
+  window0 = window.open("iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#top,location", "_blank", "width=10,height=10");
 
   xpcWaitForFinishedFrames(function() {
     isInaccessible(window0, "Should be able to navigate off-domain top by setting location.");
     window0.close();
     xpcCleanupWindows();
 
-    let window1 = window.open("iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#_top,open", "_blank", "width=10,height=10");
-
+    window1 = window.open("iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#_top,open", "_blank", "width=10,height=10");
+    
     xpcWaitForFinishedFrames(function() {
       isInaccessible(window1, "Should be able to navigate off-domain top by calling window.open.");
       window1.close();
       xpcCleanupWindows();
 
-      let window2 = window.open("iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#_top,form", "_blank", "width=10,height=10");
+      window2 = window.open("iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#_top,form", "_blank", "width=10,height=10");
 
       xpcWaitForFinishedFrames(function() {
         isInaccessible(window2, "Should be able to navigate off-domain top by submitting form.");
         window2.close();
         xpcCleanupWindows();
 
-        let window3 = window.open("iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#_top,hyperlink", "_blank", "width=10,height=10");
+        window3 = window.open("iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#_top,hyperlink", "_blank", "width=10,height=10");
 
         xpcWaitForFinishedFrames(function() {
           isInaccessible(window3, "Should be able to navigate off-domain top by targeted hyperlink.");
           window3.close();
           xpcCleanupWindows();
 
           testParent();
         }, 1);
@@ -79,17 +79,17 @@ function testParent() {
         }, 1);
       }, 1);
     }, 1);
   }, 1);
 }
 
 window.onload = function() {
   testTop();
-};
+}
 </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=408052">Mozilla Bug 408052</a>
 <div id="frames">
 </div>
 <pre id="test">
 <script type="text/javascript">
--- a/docshell/test/navigation/test_sessionhistory.html
+++ b/docshell/test/navigation/test_sessionhistory.html
@@ -20,17 +20,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 /** Test for Bug  **/
 
 var testFiles =
   [ "file_bug462076_1.html",         // Dynamic frames before onload
     "file_bug462076_2.html",         // Dynamic frames when handling onload
     "file_bug462076_3.html",         // Dynamic frames after onload
     "file_bug508537_1.html",         // Dynamic frames and forward-back
     "file_document_write_1.html",    // Session history + document.write
-    // "file_static_and_dynamic_1.html",// Static and dynamic frames and forward-back
+    //"file_static_and_dynamic_1.html",// Static and dynamic frames and forward-back
     "file_bug534178.html",           // Session history entry clean-up.
     "file_fragment_handling_during_load.html",
     "file_nested_frames.html",
     "file_shiftReload_and_pushState.html",
     "file_scrollRestoration.html",
     "file_bug1300461.html",
     "file_bug1326251.html",
     "file_bug1379762-1.html",
@@ -43,17 +43,17 @@ SimpleTest.requestFlakyTimeout("untriage
 
 var testWindow;
 function nextTest_() {
   if (testFiles.length) {
     testCount = 0;
     let nextFile = testFiles.shift();
     info("Running " + nextFile);
     testWindow = window.open(nextFile, "", "width=360,height=480");
-    testWindow.onunload = function() { }; // to prevent bfcache
+    testWindow.onunload = function () { } // to prevent bfcache
   } else {
     SimpleTest.finish();
   }
 }
 
 // Needed by file_document_write_1.html
 window.file_document_write_1_loadCount = 0;
 function isTestDynamic() {
--- a/docshell/test/navigation/test_sibling-matching-parent.html
+++ b/docshell/test/navigation/test_sibling-matching-parent.html
@@ -4,33 +4,33 @@
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     <script type="text/javascript" src="NavigationUtils.js"></script>        
     <style type="text/css">
       iframe { width: 90%; height: 50px; }
     </style>
 <script>
-window.onload = function() {
-  document.getElementById("active").innerHTML =
+window.onload = function () {
+  document.getElementById('active').innerHTML =
       '<iframe src="navigate.html#parent.frames[0],location"></iframe>' +
       '<iframe src="navigate.html#child1,open"></iframe>' +
       '<iframe src="navigate.html#child2,form"></iframe>' +
       '<iframe src="navigate.html#child3,hyperlink"></iframe>';
 
   xpcWaitForFinishedFrames(function() {
     isNavigated(frames[0], "Should be able to navigate sibling with on-domain parent by setting location.");
     isNavigated(frames[1], "Should be able to navigate sibling with on-domain parent by calling window.open.");
     isNavigated(frames[2], "Should be able to navigate sibling with on-domain parent by submitting form.");
     isNavigated(frames[3], "Should be able to navigate sibling with on-domain parent by targeted hyperlink.");
 
     xpcCleanupWindows();
     SimpleTest.finish();
   }, 4);
-};
+}
 </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=408052">Mozilla Bug 408052</a>
 <div id="frames">
 <iframe name="child0" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
 <iframe name="child1" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
 <iframe name="child2" src="http://test1.example.org:80/tests/docshell/test/navigation/blank.html"></iframe>
--- a/docshell/test/navigation/test_sibling-off-domain.html
+++ b/docshell/test/navigation/test_sibling-off-domain.html
@@ -4,33 +4,33 @@
     <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
     <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     <script type="text/javascript" src="NavigationUtils.js"></script>        
     <style type="text/css">
       iframe { width: 90%; height: 50px; }
     </style>
 <script>
-window.onload = function() {
-  document.getElementById("active").innerHTML =
+window.onload = function () {
+  document.getElementById('active').innerHTML =
       '<iframe src="http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#parent.frames[0],location"></iframe>' +
       '<iframe src="http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#child1,open"></iframe>' +
       '<iframe src="http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#child2,form"></iframe>' +
       '<iframe src="http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#child3,hyperlink"></iframe>';
 
   xpcWaitForFinishedFrames(function() {
     isBlank(frames[0], "Should not be able to navigate off-domain sibling by setting location.");
     isBlank(frames[1], "Should not be able to navigate off-domain sibling by calling window.open.");
     isBlank(frames[2], "Should not be able to navigate off-domain sibling by submitting form.");
     isBlank(frames[3], "Should not be able to navigate off-domain sibling by targeted hyperlink.");
 
     xpcCleanupWindows();
     SimpleTest.finish();
   }, 4);
-};
+}
 </script>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=408052">Mozilla Bug 408052</a>
 <div id="frames">
 <iframe name="child0" src="blank.html"></iframe>
 <iframe name="child1" src="blank.html"></iframe>
 <iframe name="child2" src="blank.html"></iframe>
--- a/docshell/test/navigation/test_triggeringprincipal_frame_nav.html
+++ b/docshell/test/navigation/test_triggeringprincipal_frame_nav.html
@@ -43,19 +43,19 @@ const TRIGGERINGPRINCIPALURI = BASEURL1 
 const LOADINGPRINCIPALURI = BASEURL2 + "file_triggeringprincipal_frame_2.html";
 
 SimpleTest.waitForExplicitFinish();
 
 window.addEventListener("message", receiveMessage);
 
 function receiveMessage(event) {
   is(event.data.triggeringPrincipalURI, TRIGGERINGPRINCIPALURI,
-     "TriggeringPrincipal should be the navigating iframe (Frame 1)");
+  	 "TriggeringPrincipal should be the navigating iframe (Frame 1)");
   is(event.data.loadingPrincipalURI, LOADINGPRINCIPALURI,
-     "LoadingPrincipal should be the enclosing iframe (Frame 2)");
+  	 "LoadingPrincipal should be the enclosing iframe (Frame 2)");
   is(event.data.referrerURI, TRIGGERINGPRINCIPALURI,
      "Referrer and TriggeringPrincipal should be identical (Frame 1)");
 
   window.removeEventListener("message", receiveMessage);
   SimpleTest.finish();
 }
 
 var frame1 = document.getElementById("testframe1");
--- a/docshell/test/navigation/test_triggeringprincipal_iframe_iframe_window_open.html
+++ b/docshell/test/navigation/test_triggeringprincipal_iframe_iframe_window_open.html
@@ -13,26 +13,26 @@
 
 <script type="text/javascript">
 
 /* We load an iframe (Frame A) which then gets navigated by another iframe (Frame B)
  * by calling window.open("http://", "Frame A") later in the test. We then verify the
  * TriggeringPrincipal and LoadingPrincipal of the navigated iframe (Frame A).
  *
  * +---------------------------------------+
- * |   Parent                              |
- * |                                       |
+ * |   Parent                              | 
+ * |                                       |   
  * |  +----------------------------+       |
- * |  | Frame A                    |       |
+ * |  | Frame A                    |       | 
  * |  |                            |       |
  * |  |                            |       |
  * |  +----------------------------+       |
- * |                                       |
+ * |                                       |   
  * |  +----------------------------+       |
- * |  | Frame B                    |       |
+ * |  | Frame B                    |       | 
  * |  |                            |       |
  * |  | win.open("http://", "A")   |       |
  * |  +----------------------------+       |
  * |                                       |
  * +---------------------------------------+
  *
  * Sequence of the test:
  *   [1] load Frame A
@@ -44,44 +44,44 @@ const TRIGGERING_PRINCIPAL_URI =
   "http://mochi.test:8888/tests/docshell/test/navigation/file_triggeringprincipal_iframe_iframe_window_open_frame_b.html";
 
 const LOADING_PRINCIPAL_URI =
   "http://mochi.test:8888/tests/docshell/test/navigation/test_triggeringprincipal_iframe_iframe_window_open.html";
 
 var frameA = document.getElementById("framea");
 
 function checkResults() {
-  frameA.removeEventListener("load", checkResults);
+  frameA.removeEventListener('load', checkResults);
 
   var channel = SpecialPowers.wrap(frameA.contentWindow).docShell.currentDocumentChannel;
   var triggeringPrincipal = channel.loadInfo.triggeringPrincipal.URI.asciiSpec;
   var loadingPrincipal = channel.loadInfo.loadingPrincipal.URI.asciiSpec;
 
   is(triggeringPrincipal, TRIGGERING_PRINCIPAL_URI,
     "TriggeringPrincipal for targeted window.open() should be the iframe triggering the load");
 
   is(frameA.contentDocument.referrer, TRIGGERING_PRINCIPAL_URI,
     "Referrer for targeted window.open() should be the principal of the iframe triggering the load");
 
   is(loadingPrincipal, LOADING_PRINCIPAL_URI,
     "LoadingPrincipal for targeted window.open() should be the containing document");
-
+ 
   SimpleTest.finish();
 }
 
 function performNavigation() {
-  frameA.removeEventListener("load", performNavigation);
-  frameA.addEventListener("load", checkResults);
+  frameA.removeEventListener('load', performNavigation);
+  frameA.addEventListener('load', checkResults);
 
   // load Frame B which then navigates Frame A
   var frameB = document.getElementById("frameb");
   frameB.src = "file_triggeringprincipal_iframe_iframe_window_open_frame_b.html";
 }
 
 // start the test
 SimpleTest.waitForExplicitFinish();
 
-frameA.addEventListener("load", performNavigation);
+frameA.addEventListener('load', performNavigation);
 
 </script>
 </pre>
 </body>
 </html>
--- a/docshell/test/navigation/test_triggeringprincipal_parent_iframe_window_open.html
+++ b/docshell/test/navigation/test_triggeringprincipal_parent_iframe_window_open.html
@@ -12,59 +12,59 @@
 
 <script type="text/javascript">
 
 /* We load an iframe which then gets navigated by the iframe's parent by calling
  *  window.open("http://", iframe) later in the test. We then verify the
  * TriggeringPrincipal and LoadingPrincipal of the navigated iframe.
  *
  * +------------------------------------------+
- * |                                          |
+ * |                                          | 
  * |  +------------------+                    |
- * |  | testframe        |                    |
+ * |  | testframe        |                    | 
  * |  +------------------+                    |
- * |                                          |
+ * |                                          | 
  * | window.open("http://", "testframe");     |
- * |                                          |
+ * |                                          | 
  * +------------------------------------------+
  */
 
 const TRIGGERING_PRINCIPAL_URI =
   "http://mochi.test:8888/tests/docshell/test/navigation/test_triggeringprincipal_parent_iframe_window_open.html";
 
 const LOADING_PRINCIPAL_URI = TRIGGERING_PRINCIPAL_URI;
 
 var testframe = document.getElementById("testframe");
 
 function checkResults() {
-  testframe.removeEventListener("load", checkResults);
+  testframe.removeEventListener('load', checkResults);
 
   var channel = SpecialPowers.wrap(testframe.contentWindow).docShell.currentDocumentChannel;
   var triggeringPrincipal = channel.loadInfo.triggeringPrincipal.URI.asciiSpec;
   var loadingPrincipal = channel.loadInfo.loadingPrincipal.URI.asciiSpec;
 
   is(triggeringPrincipal, TRIGGERING_PRINCIPAL_URI,
     "TriggeringPrincipal for targeted window.open() should be the principal of the document");
 
   is(testframe.contentDocument.referrer, TRIGGERING_PRINCIPAL_URI,
     "Referrer for targeted window.open() should be the principal of the document");
 
   is(loadingPrincipal, LOADING_PRINCIPAL_URI,
     "LoadingPrincipal for targeted window.open() should be the <iframe>.ownerDocument");
-
+ 
   SimpleTest.finish();
 }
 
 function performNavigation() {
-  testframe.removeEventListener("load", performNavigation);
-  testframe.addEventListener("load", checkResults);
-  window.open("file_triggeringprincipal_parent_iframe_window_open_nav.html", "testframe");
+  testframe.removeEventListener('load', performNavigation);
+  testframe.addEventListener('load', checkResults);
+  win = window.open("file_triggeringprincipal_parent_iframe_window_open_nav.html", "testframe");
 }
 
 // start the test
 SimpleTest.waitForExplicitFinish();
 
-testframe.addEventListener("load", performNavigation);
+testframe.addEventListener('load', performNavigation);
 
 </script>
 </pre>
 </body>
 </html>
--- a/docshell/test/navigation/test_triggeringprincipal_window_open.html
+++ b/docshell/test/navigation/test_triggeringprincipal_window_open.html
@@ -45,17 +45,17 @@ httpWin.onload = function() {
   is(httpWin.document.referrer, TRIGGERING_PRINCIPAL_URI,
      "Referrer for window.open(http:) should be the principal of the document");
 
   is(httpLoadingPrincipal, null,
      "LoadingPrincipal for window.open(http:) should be null");
 
   httpWin.close();
   checkFinish();
-};
+}
 
 // ----------------------------------------------------------------------------
 // Test 2: window.open(javascript:)
 var jsWin = window.open("javascript:'<html><body>js</body></html>';", "_blank", "width=10,height=10");
 jsWin.onload = function() {
   var jsChannel = SpecialPowers.wrap(jsWin).docShell.currentDocumentChannel;
   var jsTriggeringPrincipal = jsChannel.loadInfo.triggeringPrincipal.URI.asciiSpec;
   var jsLoadingPrincipal = jsChannel.loadInfo.loadingPrincipal;
@@ -66,14 +66,14 @@ jsWin.onload = function() {
   is(jsWin.document.referrer, "",
      "Referrer for window.open(javascript:) should be empty");
 
   is(jsLoadingPrincipal, null,
      "LoadingPrincipal for window.open(javascript:) should be null");
 
   jsWin.close();
   checkFinish();
-};
+}
 
 </script>
 </pre>
 </body>
 </html>
--- a/docshell/test/unit/head_docshell.js
+++ b/docshell/test/unit/head_docshell.js
@@ -1,7 +1,7 @@
 /* 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/. */
-ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-var dirSvc = Services.dirSvc;
+var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
+             getService(Ci.nsIProperties);
 var profileDir = do_get_profile();
--- a/docshell/test/unit/test_bug442584.js
+++ b/docshell/test/unit/test_bug442584.js
@@ -1,28 +1,30 @@
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-
 var prefetch = Cc["@mozilla.org/prefetch-service;1"].
                getService(Ci.nsIPrefetchService);
+var ios = Cc["@mozilla.org/network/io-service;1"].
+          getService(Ci.nsIIOService);
+var prefs = Cc["@mozilla.org/preferences-service;1"].
+            getService(Ci.nsIPrefBranch);
 
 function run_test() {
   // Fill up the queue
-  Services.prefs.setBoolPref("network.prefetch-next", true);
+  prefs.setBoolPref("network.prefetch-next", true);
   for (var i = 0; i < 5; i++) {
-    var uri = Services.io.newURI("http://localhost/" + i);
+    var uri = ios.newURI("http://localhost/" + i);
     prefetch.prefetchURI(uri, uri, null, true);
   }
 
   // Make sure the queue has items in it...
   Assert.ok(prefetch.hasMoreElements());
 
   // Now disable the pref to force the queue to empty...
-  Services.prefs.setBoolPref("network.prefetch-next", false);
+  prefs.setBoolPref("network.prefetch-next", false);
   Assert.ok(!prefetch.hasMoreElements());
 
   // Now reenable the pref, and add more items to the queue.
-  Services.prefs.setBoolPref("network.prefetch-next", true);
-  for (var k = 0; k < 5; k++) {
-    var uri2 = Services.io.newURI("http://localhost/" + k);
-    prefetch.prefetchURI(uri2, uri2, null, true);
+  prefs.setBoolPref("network.prefetch-next", true);
+  for (var i = 0; i < 5; i++) {
+    var uri = ios.newURI("http://localhost/" + i);
+    prefetch.prefetchURI(uri, uri, null, true);
   }
   Assert.ok(prefetch.hasMoreElements());
 }
--- a/docshell/test/unit/test_nsDefaultURIFixup.js
+++ b/docshell/test/unit/test_nsDefaultURIFixup.js
@@ -1,96 +1,103 @@
-ChromeUtils.import("resource://gre/modules/Services.jsm");
+var urifixup = Cc["@mozilla.org/docshell/urifixup;1"].
+               getService(Ci.nsIURIFixup);
+var prefs = Cc["@mozilla.org/preferences-service;1"].
+            getService(Ci.nsIPrefBranch);
 
 var pref = "browser.fixup.typo.scheme";
 
 var data = [
   {
     // ttp -> http.
-    wrong: "ttp://www.example.com/",
-    fixed: "http://www.example.com/",
+    wrong: 'ttp://www.example.com/',
+    fixed: 'http://www.example.com/',
   },
   {
     // htp -> http.
-    wrong: "htp://www.example.com/",
-    fixed: "http://www.example.com/",
+    wrong: 'htp://www.example.com/',
+    fixed: 'http://www.example.com/',
   },
   {
     // ttps -> https.
-    wrong: "ttps://www.example.com/",
-    fixed: "https://www.example.com/",
+    wrong: 'ttps://www.example.com/',
+    fixed: 'https://www.example.com/',
   },
   {
     // tps -> https.
-    wrong: "tps://www.example.com/",
-    fixed: "https://www.example.com/",
+    wrong: 'tps://www.example.com/',
+    fixed: 'https://www.example.com/',
   },
   {
     // ps -> https.
-    wrong: "ps://www.example.com/",
-    fixed: "https://www.example.com/",
+    wrong: 'ps://www.example.com/',
+    fixed: 'https://www.example.com/',
   },
   {
     // htps -> https.
-    wrong: "htps://www.example.com/",
-    fixed: "https://www.example.com/",
+    wrong: 'htps://www.example.com/',
+    fixed: 'https://www.example.com/',
   },
   {
     // ile -> file.
-    wrong: "ile:///this/is/a/test.html",
-    fixed: "file:///this/is/a/test.html",
+    wrong: 'ile:///this/is/a/test.html',
+    fixed: 'file:///this/is/a/test.html',
   },
   {
     // le -> file.
-    wrong: "le:///this/is/a/test.html",
-    fixed: "file:///this/is/a/test.html",
+    wrong: 'le:///this/is/a/test.html',
+    fixed: 'file:///this/is/a/test.html',
   },
   {
     // Valid should not be changed.
-    wrong: "https://example.com/this/is/a/test.html",
-    fixed: "https://example.com/this/is/a/test.html",
+    wrong: 'https://example.com/this/is/a/test.html',
+    fixed: 'https://example.com/this/is/a/test.html',
   },
   {
     // Unmatched should not be changed.
-    wrong: "whatever://this/is/a/test.html",
-    fixed: "whatever://this/is/a/test.html",
+    wrong: 'whatever://this/is/a/test.html',
+    fixed: 'whatever://this/is/a/test.html',
   },
 ];
 
 var len = data.length;
 
+function run_test() {
+  run_next_test();
+}
+
 // Make sure we fix what needs fixing when there is no pref set.
 add_task(function test_unset_pref_fixes_typos() {
-  Services.prefs.clearUserPref(pref);
+  prefs.clearUserPref(pref);
   for (let i = 0; i < len; ++i) {
     let item = data[i];
     let result =
-      Services.uriFixup.createFixupURI(item.wrong,
-                              Services.uriFixup.FIXUP_FLAG_FIX_SCHEME_TYPOS).spec;
+      urifixup.createFixupURI(item.wrong,
+                              urifixup.FIXUP_FLAG_FIX_SCHEME_TYPOS).spec;
     Assert.equal(result, item.fixed);
   }
 });
-
+  
 // Make sure we don't do anything when the pref is explicitly
 // set to false.
 add_task(function test_false_pref_keeps_typos() {
-  Services.prefs.setBoolPref(pref, false);
+  prefs.setBoolPref(pref, false);
   for (let i = 0; i < len; ++i) {
     let item = data[i];
     let result =
-      Services.uriFixup.createFixupURI(item.wrong,
-                              Services.uriFixup.FIXUP_FLAG_FIX_SCHEME_TYPOS).spec;
+      urifixup.createFixupURI(item.wrong,
+                              urifixup.FIXUP_FLAG_FIX_SCHEME_TYPOS).spec;
     Assert.equal(result, item.wrong);
   }
 });
 
 // Finally, make sure we still fix what needs fixing if the pref is
 // explicitly set to true.
 add_task(function test_true_pref_fixes_typos() {
-  Services.prefs.setBoolPref(pref, true);
+  prefs.setBoolPref(pref, true);
   for (let i = 0; i < len; ++i) {
     let item = data[i];
     let result =
-        Services.uriFixup.createFixupURI(item.wrong,
-                                Services.uriFixup.FIXUP_FLAG_FIX_SCHEME_TYPOS).spec;
+        urifixup.createFixupURI(item.wrong,
+                                urifixup.FIXUP_FLAG_FIX_SCHEME_TYPOS).spec;
     Assert.equal(result, item.fixed);
   }
 });
--- a/docshell/test/unit/test_nsDefaultURIFixup_info.js
+++ b/docshell/test/unit/test_nsDefaultURIFixup_info.js
@@ -1,8 +1,11 @@
+var urifixup = Cc["@mozilla.org/docshell/urifixup;1"].
+               getService(Ci.nsIURIFixup);
+
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var prefList = ["browser.fixup.typo.scheme", "keyword.enabled",
                 "browser.fixup.domainwhitelist.whitelisted"];
 for (let pref of prefList) {
   Services.prefs.setBoolPref(pref, true);
 }
 
@@ -32,26 +35,26 @@ registerCleanupFunction(function() {
     Services.search.removeEngine(engine);
   }
   Services.prefs.clearUserPref("keyword.enabled");
   Services.prefs.clearUserPref("browser.fixup.typo.scheme");
   Services.prefs.clearUserPref(kForceHostLookup);
 });
 
 var flagInputs = [
-  Services.uriFixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP,
-  Services.uriFixup.FIXUP_FLAGS_MAKE_ALTERNATE_URI,
-  Services.uriFixup.FIXUP_FLAG_FIX_SCHEME_TYPOS,
+  urifixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP,
+  urifixup.FIXUP_FLAGS_MAKE_ALTERNATE_URI,
+  urifixup.FIXUP_FLAG_FIX_SCHEME_TYPOS,
 ];
 
 flagInputs.concat([
   flagInputs[0] | flagInputs[1],
   flagInputs[1] | flagInputs[2],
   flagInputs[0] | flagInputs[2],
-  flagInputs[0] | flagInputs[1] | flagInputs[2],
+  flagInputs[0] | flagInputs[1] | flagInputs[2]
 ]);
 
 /*
   The following properties are supported for these test cases:
   {
     input: "", // Input string, required
     fixedURI: "", // Expected fixedURI
     alternateURI: "", // Expected alternateURI
@@ -197,35 +200,35 @@ var testcases = [ {
     input: "[fe80:cd00:0:cde:1257:0:211e:729c]",
     fixedURI: "http://[fe80:cd00:0:cde:1257:0:211e:729c]/",
     alternateURI: "http://[fe80:cd00:0:cde:1257:0:211e:729c]/",
     protocolChange: true,
   }, {
     input: "[64:ff9b::8.8.8.8]",
     fixedURI: "http://[64:ff9b::808:808]/",
     alternateURI: "http://[64:ff9b::808:808]/",
-    protocolChange: true,
+    protocolChange: true
   }, {
     input: "[64:ff9b::8.8.8.8]/~moz",
     fixedURI: "http://[64:ff9b::808:808]/~moz",
     alternateURI: "http://[64:ff9b::808:808]/~moz",
-    protocolChange: true,
+    protocolChange: true
   }, {
     input: "[::1][::1]",
     keywordLookup: true,
-    protocolChange: true,
+    protocolChange: true
   }, {
     input: "[::1][100",
     fixedURI: null,
     keywordLookup: true,
-    protocolChange: true,
+    protocolChange: true
   }, {
     input: "[::1]]",
     keywordLookup: true,
-    protocolChange: true,
+    protocolChange: true
   }, {
     input: "1234",
     fixedURI: "http://0.0.4.210/",
     keywordLookup: true,
     protocolChange: true,
     affectedByDNSForSingleHosts: true,
   }, {
     input: "host/foo.txt",
@@ -336,17 +339,17 @@ var testcases = [ {
     input: "http://whitelisted/",
     fixedURI: "http://whitelisted/",
     alternateURI: "http://www.whitelisted.com/",
     inWhitelist: true,
   }, {
     input: "café.local",
     fixedURI: "http://xn--caf-dma.local/",
     alternateURI: "http://www.xn--caf-dma.local/",
-    protocolChange: true,
+    protocolChange: true
   }, {
     input: "47.6182,-122.830",
     fixedURI: "http://47.6182,-122.830/",
     keywordLookup: true,
     protocolChange: true,
     affectedByDNSForSingleHosts: true,
   }, {
     input: "-47.6182,-23.51",
@@ -377,48 +380,48 @@ var testcases = [ {
     input: "5/2",
     fixedURI: "http://0.0.0.5/2",
     keywordLookup: true,
     protocolChange: true,
     affectedByDNSForSingleHosts: true,
   }, {
     input: "moz ?.::%27",
     keywordLookup: true,
-    protocolChange: true,
+    protocolChange: true
   }, {
     input: "mozilla.com/?q=search",
     fixedURI: "http://mozilla.com/?q=search",
     alternateURI: "http://www.mozilla.com/?q=search",
-    protocolChange: true,
+    protocolChange: true
   }, {
     input: "mozilla.com?q=search",
     fixedURI: "http://mozilla.com/?q=search",
     alternateURI: "http://www.mozilla.com/?q=search",
-    protocolChange: true,
+    protocolChange: true
   }, {
     input: "mozilla.com ?q=search",
     keywordLookup: true,
-    protocolChange: true,
+    protocolChange: true
   }, {
     input: "mozilla.com.?q=search",
     fixedURI: "http://mozilla.com./?q=search",
-    protocolChange: true,
+    protocolChange: true
   }, {
     input: "mozilla.com'?q=search",
     fixedURI: "http://mozilla.com'/?q=search",
     alternateURI: "http://www.mozilla.com'/?q=search",
-    protocolChange: true,
+    protocolChange: true
   }, {
     input: "mozilla.com':search",
     keywordLookup: true,
-    protocolChange: true,
+    protocolChange: true
   }, {
     input: "[mozilla]",
     keywordLookup: true,
-    protocolChange: true,
+    protocolChange: true
   }, {
     input: "':?",
     fixedURI: "http://'/?",
     alternateURI: "http://www.'.com/?",
     keywordLookup: true,
     protocolChange: true,
   }, {
     input: "a?.com",
@@ -427,17 +430,17 @@ var testcases = [ {
     protocolChange: true,
   }, {
     input: "?'.com",
     keywordLookup: true,
     protocolChange: true,
   }, {
     input: "' ?.com",
     keywordLookup: true,
-    protocolChange: true,
+    protocolChange: true
   }, {
     input: "?mozilla",
     keywordLookup: true,
     protocolChange: true,
   }, {
     input: "??mozilla",
     keywordLookup: true,
     protocolChange: true,
@@ -570,24 +573,24 @@ function do_single_test_run() {
     affectedByDNSForSingleHosts = !!affectedByDNSForSingleHosts;
 
     expectKeywordLookup = expectKeywordLookup && (!affectedByDNSForSingleHosts || !gSingleWordHostLookup);
 
     for (let flags of flagInputs) {
       let URIInfo;
       let fixupURIOnly = null;
       try {
-        fixupURIOnly = Services.uriFixup.createFixupURI(testInput, flags);
+        fixupURIOnly = urifixup.createFixupURI(testInput, flags);
       } catch (ex) {
         info("Caught exception: " + ex);
         Assert.equal(expectedFixedURI, null);
       }
 
       try {
-        URIInfo = Services.uriFixup.getFixupURIInfo(testInput, flags);
+        URIInfo = urifixup.getFixupURIInfo(testInput, flags);
       } catch (ex) {
         // Both APIs should return an error in the same cases.
         info("Caught exception: " + ex);
         Assert.equal(expectedFixedURI, null);
         Assert.equal(fixupURIOnly, null);
         continue;
       }
 
@@ -595,26 +598,28 @@ function do_single_test_run() {
            " (host lookup for single words: " + (gSingleWordHostLookup ? "yes" : "no") + ")");
 
       // Both APIs should then also be using the same spec.
       Assert.equal(!!fixupURIOnly, !!URIInfo.preferredURI);
       if (fixupURIOnly) {
         Assert.equal(fixupURIOnly.spec, URIInfo.preferredURI.spec, "Fixed and preferred URI should match");
       }
 
+      let isFileURL = expectedFixedURI && expectedFixedURI.startsWith("file");
+
       // Check the fixedURI:
-      let makeAlternativeURI = flags & Services.uriFixup.FIXUP_FLAGS_MAKE_ALTERNATE_URI;
+      let makeAlternativeURI = flags & urifixup.FIXUP_FLAGS_MAKE_ALTERNATE_URI;
       if (makeAlternativeURI && alternativeURI != null) {
         Assert.equal(URIInfo.fixedURI.spec, alternativeURI, "should have gotten alternate URI");
       } else {
         Assert.equal(URIInfo.fixedURI && URIInfo.fixedURI.spec, expectedFixedURI, "should get correct fixed URI");
       }
 
       // Check booleans on input:
-      let couldDoKeywordLookup = flags & Services.uriFixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP;
+      let couldDoKeywordLookup = flags & urifixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP;
       Assert.equal(!!URIInfo.keywordProviderName, couldDoKeywordLookup && expectKeywordLookup, "keyword lookup as expected");
       Assert.equal(URIInfo.fixupChangedProtocol, expectProtocolChange, "protocol change as expected");
       Assert.equal(URIInfo.fixupCreatedAlternateURI, makeAlternativeURI && alternativeURI != null, "alternative URI as expected");
 
       // Check the preferred URI
       if (couldDoKeywordLookup) {
         if (expectKeywordLookup) {
           if (!inWhitelist) {
--- a/docshell/test/unit/test_nsDefaultURIFixup_search.js
+++ b/docshell/test/unit/test_nsDefaultURIFixup_search.js
@@ -1,8 +1,10 @@
+var urifixup = Cc["@mozilla.org/docshell/urifixup;1"].
+               getService(Ci.nsIURIFixup);
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 Services.prefs.setBoolPref("keyword.enabled", true);
 
 const kSearchEngineID = "test_urifixup_search_engine";
 const kSearchEngineURL = "http://www.example.org/?search={searchTerms}";
 Services.search.addEngineWithDetails(kSearchEngineID, "", "", "", "get",
@@ -30,87 +32,91 @@ registerCleanupFunction(function() {
   Services.prefs.clearUserPref("keyword.enabled");
 });
 
 var isWin = AppConstants.platform == "win";
 
 var data = [
   {
     // Valid should not be changed.
-    wrong: "https://example.com/this/is/a/test.html",
-    fixed: "https://example.com/this/is/a/test.html",
+    wrong: 'https://example.com/this/is/a/test.html',
+    fixed: 'https://example.com/this/is/a/test.html',
   },
   {
     // Unrecognized protocols should be changed.
-    wrong: "whatever://this/is/a/test.html",
-    fixed: kSearchEngineURL.replace("{searchTerms}", encodeURIComponent("whatever://this/is/a/test.html")),
+    wrong: 'whatever://this/is/a/test.html',
+    fixed: kSearchEngineURL.replace("{searchTerms}", encodeURIComponent('whatever://this/is/a/test.html')),
   },
 
   // The following tests check that when a user:password is present in the URL
   // `user:` isn't treated as an unknown protocol thus leaking the user and
   // password to the search engine.
   {
-    wrong: "user:pass@example.com/this/is/a/test.html",
-    fixed: "http://user:pass@example.com/this/is/a/test.html",
+    wrong: 'user:pass@example.com/this/is/a/test.html',
+    fixed: 'http://user:pass@example.com/this/is/a/test.html',
   },
   {
-    wrong: "user@example.com:8080/this/is/a/test.html",
-    fixed: "http://user@example.com:8080/this/is/a/test.html",
+    wrong: 'user@example.com:8080/this/is/a/test.html',
+    fixed: 'http://user@example.com:8080/this/is/a/test.html',
   },
   {
-    wrong: "https:pass@example.com/this/is/a/test.html",
-    fixed: "https://pass@example.com/this/is/a/test.html",
+    wrong: 'https:pass@example.com/this/is/a/test.html',
+    fixed: 'https://pass@example.com/this/is/a/test.html',
   },
   {
-    wrong: "user:pass@example.com:8080/this/is/a/test.html",
-    fixed: "http://user:pass@example.com:8080/this/is/a/test.html",
+    wrong: 'user:pass@example.com:8080/this/is/a/test.html',
+    fixed: 'http://user:pass@example.com:8080/this/is/a/test.html',
   },
   {
-    wrong: "http:user:pass@example.com:8080/this/is/a/test.html",
-    fixed: "http://user:pass@example.com:8080/this/is/a/test.html",
+    wrong: 'http:user:pass@example.com:8080/this/is/a/test.html',
+    fixed: 'http://user:pass@example.com:8080/this/is/a/test.html',
   },
   {
-    wrong: "ttp:user:pass@example.com:8080/this/is/a/test.html",
-    fixed: "http://user:pass@example.com:8080/this/is/a/test.html",
+    wrong: 'ttp:user:pass@example.com:8080/this/is/a/test.html',
+    fixed: 'http://user:pass@example.com:8080/this/is/a/test.html',
   },
   {
-    wrong: "gobbledygook:user:pass@example.com:8080/this/is/a/test.html",
-    fixed: "http://gobbledygook:user%3Apass@example.com:8080/this/is/a/test.html",
+    wrong: 'gobbledygook:user:pass@example.com:8080/this/is/a/test.html',
+    fixed: 'http://gobbledygook:user%3Apass@example.com:8080/this/is/a/test.html',
   },
   {
-    wrong: "user:@example.com:8080/this/is/a/test.html",
-    fixed: "http://user@example.com:8080/this/is/a/test.html",
+    wrong: 'user:@example.com:8080/this/is/a/test.html',
+    fixed: 'http://user@example.com:8080/this/is/a/test.html',
   },
   {
-    wrong: "//user:pass@example.com:8080/this/is/a/test.html",
-    fixed: (isWin ? "http:" : "file://") + "//user:pass@example.com:8080/this/is/a/test.html",
+    wrong: '//user:pass@example.com:8080/this/is/a/test.html',
+    fixed: (isWin ? "http:" : "file://") + '//user:pass@example.com:8080/this/is/a/test.html',
   },
   {
-    wrong: "://user:pass@example.com:8080/this/is/a/test.html",
-    fixed: "http://user:pass@example.com:8080/this/is/a/test.html",
+    wrong: '://user:pass@example.com:8080/this/is/a/test.html',
+    fixed: 'http://user:pass@example.com:8080/this/is/a/test.html',
   },
   {
-    wrong: "whatever://this/is/a@b/test.html",
-    fixed: kSearchEngineURL.replace("{searchTerms}", encodeURIComponent("whatever://this/is/a@b/test.html")),
+    wrong: 'whatever://this/is/a@b/test.html',
+    fixed: kSearchEngineURL.replace("{searchTerms}", encodeURIComponent('whatever://this/is/a@b/test.html')),
   },
 ];
 
 var extProtocolSvc = Cc["@mozilla.org/uriloader/external-protocol-service;1"]
                      .getService(Ci.nsIExternalProtocolService);
 
 if (extProtocolSvc && extProtocolSvc.externalProtocolHandlerExists("mailto")) {
   data.push({
     wrong: "mailto:foo@bar.com",
-    fixed: "mailto:foo@bar.com",
+    fixed: "mailto:foo@bar.com"
   });
 }
 
+function run_test() {
+  run_next_test();
+}
+
 var len = data.length;
 // Make sure we fix what needs fixing
 add_task(function test_fix_unknown_schemes() {
   for (let i = 0; i < len; ++i) {
     let item = data[i];
     let result =
-      Services.uriFixup.createFixupURI(item.wrong,
-                              Services.uriFixup.FIXUP_FLAG_FIX_SCHEME_TYPOS).spec;
+      urifixup.createFixupURI(item.wrong,
+                              urifixup.FIXUP_FLAG_FIX_SCHEME_TYPOS).spec;
     Assert.equal(result, item.fixed);
   }
 });
--- a/docshell/test/unit/test_pb_notification.js
+++ b/docshell/test/unit/test_pb_notification.js
@@ -1,18 +1,19 @@
 function destroy_transient_docshell() {
   let windowlessBrowser = Services.appShell.createWindowlessBrowser(false);
-  windowlessBrowser.docShell.setOriginAttributes({privateBrowsingId: 1});
+  windowlessBrowser.docshell.setOriginAttributes({privateBrowsingId : 1});
   windowlessBrowser.close();
   do_test_pending();
   do_timeout(0, Cu.forceGC);
 }
 
 function run_test() {
   var obs = {
-    observe(aSubject, aTopic, aData) {
+    observe: function(aSubject, aTopic, aData) {
       Assert.equal(aTopic, "last-pb-context-exited");
       do_test_finished();
-    },
+    }
   };
-  Services.obs.addObserver(obs, "last-pb-context-exited");
+  var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
+  os.addObserver(obs, "last-pb-context-exited");
   destroy_transient_docshell();
 }
--- a/docshell/test/unit/test_privacy_transition.js
+++ b/docshell/test/unit/test_privacy_transition.js
@@ -1,20 +1,26 @@
 var gNotifications = 0;
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var observer = {
-  QueryInterface: ChromeUtils.generateQI(["nsIPrivacyTransitionObserver", "nsISupportsWeakReference"]),
+  QueryInterface: function(iid) {
+    if (Ci.nsIPrivacyTransitionObserver.equals(iid) ||
+        Ci.nsISupportsWeakReference.equals(iid) ||
+        Ci.nsISupports.equals(iid))
+      return this;
+    throw Cr.NS_ERROR_NO_INTERFACE;
+  },
 
-  privateModeChanged(enabled) {
+  privateModeChanged: function(enabled) {
     gNotifications++;
-  },
-};
+  }
+}
 
 function run_test() {
   let windowlessBrowser = Services.appShell.createWindowlessBrowser(false);
   windowlessBrowser.docShell.addWeakPrivacyTransitionObserver(observer);
-  windowlessBrowser.docShell.setOriginAttributes({privateBrowsingId: 1});
-  windowlessBrowser.docShell.setOriginAttributes({privateBrowsingId: 0});
+  windowlessBrowser.docShell.setOriginAttributes({privateBrowsingId : 1});
+  windowlessBrowser.docShell.setOriginAttributes({privateBrowsingId : 0});
   windowlessBrowser.close();
   Assert.equal(gNotifications, 2);
 }
--- a/docshell/test/unit_ipc/test_pb_notification_ipc.js
+++ b/docshell/test/unit_ipc/test_pb_notification_ipc.js
@@ -1,18 +1,17 @@
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-
 function run_test() {
   var notifications = 0;
   var obs = {
-    observe(aSubject, aTopic, aData) {
+    observe: function(aSubject, aTopic, aData) {
       Assert.equal(aTopic, "last-pb-context-exited");
       notifications++;
-    },
+    }
   };
-  Services.os.addObserver(obs, "last-pb-context-exited");
-
+  var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
+  os.addObserver(obs, "last-pb-context-exited");
+ 
   run_test_in_child("../unit/test_pb_notification.js",
                     function() {
                       Assert.equal(notifications, 1);
                       do_test_finished();
                     });
-}
+}
\ No newline at end of file