Backed out changeset 2a1b034ed3fb (bug 1314474) for xpcshell failures a=backout
authorWes Kocher <wkocher@mozilla.com>
Fri, 04 Nov 2016 13:57:56 -0700
changeset 321172 93ffc634816940fa697c3af1d037b7bbeff709e9
parent 321171 e38f9ff87d2ea70082a30d9c41a226753165226f
child 321173 5c253ee2e5bc35a764788e20bb2cd543a66647c5
push id83538
push userphilringnalda@gmail.com
push dateSat, 05 Nov 2016 04:05:02 +0000
treeherdermozilla-inbound@5da65f1ef193 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1314474
milestone52.0a1
backs out2a1b034ed3fb496b52ae8f4b55e3a18f44a81c29
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 changeset 2a1b034ed3fb (bug 1314474) for xpcshell failures a=backout
browser/base/content/test/general/browser_aboutAccounts.js
browser/base/content/test/general/browser_aboutHealthReport.js
browser/base/content/test/general/browser_audioTabIcon.js
browser/base/content/test/general/browser_bug1297539.js
browser/base/content/test/general/browser_bug491431.js
browser/base/content/test/general/browser_bug553455.js
browser/base/content/test/general/browser_bug561636.js
browser/base/content/test/general/browser_bug592338.js
browser/base/content/test/general/browser_bug676619.js
browser/base/content/test/general/browser_bug719271.js
browser/base/content/test/general/browser_bug763468_perwindowpb.js
browser/base/content/test/general/browser_bug767836_perwindowpb.js
browser/base/content/test/general/browser_clipboard.js
browser/base/content/test/general/browser_contentSearchUI.js
browser/base/content/test/general/browser_contextmenu.js
browser/base/content/test/general/browser_decoderDoctor.js
browser/base/content/test/general/browser_discovery.js
browser/base/content/test/general/browser_documentnavigation.js
browser/base/content/test/general/browser_e10s_chrome_process.js
browser/base/content/test/general/browser_feed_discovery.js
browser/base/content/test/general/browser_findbarClose.js
browser/base/content/test/general/browser_fullscreen-window-open.js
browser/base/content/test/general/browser_fxa_oauth.js
browser/base/content/test/general/browser_fxa_web_channel.js
browser/base/content/test/general/browser_fxaccounts.js
browser/base/content/test/general/browser_page_style_menu.js
browser/base/content/test/general/browser_popup_blocker.js
browser/base/content/test/general/browser_refreshBlocker.js
browser/base/content/test/general/browser_sanitizeDialog.js
browser/base/content/test/general/browser_save_link-perwindowpb.js
browser/base/content/test/general/browser_save_link_when_window_navigates.js
browser/base/content/test/general/browser_selectpopup.js
browser/base/content/test/general/browser_syncui.js
browser/base/content/test/general/browser_tabfocus.js
browser/base/content/test/general/browser_web_channel.js
browser/base/content/test/general/content_aboutAccounts.js
browser/base/content/test/general/contextmenu_common.js
browser/base/content/test/general/head.js
security/manager/ssl/tests/mochitest/stricttransportsecurity/test_sts_privatebrowsing_perwindowpb.html
testing/mochitest/mochitest.eslintrc.js
toolkit/components/alerts/test/test_alerts_noobserve.html
toolkit/components/alerts/test/test_alerts_requireinteraction.html
toolkit/components/alerts/test/test_image.html
toolkit/components/alerts/test/test_multiple_alerts.html
toolkit/components/alerts/test/test_principal.html
toolkit/components/extensions/test/mochitest/test_chrome_ext_background_debug_global.html
toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_saveAs.html
toolkit/components/extensions/test/mochitest/test_chrome_ext_storage_cleanup.html
toolkit/components/extensions/test/mochitest/test_ext_content_security_policy.html
toolkit/components/extensions/test/mochitest/test_ext_cookies_permissions.html
toolkit/components/extensions/test/mochitest/test_ext_i18n.html
toolkit/components/extensions/test/mochitest/test_ext_i18n_css.html
toolkit/components/extensions/test/mochitest/test_ext_permission_xhr.html
toolkit/components/extensions/test/mochitest/test_ext_storage_content.html
toolkit/components/extensions/test/mochitest/test_ext_storage_tab.html
toolkit/components/extensions/test/mochitest/test_ext_web_accessible_resources.html
toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html
toolkit/components/passwordmgr/test/browser/browser_DOMFormHasPassword.js
toolkit/components/passwordmgr/test/browser/browser_DOMInputPasswordAdded.js
toolkit/components/passwordmgr/test/browser/browser_http_autofill.js
toolkit/components/passwordmgr/test/browser/browser_insecurePasswordWarning.js
toolkit/components/passwordmgr/test/browser/browser_notifications.js
toolkit/components/passwordmgr/test/browser/browser_notifications_password.js
toolkit/components/passwordmgr/test/browser/browser_passwordmgr_sort.js
toolkit/components/passwordmgr/test/browser/browser_passwordmgrdlg.js
toolkit/components/passwordmgr/test/browser/head.js
toolkit/components/passwordmgr/test/chrome/test_privbrowsing_perwindowpb.html
toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html
toolkit/components/passwordmgr/test/mochitest/test_prompt_http.html
toolkit/components/passwordmgr/test/mochitest/test_prompt_noWindow.html
toolkit/components/passwordmgr/test/pwmgr_common.js
toolkit/components/passwordmgr/test/test_master_password.html
toolkit/components/passwordmgr/test/test_prompt_async.html
toolkit/components/passwordmgr/test/unit/test_context_menu.js
toolkit/components/places/tests/bookmarks/test_bookmarks.js
toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage.js
toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage_failures.js
toolkit/components/places/tests/browser/browser_redirect.js
toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js
toolkit/components/places/tests/browser/head.js
toolkit/components/places/tests/expiration/test_annos_expire_policy.js
toolkit/components/places/tests/expiration/test_pref_interval.js
toolkit/components/places/tests/head_common.js
toolkit/components/places/tests/history/test_remove.js
toolkit/components/places/tests/queries/head_queries.js
toolkit/components/places/tests/queries/test_results-as-visit.js
toolkit/components/places/tests/unit/test_408221.js
toolkit/components/places/tests/unit/test_415757.js
toolkit/components/places/tests/unit/test_async_transactions.js
toolkit/components/places/tests/unit/test_bookmarks_html.js
toolkit/components/places/tests/unit/test_bookmarks_html_corrupt.js
toolkit/components/places/tests/unit/test_download_history.js
toolkit/components/places/tests/unit/test_getPlacesInfo.js
toolkit/components/places/tests/unit/test_history_autocomplete_tags.js
toolkit/components/places/tests/unit/test_isURIVisited.js
toolkit/components/satchel/test/test_form_autocomplete.html
toolkit/components/satchel/test/test_form_autocomplete_with_list.html
toolkit/components/satchel/test/test_form_submission.html
toolkit/components/satchel/test/unit/test_autocomplete.js
toolkit/content/tests/widgets/popup_shared.js
toolkit/content/tests/widgets/tree_shared.js
--- a/browser/base/content/test/general/browser_aboutAccounts.js
+++ b/browser/base/content/test/general/browser_aboutAccounts.js
@@ -401,22 +401,22 @@ var gTests = [
 },
 ]; // gTests
 
 function test()
 {
   waitForExplicitFinish();
 
   Task.spawn(function* () {
-    for (let testCase of gTests) {
-      info(testCase.desc);
+    for (let test of gTests) {
+      info(test.desc);
       try {
-        yield testCase.run();
+        yield test.run();
       } finally {
-        yield testCase.teardown();
+        yield test.teardown();
       }
     }
 
     finish();
   });
 }
 
 function promiseOneMessage(tab, messageName) {
--- a/browser/base/content/test/general/browser_aboutHealthReport.js
+++ b/browser/base/content/test/general/browser_aboutHealthReport.js
@@ -99,23 +99,23 @@ var gTests = [
 function test()
 {
   waitForExplicitFinish();
 
   // xxxmpc leaving this here until we resolve bug 854038 and bug 854060
   requestLongerTimeout(10);
 
   Task.spawn(function* () {
-    for (let testCase of gTests) {
-      info(testCase.desc);
-      yield testCase.setup();
+    for (let test of gTests) {
+      info(test.desc);
+      yield test.setup();
 
       let iframe = yield promiseNewTabLoadEvent("about:healthreport");
 
-      yield testCase.run(iframe);
+      yield test.run(iframe);
 
       gBrowser.removeCurrentTab();
     }
 
     finish();
   });
 }
 
--- a/browser/base/content/test/general/browser_audioTabIcon.js
+++ b/browser/base/content/test/general/browser_audioTabIcon.js
@@ -312,22 +312,22 @@ function* test_browser_swapping(tab, bro
     // Now, test swapping with a muted but not playing tab.
     // Note that the tab remains muted, so we only need to pause playback.
     tab = gBrowser.getTabForBrowser(newBrowser);
     yield pause(tab);
 
     yield BrowserTestUtils.withNewTab({
       gBrowser,
       url: "about:blank",
-    }, secondAboutBlankBrowser => test_swapped_browser_while_not_playing(tab, secondAboutBlankBrowser));
+    }, newBrowser => test_swapped_browser_while_not_playing(tab, newBrowser));
   });
 }
 
 function* test_click_on_pinned_tab_after_mute() {
-  function* taskFn(browser) {
+  function* test_on_browser(browser) {
     let tab = gBrowser.getTabForBrowser(browser);
 
     gBrowser.selectedTab = originallySelectedTab;
     isnot(tab, gBrowser.selectedTab, "Sanity check, the tab should not be selected!");
 
     // Steps to reproduce the bug:
     //   Pin the tab.
     gBrowser.pinTab(tab);
@@ -356,22 +356,22 @@ function* test_click_on_pinned_tab_after
     gBrowser.selectedTab = originallySelectedTab;
   }
 
   let originallySelectedTab = gBrowser.selectedTab;
 
   yield BrowserTestUtils.withNewTab({
     gBrowser,
     url: PAGE
-  }, taskFn);
+  }, test_on_browser);
 }
 
 // This test only does something useful in e10s!
 function* test_cross_process_load() {
-  function* taskFn(browser) {
+  function* test_on_browser(browser) {
     let tab = gBrowser.getTabForBrowser(browser);
 
     //   Start playback and wait for it to finish.
     yield play(tab);
 
     let soundPlayingStoppedPromise = BrowserTestUtils.waitForEvent(tab, "TabAttrModified", false,
       event => event.detail.changed.includes("soundplaying")
     );
@@ -384,29 +384,29 @@ function* test_cross_process_load() {
 
     ok(!tab.hasAttribute("soundplaying"), "Tab should not be playing sound any more");
     ok(!tab.soundPlaying, "Tab should not be playing sound any more");
   }
 
   yield BrowserTestUtils.withNewTab({
     gBrowser,
     url: PAGE
-  }, taskFn);
+  }, test_on_browser);
 }
 
 function* test_mute_keybinding() {
   function* test_muting_using_keyboard(tab) {
     let mutedPromise = get_wait_for_mute_promise(tab, true);
     EventUtils.synthesizeKey("m", {ctrlKey: true});
     yield mutedPromise;
     mutedPromise = get_wait_for_mute_promise(tab, false);
     EventUtils.synthesizeKey("m", {ctrlKey: true});
     yield mutedPromise;
   }
-  function* taskFn(browser) {
+  function* test_on_browser(browser) {
     let tab = gBrowser.getTabForBrowser(browser);
 
     // Make sure it's possible to mute before the tab is playing.
     yield test_muting_using_keyboard(tab);
 
     //   Start playback and wait for it to finish.
     yield play(tab);
 
@@ -429,17 +429,17 @@ function* test_mute_keybinding() {
     yield test_muting_using_keyboard(tab);
 
     gBrowser.unpinTab(tab);
   }
 
   yield BrowserTestUtils.withNewTab({
     gBrowser,
     url: PAGE
-  }, taskFn);
+  }, test_on_browser);
 }
 
 function* test_on_browser(browser) {
   let tab = gBrowser.getTabForBrowser(browser);
 
   // Test the icon in a normal tab.
   yield test_playing_icon_on_tab(tab, browser, false);
 
@@ -457,31 +457,31 @@ function* test_on_browser(browser) {
       url: "data:text/html,test"
     }, () => test_on_browser(browser));
   } else {
     yield test_browser_swapping(tab, browser);
   }
 }
 
 function* test_delayed_tabattr_removal() {
-  function* taskFn(browser) {
+  function* test_on_browser(browser) {
     let tab = gBrowser.getTabForBrowser(browser);
     yield play(tab);
 
     // Extend the delay to guarantee the soundplaying attribute
     // is not removed from the tab when audio is stopped. Without
     // the extended delay the attribute could be removed in the
     // same tick and the test wouldn't catch that this broke.
     yield pause(tab, {extendedDelay: true});
   }
 
   yield BrowserTestUtils.withNewTab({
     gBrowser,
     url: PAGE
-  }, taskFn);
+  }, test_on_browser);
 }
 
 add_task(function*() {
   yield new Promise((resolve) => {
     SpecialPowers.pushPrefEnv({"set": [
                                 ["browser.tabs.showAudioPlayingIcon", true],
                               ]}, resolve);
   });
--- a/browser/base/content/test/general/browser_bug1297539.js
+++ b/browser/base/content/test/general/browser_bug1297539.js
@@ -37,21 +37,21 @@ function getTransferableFromClipboard(as
   return trans;
 }
 
 function* cutCurrentSelection(elementQueryString, property, browser) {
   // Cut the current selection.
   yield BrowserTestUtils.synthesizeKey("x", {accelKey: true}, browser);
 
   // The editor should be empty after cut.
-  yield ContentTask.spawn(browser, [elementQueryString, property],
-    function* ([contentElementQueryString, contentProperty]) {
-      let element = content.document.querySelector(contentElementQueryString);
-      is(element[contentProperty], "",
-        `${contentElementQueryString} should be empty after cut (superkey + x)`);
+  yield ContentTask.spawn(browser, {elementQueryString, property},
+    function* ({elementQueryString, property}) {
+      let element = content.document.querySelector(elementQueryString);
+      is(element[property], "",
+        `${elementQueryString} should be empty after cut (superkey + x)`);
     });
 }
 
 // Test that you are able to pasteTransferable for plain text
 // which is handled by TextEditor::PasteTransferable to paste into the editor.
 add_task(function* test_paste_transferable_plain_text()
 {
   let testPage =
--- a/browser/base/content/test/general/browser_bug491431.js
+++ b/browser/base/content/test/general/browser_bug491431.js
@@ -6,26 +6,26 @@ var testPage = "data:text/plain,test bug
 
 function test() {
   waitForExplicitFinish();
 
   let newWin, tabA, tabB;
 
   // test normal close
   tabA = gBrowser.addTab(testPage);
-  gBrowser.tabContainer.addEventListener("TabClose", function(firstTabCloseEvent) {
+  gBrowser.tabContainer.addEventListener("TabClose", function(aEvent) {
     gBrowser.tabContainer.removeEventListener("TabClose", arguments.callee, true);
-    ok(!firstTabCloseEvent.detail.adoptedBy, "This was a normal tab close");
+    ok(!aEvent.detail.adoptedBy, "This was a normal tab close");
 
     // test tab close by moving
     tabB = gBrowser.addTab(testPage);
-    gBrowser.tabContainer.addEventListener("TabClose", function(secondTabCloseEvent) {
+    gBrowser.tabContainer.addEventListener("TabClose", function(aEvent) {
       gBrowser.tabContainer.removeEventListener("TabClose", arguments.callee, true);
       executeSoon(function() {
-        ok(secondTabCloseEvent.detail.adoptedBy, "This was a tab closed by moving");
+        ok(aEvent.detail.adoptedBy, "This was a tab closed by moving");
 
         // cleanup
         newWin.close();
         executeSoon(finish);
       });
     }, true);
     newWin = gBrowser.replaceTabWithWindow(tabB);
   }, true);
--- a/browser/base/content/test/general/browser_bug553455.js
+++ b/browser/base/content/test/general/browser_bug553455.js
@@ -8,18 +8,18 @@ const SECUREROOT = "https://example.com/
 const XPINSTALL_URL = "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul";
 const PREF_INSTALL_REQUIREBUILTINCERTS = "extensions.install.requireBuiltInCerts";
 const PROGRESS_NOTIFICATION = "addon-progress";
 
 const { REQUIRE_SIGNING } = Cu.import("resource://gre/modules/addons/AddonConstants.jsm", {});
 const { Task } = Cu.import("resource://gre/modules/Task.jsm");
 
 var rootDir = getRootDirectory(gTestPath);
-var rootPath = rootDir.split('/');
-var chromeName = rootPath[0] + '//' + rootPath[2];
+var path = rootDir.split('/');
+var chromeName = path[0] + '//' + path[2];
 var croot = chromeName + "/content/browser/toolkit/mozapps/extensions/test/xpinstall/";
 var jar = getJar(croot);
 if (jar) {
   var tmpdir = extractJarToTmp(jar);
   croot = 'file://' + tmpdir.path + '/';
 }
 const CHROMEROOT = croot;
 
@@ -450,18 +450,18 @@ function test_restartless() {
     is(notification.getAttribute("label"),
        "XPI Test has been installed successfully.",
        "Should have seen the right message");
 
     let installs = yield getInstalls();
     is(installs.length, 0, "Should be no pending installs");
 
     let addon = yield new Promise(resolve => {
-      AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", result => {
-        resolve(result);
+      AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", addon => {
+        resolve(addon);
       });
     });
     addon.uninstall();
 
     Services.perms.remove(makeURI("http://example.com/"), "install");
 
     let closePromise = waitForNotificationClose();
     gBrowser.removeTab(gBrowser.selectedTab);
@@ -494,18 +494,18 @@ function test_multiple() {
        "2 add-ons will be installed after you restart " + gApp + ".",
        "Should have seen the right message");
 
     let installs = yield getInstalls();
     is(installs.length, 1, "Should be one pending install");
     installs[0].cancel();
 
     let addon = yield new Promise(resolve => {
-      AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function (result) {
-        resolve(result);
+      AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function (addon) {
+        resolve(addon);
       });
     });
     addon.uninstall();
     Services.perms.remove(makeURI("http://example.com/"), "install");
     yield removeTab();
   });
 },
 
@@ -671,18 +671,18 @@ function test_allUnverified() {
     is(container.childNodes[0].firstChild.getAttribute("value"), "XPI Test", "Should have the right add-on");
     is(container.childNodes[0].childNodes.length, 1, "Shouldn't have the unverified marker");
 
     let notificationPromise = waitForNotification("addon-install-complete");
     acceptInstallDialog();
     yield notificationPromise;
 
     let addon = yield new Promise(resolve => {
-      AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(result) {
-        resolve(result);
+      AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(addon) {
+        resolve(addon);
       });
     });
     addon.uninstall();
 
     Services.perms.remove(makeURI("http://example.com/"), "install");
     yield removeTab();
   });
 },
@@ -914,27 +914,27 @@ function test_theme() {
 
     let notification = panel.childNodes[0];
     is(notification.button.label, "Restart Now", "Should have seen the right button");
     is(notification.getAttribute("label"),
        "Theme Test will be installed after you restart " + gApp + ".",
        "Should have seen the right message");
 
     let addon = yield new Promise(resolve => {
-      AddonManager.getAddonByID("{972ce4c6-7e08-4474-a285-3208198ce6fd}", function(result) {
-        resolve(result);
+      AddonManager.getAddonByID("{972ce4c6-7e08-4474-a285-3208198ce6fd}", function(addon) {
+        resolve(addon);
       });
     });
     ok(addon.userDisabled, "Should be switching away from the default theme.");
     // Undo the pending theme switch
     addon.userDisabled = false;
 
     addon = yield new Promise(resolve => {
-      AddonManager.getAddonByID("theme-xpi@tests.mozilla.org", function(result) {
-        resolve(result);
+      AddonManager.getAddonByID("theme-xpi@tests.mozilla.org", function(addon) {
+        resolve(addon);
       });
     });
     isnot(addon, null, "Test theme will have been installed");
     addon.uninstall();
 
     Services.perms.remove(makeURI("http://example.com/"), "install");
     yield removeTab();
   });
--- a/browser/base/content/test/general/browser_bug561636.js
+++ b/browser/base/content/test/general/browser_bug561636.js
@@ -69,26 +69,26 @@ function* blurChildElement(browser)
   yield ContentTask.spawn(browser, {}, function* () {
     content.document.getElementById('i').blur();
   });
 }
 
 function* checkChildFocus(browser, message)
 {
   yield ContentTask.spawn(browser, [message, testId], function* (args) {
-    let [msg, id] = args;
+    let [msg, testId] = args;
     var focused = content.document.activeElement == content.document.getElementById('i');
 
     var validMsg = true;
     if (msg) {
       validMsg = (msg == content.document.getElementById('i').validationMessage);
     }
 
-    Assert.equal(focused, true, "Test " + id + " First invalid element should be focused");
-    Assert.equal(validMsg, true, "Test " + id + " The panel should show the message from validationMessage");
+    Assert.equal(focused, true, "Test " + testId + " First invalid element should be focused");
+    Assert.equal(validMsg, true, "Test " + testId + " The panel should show the message from validationMessage");
   });
 }
 
 /**
  * In this test, we check that no popup appears if the form is valid.
  */
 add_task(function* ()
 {
--- a/browser/base/content/test/general/browser_bug592338.js
+++ b/browser/base/content/test/general/browser_bug592338.js
@@ -139,17 +139,17 @@ function runNextTest() {
 
 function test() {
   waitForExplicitFinish();
 
   Services.prefs.setBoolPref("extensions.logging.enabled", true);
 
   AddonManager.getInstallForURL(TESTROOT + "theme.xpi", function(aInstall) {
     aInstall.addListener({
-      onInstallEnded: function() {
+      onInstallEnded: function(aInstall, aAddon) {
         AddonManager.getAddonByID("theme-xpi@tests.mozilla.org", function(aAddon) {
           isnot(aAddon, null, "Should have installed the test theme.");
 
           // In order to switch themes while the test is running we turn on dynamic
           // theme switching. This means the test isn't exactly correct but should
           // do some good
           Services.prefs.setBoolPref("extensions.dss.enabled", true);
 
--- a/browser/base/content/test/general/browser_bug676619.js
+++ b/browser/base/content/test/general/browser_bug676619.js
@@ -7,35 +7,35 @@ function test () {
   function loadListener() {
     function testLocation(link, url, next) {
       new TabOpenListener(url, function () {
         gBrowser.removeTab(this.tab);
       }, function () {
         next();
       });
 
-      ContentTask.spawn(gBrowser.selectedBrowser, link, contentLink => {
-        content.document.getElementById(contentLink).click();
+      ContentTask.spawn(gBrowser.selectedBrowser, link, link => {
+        content.document.getElementById(link).click();
       });
     }
 
     function testLink(link, name, next) {
       addWindowListener("chrome://mozapps/content/downloads/unknownContentType.xul", function (win) {
         ContentTask.spawn(gBrowser.selectedBrowser, null, () => {
           Assert.equal(content.document.getElementById("unload-flag").textContent,
             "Okay", "beforeunload shouldn't have fired");
         }).then(() => {
           is(win.document.getElementById("location").value, name, "file name should match");
           win.close();
           next();
         });
       });
 
-      ContentTask.spawn(gBrowser.selectedBrowser, link, contentLink => {
-        content.document.getElementById(contentLink).click();
+      ContentTask.spawn(gBrowser.selectedBrowser, link, link => {
+        content.document.getElementById(link).click();
       });
     }
 
     testLink("link1", "test.txt",
       testLink.bind(null, "link2", "video.ogg",
         testLink.bind(null, "link3", "just some video",
           testLink.bind(null, "link4", "with-target.txt",
             testLink.bind(null, "link5", "javascript.txt",
--- a/browser/base/content/test/general/browser_bug719271.js
+++ b/browser/base/content/test/general/browser_bug719271.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 const TEST_PAGE = "http://example.org/browser/browser/base/content/test/general/zoom_test.html";
 const TEST_VIDEO = "http://example.org/browser/browser/base/content/test/general/video.ogg";
 
-var gTab1, gTab2, gLevel1;
+var gTab1, gTab2, gLevel1, gLevel2;
 
 function test() {
   waitForExplicitFinish();
 
   Task.spawn(function* () {
     gTab1 = gBrowser.addTab();
     gTab2 = gBrowser.addTab();
 
@@ -39,19 +39,19 @@ function zoomTab1() {
   }).then(zoomTab2, FullZoomHelper.failAndContinue(finish));
 }
 
 function zoomTab2() {
   Task.spawn(function* () {
     is(gBrowser.selectedTab, gTab2, "Tab 2 is selected");
 
     FullZoom.reduce();
-    let level2 = ZoomManager.getZoomForBrowser(gBrowser.getBrowserForTab(gTab2));
+    let gLevel2 = ZoomManager.getZoomForBrowser(gBrowser.getBrowserForTab(gTab2));
 
-    ok(level2 < 1, "New zoom for tab 2 should be less than 1");
+    ok(gLevel2 < 1, "New zoom for tab 2 should be less than 1");
     FullZoomHelper.zoomTest(gTab1, gLevel1, "Zooming tab 2 should not affect tab 1");
 
     yield FullZoomHelper.selectTabAndWaitForLocationChange(gTab1);
     FullZoomHelper.zoomTest(gTab1, gLevel1, "Tab 1 should have the same zoom after it's selected");
   }).then(testNavigation, FullZoomHelper.failAndContinue(finish));
 }
 
 function testNavigation() {
--- a/browser/base/content/test/general/browser_bug763468_perwindowpb.js
+++ b/browser/base/content/test/general/browser_bug763468_perwindowpb.js
@@ -52,19 +52,19 @@ function test() {
       aWin.close();
     });
   });
 
   // test first when not on private mode
   testOnWindow({}, function(aWin) {
     doTest(false, aWin, function() {
       // then test when on private mode
-      testOnWindow({private: true}, function(aWin2) {
-        doTest(true, aWin2, function() {
+      testOnWindow({private: true}, function(aWin) {
+        doTest(true, aWin, function() {
           // then test again when not on private mode
-          testOnWindow({}, function(aWin3) {
-            doTest(false, aWin3, finish);
+          testOnWindow({}, function(aWin) {
+            doTest(false, aWin, finish);
           });
         });
       });
     });
   });
 }
--- a/browser/base/content/test/general/browser_bug767836_perwindowpb.js
+++ b/browser/base/content/test/general/browser_bug767836_perwindowpb.js
@@ -59,18 +59,18 @@ function test() {
 
   // check whether any custom new tab url has been configured
   ok(!aboutNewTabService.overridden, "No custom newtab url is set");
 
   // test normal mode
   testOnWindow(false, function(aWindow) {
     doTest(false, aWindow, function() {
       // test private mode
-      testOnWindow(true, function(aWindow2) {
-        doTest(true, aWindow2, function() {
+      testOnWindow(true, function(aWindow) {
+        doTest(true, aWindow, function() {
           finish();
         });
       });
     });
   });
 }
 
 function openNewTab(aWindow, aCallback) {
--- a/browser/base/content/test/general/browser_clipboard.js
+++ b/browser/base/content/test/general/browser_clipboard.js
@@ -27,21 +27,22 @@ add_task(function*() {
   yield ContentTask.spawn(browser, { modifier, htmlPrefix, htmlPostfix }, function* (arg) {
     var doc = content.document;
     var main = doc.getElementById("main");
     main.focus();
 
     const utils = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                          .getInterface(Components.interfaces.nsIDOMWindowUtils);
 
+    const modifier = arg.modifier;
     function sendKey(key) {
-      if (utils.sendKeyEvent("keydown", key, 0, arg.modifier)) {
-        utils.sendKeyEvent("keypress", key, key.charCodeAt(0), arg.modifier);
+      if (utils.sendKeyEvent("keydown", key, 0, modifier)) {
+        utils.sendKeyEvent("keypress", key, key.charCodeAt(0), modifier);
       }
-      utils.sendKeyEvent("keyup", key, 0, arg.modifier);
+      utils.sendKeyEvent("keyup", key, 0, modifier);
     }
 
     // Select an area of the text.
     let selection = doc.getSelection();
     selection.modify("move", "left", "line");
     selection.modify("move", "right", "character");
     selection.modify("move", "right", "character");
     selection.modify("move", "right", "character");
@@ -152,20 +153,21 @@ add_task(function*() {
           reject('Clipboard Data did not contain an image, was ' + clipboardData.getData("text/html"));
         }
         resolve();
       }, true)
 
       const utils = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                            .getInterface(Components.interfaces.nsIDOMWindowUtils);
 
-      if (utils.sendKeyEvent("keydown", "v", 0, arg.modifier)) {
-        utils.sendKeyEvent("keypress", "v", "v".charCodeAt(0), arg.modifier);
+      const modifier = arg.modifier;
+      if (utils.sendKeyEvent("keydown", "v", 0, modifier)) {
+        utils.sendKeyEvent("keypress", "v", "v".charCodeAt(0), modifier);
       }
-      utils.sendKeyEvent("keyup", "v", 0, arg.modifier);
+      utils.sendKeyEvent("keyup", "v", 0, modifier);
     });
 
     // The new content should now include an image.
     Assert.equal(main.innerHTML, '<i>Italic</i> <img id="img" tabindex="1" ' +
       'src="http://example.org/browser/browser/base/content/test/general/moz.png">' +
       'Test <b>Bold</b> After<b></b>', "Paste after copy image");
   });
 
--- a/browser/base/content/test/general/browser_contentSearchUI.js
+++ b/browser/base/content/test/general/browser_contentSearchUI.js
@@ -661,22 +661,22 @@ function setUp(aNoEngine) {
 }
 
 function msg(type, data=null) {
   gMsgMan.sendAsyncMessage(TEST_MSG, {
     type: type,
     data: data,
   });
   let deferred = Promise.defer();
-  gMsgMan.addMessageListener(TEST_MSG, function onMsg(msgObj) {
-    if (msgObj.data.type != type) {
+  gMsgMan.addMessageListener(TEST_MSG, function onMsg(msg) {
+    if (msg.data.type != type) {
       return;
     }
     gMsgMan.removeMessageListener(TEST_MSG, onMsg);
-    deferred.resolve(msgObj.data.data);
+    deferred.resolve(msg.data.data);
   });
   return deferred.promise;
 }
 
 function checkState(actualState, expectedInputVal, expectedSuggestions,
                     expectedSelectedIdx, expectedSelectedButtonIdx) {
   expectedSuggestions = expectedSuggestions.map(sugg => {
     return typeof(sugg) == "object" ? sugg : {
@@ -737,21 +737,21 @@ function promiseTab() {
   }, true, true);
   openUILinkIn(pageURL, "current");
   return deferred.promise;
 }
 
 function promiseMsg(name, type, msgMan) {
   let deferred = Promise.defer();
   info("Waiting for " + name + " message " + type + "...");
-  msgMan.addMessageListener(name, function onMsg(msgObj) {
-    info("Received " + name + " message " + msgObj.data.type + "\n");
-    if (msgObj.data.type == type) {
+  msgMan.addMessageListener(name, function onMsg(msg) {
+    info("Received " + name + " message " + msg.data.type + "\n");
+    if (msg.data.type == type) {
       msgMan.removeMessageListener(name, onMsg);
-      deferred.resolve(msgObj);
+      deferred.resolve(msg);
     }
   });
   return deferred.promise;
 }
 
 function setUpEngines() {
   return Task.spawn(function* () {
     info("Removing default search engines");
--- a/browser/base/content/test/general/browser_contextmenu.js
+++ b/browser/base/content/test/general/browser_contextmenu.js
@@ -883,39 +883,38 @@ add_task(function* test_input_spell_fals
 const remoteClientsFixture = [ { id: 1, name: "Foo"}, { id: 2, name: "Bar"} ];
 
 add_task(function* test_plaintext_sendpagetodevice() {
   if (!gFxAccounts.sendTabToDeviceEnabled) {
     return;
   }
   const oldGetter = setupRemoteClientsFixture(remoteClientsFixture);
 
-  let plainTextItemsWithSendPage =
-                    ["context-navigation",   null,
-                      ["context-back",         false,
-                        "context-forward",      false,
-                        "context-reload",       true,
-                        "context-bookmarkpage", true], null,
+  let plainTextItems = ["context-navigation",   null,
+                        ["context-back",         false,
+                         "context-forward",      false,
+                         "context-reload",       true,
+                         "context-bookmarkpage", true], null,
                     "---",                  null,
                     "context-savepage",     true,
                     ...(hasPocket ? ["context-pocket", true] : []),
                     "---",                  null,
                     "context-sendpagetodevice", true,
                       ["*Foo", true,
                        "*Bar", true,
                        "---", null,
                        "*All Devices", true], null,
                     "---",                  null,
                     "context-viewbgimage",  false,
                     "context-selectall",    true,
                     "---",                  null,
                     "context-viewsource",   true,
                     "context-viewinfo",     true
                    ];
-  yield test_contextmenu("#test-text", plainTextItemsWithSendPage, {
+  yield test_contextmenu("#test-text", plainTextItems, {
       *onContextMenuShown() {
         yield openMenuItemSubmenu("context-sendpagetodevice");
       }
     });
 
   restoreRemoteClients(oldGetter);
 });
 
@@ -962,21 +961,21 @@ add_task(function* test_cleanup_html() {
 /**
  * Selects the text of the element that matches the provided `selector`
  *
  * @param {String} selector
  *        A selector passed to querySelector to find
  *        the element that will be referenced.
  */
 function* selectText(selector) {
-  yield ContentTask.spawn(gBrowser.selectedBrowser, selector, function*(contentSelector) {
-    info(`Selecting text of ${contentSelector}`);
+  yield ContentTask.spawn(gBrowser.selectedBrowser, selector, function*(selector) {
+    info(`Selecting text of ${selector}`);
     let doc = content.document;
     let win = doc.defaultView;
     win.getSelection().removeAllRanges();
     let div = doc.createRange();
-    let element = doc.querySelector(contentSelector);
+    let element = doc.querySelector(selector);
     Assert.ok(element, "Found element to select text from");
     div.setStartBefore(element);
     div.setEndAfter(element);
     win.getSelection().addRange(div);
   });
 }
--- a/browser/base/content/test/general/browser_decoderDoctor.js
+++ b/browser/base/content/test/general/browser_decoderDoctor.js
@@ -1,19 +1,19 @@
 "use strict";
 
 function* test_decoder_doctor_notification(type, notificationMessage, options) {
   yield BrowserTestUtils.withNewTab({ gBrowser }, function*(browser) {
     let awaitNotificationBar =
       BrowserTestUtils.waitForNotificationBar(gBrowser, browser, "decoder-doctor-notification");
 
-    yield ContentTask.spawn(browser, type, function*(aType) {
+    yield ContentTask.spawn(browser, type, function*(type) {
       Services.obs.notifyObservers(content.window,
                                    "decoder-doctor-notification",
-                                   JSON.stringify({type: aType,
+                                   JSON.stringify({type: type,
                                                    isSolved: false,
                                                    decoderDoctorReportId: "test",
                                                    formats: "test"}));
     });
 
     let notification;
     try {
       notification = yield awaitNotificationBar;
--- a/browser/base/content/test/general/browser_discovery.js
+++ b/browser/base/content/test/general/browser_discovery.js
@@ -31,45 +31,45 @@ var iconDiscoveryTests = [
   { rel: "shortcut-icon", pass: false, text: "rel shortcut-icon not discovered" },
   { href: "moz.png", text: "relative href works" },
   { href: "notthere.png", text: "404'd icon is removed properly" },
   { href: "data:image/x-icon,%00", type: "image/x-icon", text: "data: URIs work" },
   { type: "image/png; charset=utf-8", text: "type may have optional parameters (RFC2046)" }
 ];
 
 function runIconDiscoveryTest() {
-  var testCase = iconDiscoveryTests[0];
+  var test = iconDiscoveryTests[0];
   var head = doc().getElementById("linkparent");
   var hasSrc = gBrowser.getIcon() != null;
-  if (testCase.pass)
-    ok(hasSrc, testCase.text);
+  if (test.pass)
+    ok(hasSrc, test.text);
   else
-    ok(!hasSrc, testCase.text);
+    ok(!hasSrc, test.text);
 
   head.removeChild(head.getElementsByTagName('link')[0]);
   iconDiscoveryTests.shift();
   iconDiscovery(); // Run the next test.
 }
 
 function iconDiscovery() {
   if (iconDiscoveryTests.length) {
     setHandlerFunc(runIconDiscoveryTest);
     gBrowser.setIcon(gBrowser.selectedTab, null,
                      Services.scriptSecurityManager.getSystemPrincipal());
 
-    var testCase = iconDiscoveryTests[0];
+    var test = iconDiscoveryTests[0];
     var head = doc().getElementById("linkparent");
     var link = doc().createElement("link");
 
     var rootDir = getRootDirectory(gTestPath);
-    var rel = testCase.rel || "icon";
-    var href = testCase.href || rootDir + "moz.png";
-    var type = testCase.type || "image/png";
-    if (testCase.pass == undefined)
-      testCase.pass = true;
+    var rel = test.rel || "icon";
+    var href = test.href || rootDir + "moz.png";
+    var type = test.type || "image/png";
+    if (test.pass == undefined)
+      test.pass = true;
 
     link.rel = rel;
     link.href = href;
     link.type = type;
     head.appendChild(link);
   } else {
     searchDiscovery();
   }
@@ -87,27 +87,27 @@ var searchDiscoveryTests = [
   { type: "APPLICATION/OPENSEARCHDESCRIPTION+XML", text: "type is case insensitve" },
   { type: " application/opensearchdescription+xml ", text: "type may contain extra whitespace" },
   { type: "application/opensearchdescription+xml; charset=utf-8", text: "type may have optional parameters (RFC2046)" },
   { type: "aapplication/opensearchdescription+xml", pass: false, text: "type should not be loosely matched" },
   { rel: "search search search", count: 1, text: "only one engine should be added" }
 ];
 
 function runSearchDiscoveryTest() {
-  var testCase = searchDiscoveryTests[0];
-  var title = testCase.title || searchDiscoveryTests.length;
+  var test = searchDiscoveryTests[0];
+  var title = test.title || searchDiscoveryTests.length;
   if (browser.engines) {
-    var hasEngine = (testCase.count) ? (browser.engines[0].title == title &&
-                                        browser.engines.length == testCase.count) :
-                                       (browser.engines[0].title == title);
-    ok(hasEngine, testCase.text);
+    var hasEngine = (test.count) ? (browser.engines[0].title == title &&
+                                    browser.engines.length == test.count) :
+                                   (browser.engines[0].title == title);
+    ok(hasEngine, test.text);
     browser.engines = null;
   }
   else
-    ok(!testCase.pass, testCase.text);
+    ok(!test.pass, test.text);
 
   searchDiscoveryTests.shift();
   searchDiscovery(); // Run the next test.
 }
 
 // This handler is called twice, once for each added link element.
 // Only want to check once the second link element has been added.
 var ranOnce = false;
@@ -124,25 +124,25 @@ function runMultipleEnginesTestAndFinali
   finish();
 }
 
 function searchDiscovery() {
   let head = doc().getElementById("linkparent");
 
   if (searchDiscoveryTests.length) {
     setHandlerFunc(runSearchDiscoveryTest);
-    let testCase = searchDiscoveryTests[0];
+    let test = searchDiscoveryTests[0];
     let link = doc().createElement("link");
 
-    let rel = testCase.rel || "search";
-    let href = testCase.href || "http://so.not.here.mozilla.com/search.xml";
-    let type = testCase.type || "application/opensearchdescription+xml";
-    let title = testCase.title || searchDiscoveryTests.length;
-    if (testCase.pass == undefined)
-      testCase.pass = true;
+    let rel = test.rel || "search";
+    let href = test.href || "http://so.not.here.mozilla.com/search.xml";
+    let type = test.type || "application/opensearchdescription+xml";
+    let title = test.title || searchDiscoveryTests.length;
+    if (test.pass == undefined)
+      test.pass = true;
 
     link.rel = rel;
     link.href = href;
     link.type = type;
     link.title = title;
     head.appendChild(link);
   } else {
     setHandlerFunc(runMultipleEnginesTestAndFinalize);
--- a/browser/base/content/test/general/browser_documentnavigation.js
+++ b/browser/base/content/test/general/browser_documentnavigation.js
@@ -25,44 +25,44 @@ function* expectFocusOnF6(backward, expe
     is(msg.data.details, expected, desc + " child focus matches");
     focusChangedInChildResolver();
   }
 
   if (onContent) {
     messageManager.addMessageListener("BrowserTest:FocusChanged", focusChangedListener);
 
     yield ContentTask.spawn(gBrowser.selectedBrowser, { expectedElementId: expectedElement }, function* (arg) {
-      let contentExpectedElement = content.document.getElementById(arg.expectedElementId);
-      if (!contentExpectedElement) {
+      let expectedElement = content.document.getElementById(arg.expectedElementId);
+      if (!expectedElement) {
         // Element not found, so look in the child frames.
         for (let f = 0; f < content.frames.length; f++) {
           if (content.frames[f].document.getElementById(arg.expectedElementId)) {
-            contentExpectedElement = content.frames[f].document;
+            expectedElement = content.frames[f].document;
             break;
           }
         }
       }
-      else if (contentExpectedElement.localName == "html") {
-        contentExpectedElement = contentExpectedElement.ownerDocument;
+      else if (expectedElement.localName == "html") {
+        expectedElement = expectedElement.ownerDocument;
       }
 
-      if (!contentExpectedElement) {
+      if (!expectedElement) {
         sendSyncMessage("BrowserTest:FocusChanged",
                         { details : "expected element " + arg.expectedElementId + " not found" });
         return;
       }
 
-      contentExpectedElement.addEventListener("focus", function focusReceived() {
-        contentExpectedElement.removeEventListener("focus", focusReceived, true);
+      expectedElement.addEventListener("focus", function focusReceived() {
+        expectedElement.removeEventListener("focus", focusReceived, true);
 
-        const contentFM = Components.classes["@mozilla.org/focus-manager;1"].
-                            getService(Components.interfaces.nsIFocusManager);
-        let details = contentFM.focusedWindow.document.documentElement.id;
-        if (contentFM.focusedElement) {
-          details += "," + contentFM.focusedElement.id;
+        const fm = Components.classes["@mozilla.org/focus-manager;1"].
+                              getService(Components.interfaces.nsIFocusManager);
+        let details = fm.focusedWindow.document.documentElement.id;
+        if (fm.focusedElement) {
+          details += "," + fm.focusedElement.id;
         }
 
         sendSyncMessage("BrowserTest:FocusChanged", { details : details });
       }, true);
     });
   }
 
   EventUtils.synthesizeKey("VK_F6", { shiftKey: backward });
--- a/browser/base/content/test/general/browser_e10s_chrome_process.js
+++ b/browser/base/content/test/general/browser_e10s_chrome_process.js
@@ -126,18 +126,18 @@ function* loadURI(browser, uri) {
   return true;
 },
 
 // Loads the new page by finding a link with the right href in the document and
 // clicking it
 function* clickLink(browser, uri) {
   info("Clicking link");
 
-  function frame_script(frameUri) {
-    let link = content.document.querySelector("a[href='" + frameUri + "']");
+  function frame_script(uri) {
+    let link = content.document.querySelector("a[href='" + uri + "']");
     link.click();
   }
 
   browser.messageManager.loadFrameScript("data:,(" + frame_script.toString() + ")(" + JSON.stringify(uri) + ");", false);
 
   return false;
 },
 ];
--- a/browser/base/content/test/general/browser_feed_discovery.js
+++ b/browser/base/content/test/general/browser_feed_discovery.js
@@ -13,21 +13,21 @@ add_task(function* () {
   let discovered = browser.feeds;
   ok(discovered.length > 0, "some feeds should be discovered");
 
   let feeds = {};
   for (let aFeed of discovered) {
     feeds[aFeed.href] = true;
   }
 
-  yield ContentTask.spawn(browser, feeds, function* (contentFeeds) {
+  yield ContentTask.spawn(browser, feeds, function* (feeds) {
     for (let aLink of content.document.getElementsByTagName("link")) {
       // ignore real stylesheets, and anything without an href property
       if (aLink.type != "text/css" && aLink.href) {
         if (/bogus/i.test(aLink.title)) {
-          ok(!contentFeeds[aLink.href], "don't discover " + aLink.href);
+          ok(!feeds[aLink.href], "don't discover " + aLink.href);
         } else {
-          ok(contentFeeds[aLink.href], "should discover " + aLink.href);
+          ok(feeds[aLink.href], "should discover " + aLink.href);
         }
       }
     }
   });
 })
--- a/browser/base/content/test/general/browser_findbarClose.js
+++ b/browser/base/content/test/general/browser_findbarClose.js
@@ -15,19 +15,19 @@ add_task(function* findbar_test() {
   newTab.linkedBrowser.loadURI("http://example.com/browser/" +
     "browser/base/content/test/general/test_bug628179.html");
   yield promise;
 
   gFindBar.open();
 
   yield new ContentTask.spawn(newTab.linkedBrowser, null, function* () {
     let iframe = content.document.getElementById("iframe");
-    let awaitLoad = ContentTaskUtils.waitForEvent(iframe, "load", false);
+    let promise = ContentTaskUtils.waitForEvent(iframe, "load", false);
     iframe.src = "http://example.org/";
-    yield awaitLoad;
+    yield promise;
   });
 
   ok(!gFindBar.hidden, "the Find bar isn't hidden after the location of a " +
      "subdocument changes");
 
   gFindBar.close();
   gBrowser.removeTab(newTab);
   finish();
--- a/browser/base/content/test/general/browser_fullscreen-window-open.js
+++ b/browser/base/content/test/general/browser_fullscreen-window-open.js
@@ -44,19 +44,19 @@ var gTests = [
   test_open_with_innerSize,
   test_open_with_dialog,
   test_open_when_open_new_window_by_pref,
   test_open_with_pref_to_disable_in_fullscreen,
   test_open_from_chrome,
 ];
 
 function runNextTest () {
-  let testCase = gTests.shift();
-  if (testCase) {
-    executeSoon(testCase);
+  let test = gTests.shift();
+  if (test) {
+    executeSoon(test);
   }
   else {
     finish();
   }
 }
 
 
 // Test for window.open() with no feature.
--- a/browser/base/content/test/general/browser_fxa_oauth.js
+++ b/browser/base/content/test/general/browser_fxa_oauth.js
@@ -308,19 +308,19 @@ function test() {
   waitForExplicitFinish();
 
   Task.spawn(function* () {
     const webchannelWhitelistPref = "webchannel.allowObject.urlWhitelist";
     let origWhitelist = Services.prefs.getCharPref(webchannelWhitelistPref);
     let newWhitelist = origWhitelist + " http://example.com";
     Services.prefs.setCharPref(webchannelWhitelistPref, newWhitelist);
     try {
-      for (let testCase of gTests) {
-        info("Running: " + testCase.desc);
-        yield testCase.run();
+      for (let test of gTests) {
+        info("Running: " + test.desc);
+        yield test.run();
       }
     } finally {
       Services.prefs.clearUserPref(webchannelWhitelistPref);
     }
   }).then(finish, ex => {
     Assert.ok(false, "Unexpected Exception: " + ex);
     finish();
   });
--- a/browser/base/content/test/general/browser_fxa_web_channel.js
+++ b/browser/base/content/test/general/browser_fxa_web_channel.js
@@ -194,17 +194,17 @@ function makeObserver(aObserveTopic, aOb
   Services.obs.addObserver(callback, aObserveTopic, false);
   return removeMe;
 }
 
 function test() {
   waitForExplicitFinish();
 
   Task.spawn(function* () {
-    for (let testCase of gTests) {
-      info("Running: " + testCase.desc);
-      yield testCase.run();
+    for (let test of gTests) {
+      info("Running: " + test.desc);
+      yield test.run();
     }
   }).then(finish, ex => {
     Assert.ok(false, "Unexpected Exception: " + ex);
     finish();
   });
 }
--- a/browser/base/content/test/general/browser_fxaccounts.js
+++ b/browser/base/content/test/general/browser_fxaccounts.js
@@ -178,20 +178,20 @@ function configureProfileURL(profile, re
             // .sjs as part of the query string.
             "&path=";
 
   Services.prefs.setCharPref("identity.fxaccounts.remote.profile.uri", url);
 }
 
 function promiseObserver(topic, count = 1) {
   return new Promise(resolve => {
-    let obs = (aSubject, aTopic, aData) => {
+    let obs = (subject, topic, data) => {
       if (--count == 0) {
-        Services.obs.removeObserver(obs, aTopic);
-        resolve(aSubject);
+        Services.obs.removeObserver(obs, topic);
+        resolve(subject);
       }
     }
     Services.obs.addObserver(obs, topic, false);
   });
 }
 
 // Stolen from browser_aboutHome.js
 function promiseWaitForEvent(node, type, capturing) {
--- a/browser/base/content/test/general/browser_page_style_menu.js
+++ b/browser/base/content/test/general/browser_page_style_menu.js
@@ -45,53 +45,53 @@ add_task(function*() {
     items.push(current);
   }
 
   items = items.map(el => ({
     label: el.getAttribute("label"),
     checked: el.getAttribute("checked") == "true",
   }));
 
-  let validLinks = yield ContentTask.spawn(gBrowser.selectedBrowser, items, function(contentItems) {
-    let contentValidLinks = 0;
+  let validLinks = yield ContentTask.spawn(gBrowser.selectedBrowser, items, function(items) {
+    let validLinks = 0;
     Array.forEach(content.document.querySelectorAll("link, style"), function (el) {
       var title = el.getAttribute("title");
       var rel = el.getAttribute("rel");
       var media = el.getAttribute("media");
       var idstring = el.nodeName + " " + (title ? title : "without title and") +
                      " with rel=\"" + rel + "\"" +
                      (media ? " and media=\"" + media + "\"" : "");
 
-      var item = contentItems.filter(aItem => aItem.label == title);
+      var item = items.filter(item => item.label == title);
       var found = item.length == 1;
       var checked = found && item[0].checked;
 
       switch (el.getAttribute("data-state")) {
         case "0":
           ok(!found, idstring + " should not show up in page style menu");
           break;
         case "0-todo":
-          contentValidLinks++;
+          validLinks++;
           todo(!found, idstring + " should not show up in page style menu");
           ok(!checked, idstring + " should not be selected");
           break;
         case "1":
-          contentValidLinks++;
+          validLinks++;
           ok(found, idstring + " should show up in page style menu");
           ok(!checked, idstring + " should not be selected");
           break;
         case "2":
-          contentValidLinks++;
+          validLinks++;
           ok(found, idstring + " should show up in page style menu");
           ok(checked, idstring + " should be selected");
           break;
         default:
           throw "data-state attribute is missing or has invalid value";
       }
     });
-    return contentValidLinks;
+    return validLinks;
   });
 
   ok(items.length, "At least one item in the menu");
   is(items.length, validLinks, "all valid links found");
 
   yield BrowserTestUtils.removeTab(tab);
 });
--- a/browser/base/content/test/general/browser_popup_blocker.js
+++ b/browser/base/content/test/general/browser_popup_blocker.js
@@ -48,17 +48,17 @@ function test() {
     }
     gBrowser.tabContainer.addEventListener("TabOpen", onTabOpen);
 
     // Press the button.
     let allow = menu.querySelector("[observes='blockedPopupAllowSite']");
     allow.doCommand();
     yield promiseWaitForCondition(() =>
       popupTabs.length == 2 &&
-      popupTabs.every(aTab => aTab.linkedBrowser.currentURI.spec != "about:blank"));
+      popupTabs.every(tab => tab.linkedBrowser.currentURI.spec != "about:blank"));
 
     gBrowser.tabContainer.removeEventListener("TabOpen", onTabOpen);
 
     is(popupTabs[0].linkedBrowser.currentURI.spec, "data:text/plain;charset=utf-8,a", "Popup a");
     is(popupTabs[1].linkedBrowser.currentURI.spec, "data:text/plain;charset=utf-8,b", "Popup b");
 
     // Clean up.
     gBrowser.removeTab(tab);
--- a/browser/base/content/test/general/browser_refreshBlocker.js
+++ b/browser/base/content/test/general/browser_refreshBlocker.js
@@ -12,22 +12,22 @@ const PREF = "accessibility.blockautoref
  *
  * @param browser (<xul:browser>)
  *        The browser to test for refreshing.
  * @param expectRefresh (bool)
  *        Whether or not we expect the refresh attempt to succeed.
  * @returns Promise
  */
 function* attemptFakeRefresh(browser, expectRefresh) {
-  yield ContentTask.spawn(browser, expectRefresh, function*(contentExpectRefresh) {
+  yield ContentTask.spawn(browser, expectRefresh, function*(expectRefresh) {
     let URI = docShell.QueryInterface(Ci.nsIWebNavigation).currentURI;
     let refresher = docShell.QueryInterface(Ci.nsIRefreshURI);
     refresher.refreshURI(URI, 0, false, true);
 
-    Assert.equal(refresher.refreshPending, contentExpectRefresh,
+    Assert.equal(refresher.refreshPending, expectRefresh,
       "Got the right refreshPending state");
 
     if (refresher.refreshPending) {
       // Cancel the pending refresh
       refresher.cancelRefreshURITimers();
     }
 
     // The RefreshBlocker will wait until onLocationChange has
--- a/browser/base/content/test/general/browser_sanitizeDialog.js
+++ b/browser/base/content/test/general/browser_sanitizeDialog.js
@@ -579,17 +579,17 @@ add_task(function* test_offline_cache() 
     };
     storage.asyncVisitStorage(visitor, false);
     // Offline cache visit happens synchronously, since it's forwarded to the old code
     is(size, 0, "offline application cache entries evicted");
   };
 
   var cacheListener = {
     onCacheEntryCheck: function() { return Ci.nsICacheEntryOpenCallback.ENTRY_WANTED; },
-    onCacheEntryAvailable: function (entry, isnew, unused, status) {
+    onCacheEntryAvailable: function (entry, isnew, appcache, status) {
       is(status, Cr.NS_OK);
       var stream = entry.openOutputStream(0);
       var content = "content";
       stream.write(content, content.length);
       stream.close();
       entry.close();
       wh.open();
     }
--- a/browser/base/content/test/general/browser_save_link-perwindowpb.js
+++ b/browser/base/content/test/general/browser_save_link-perwindowpb.js
@@ -59,19 +59,19 @@ function triggerSave(aWindow, aCallback)
     var saveLinkCommand = aWindow.document.getElementById("context-savelink");
     info("saveLinkCommand: " + saveLinkCommand);
     saveLinkCommand.doCommand();
 
     event.target.hidePopup();
     info("popup hidden");
   }
 
-  function onTransferComplete(aWindow2, downloadSuccess, destDir) {
+  function onTransferComplete(aWindow, downloadSuccess, destDir) {
     ok(downloadSuccess, "Link should have been downloaded successfully");
-    aWindow2.close();
+    aWindow.close();
 
     executeSoon(() => aCallback());
   }
 }
 
 function test() {
   info("Start the test");
   waitForExplicitFinish();
@@ -81,20 +81,20 @@ function test() {
     info("testOnWindow(" + options + ")");
     var win = OpenBrowserWindow(options);
     info("got " + win);
     whenDelayedStartupFinished(win, () => callback(win));
   }
 
   function whenDelayedStartupFinished(aWindow, aCallback) {
     info("whenDelayedStartupFinished");
-    Services.obs.addObserver(function obs(aSubject, aTopic) {
+    Services.obs.addObserver(function observer(aSubject, aTopic) {
       info("whenDelayedStartupFinished, got topic: " + aTopic + ", got subject: " + aSubject + ", waiting for " + aWindow);
       if (aWindow == aSubject) {
-        Services.obs.removeObserver(obs, aTopic);
+        Services.obs.removeObserver(observer, aTopic);
         executeSoon(aCallback);
         info("whenDelayedStartupFinished found our window");
       }
     }, "browser-delayed-startup-finished", false);
   }
 
   mockTransferRegisterer.register();
 
@@ -165,18 +165,18 @@ function test() {
   Services.obs.addObserver(observer, "http-on-examine-response", false);
 
   testOnWindow(undefined, function(win) {
     // The first save from a regular window sets a cookie.
     triggerSave(win, function() {
       is(gNumSet, 1, "1 cookie should be set");
 
       // The second save from a private window also sets a cookie.
-      testOnWindow({private: true}, function(win2) {
-        triggerSave(win2, function() {
+      testOnWindow({private: true}, function(win) {
+        triggerSave(win, function() {
           is(gNumSet, 2, "2 cookies should be set");
           finish();
         });
       });
     });
   });
 }
 
--- a/browser/base/content/test/general/browser_save_link_when_window_navigates.js
+++ b/browser/base/content/test/general/browser_save_link_when_window_navigates.js
@@ -75,19 +75,19 @@ function triggerSave(aWindow, aCallback)
         win.document.documentElement._fireButtonEvent("accept");
         win.close();
         return;
       }
     }
     ok(false, "No Unknown Content Type dialog yet?");
   }
 
-  function onTransferComplete(aWindow2, downloadSuccess) {
+  function onTransferComplete(aWindow, downloadSuccess, destDir) {
     ok(downloadSuccess, "Link should have been downloaded successfully");
-    aWindow2.close();
+    aWindow.close();
 
     executeSoon(aCallback);
   }
 }
 
 
 var windowObserver = {
   setCallback: function(aCallback) {
@@ -158,16 +158,16 @@ function test() {
 
   Services.prefs.setBoolPref(ALWAYS_DOWNLOAD_DIR_PREF, false);
   testOnWindow(undefined, function(win) {
     let windowGonePromise = promiseWindowWillBeClosed(win);
     Services.prefs.setBoolPref(SAVE_PER_SITE_PREF, true);
     triggerSave(win, function() {
       windowGonePromise.then(function() {
         Services.prefs.setBoolPref(SAVE_PER_SITE_PREF, false);
-        testOnWindow(undefined, function(win2) {
-          triggerSave(win2, finish);
+        testOnWindow(undefined, function(win) {
+          triggerSave(win, finish);
         });
       });
     });
   });
 }
 
--- a/browser/base/content/test/general/browser_selectpopup.js
+++ b/browser/base/content/test/general/browser_selectpopup.js
@@ -265,46 +265,46 @@ add_task(function*() {
     [ "frame", "border-top: 5px solid green; border-left: 10px solid red; border-right: 35px solid blue;", 10, 5 ],
     [ "frame", "border: none; padding-left: 6px; padding-right: 12px; padding-top: 2px;", -4, -3 ],
     [ "select", "margin: 9px; transform: translateY(-3px);", 9, 6 ],
   ];
 
   for (let stepIndex = 0; stepIndex < steps.length; stepIndex++) {
     let step = steps[stepIndex];
 
-    yield ContentTask.spawn(gBrowser.selectedBrowser, step, function*(contentStep) {
+    yield ContentTask.spawn(gBrowser.selectedBrowser, step, function*(step) {
       return new Promise(resolve => {
         let changedWin = content;
 
         let elem;
-        if (contentStep[0] == "select") {
+        if (step[0] == "select") {
           changedWin = content.document.getElementById("frame").contentWindow;
           elem = changedWin.document.getElementById("select");
         }
         else {
-          elem = content.document.getElementById(contentStep[0]);
+          elem = content.document.getElementById(step[0]);
         }
 
         changedWin.addEventListener("MozAfterPaint", function onPaint() {
           changedWin.removeEventListener("MozAfterPaint", onPaint);
           resolve();
         });
 
-        elem.style = contentStep[1];
+        elem.style = step[1];
       });
     });
 
     yield openSelectPopup(selectPopup, false);
 
     expectedX += step[2];
     expectedY += step[3];
 
-    let popupRect = selectPopup.getBoundingClientRect();
-    is(popupRect.left, expectedX, "step " + (stepIndex + 1) + " x");
-    is(popupRect.top, expectedY, "step " + (stepIndex + 1) + " y");
+    let rect = selectPopup.getBoundingClientRect();
+    is(rect.left, expectedX, "step " + (stepIndex + 1) + " x");
+    is(rect.top, expectedY, "step " + (stepIndex + 1) + " y");
 
     yield hideSelectPopup(selectPopup);
   }
 
   yield BrowserTestUtils.removeTab(tab);
 });
 
 // Test that we get the right events when a select popup is changed.
@@ -360,36 +360,38 @@ add_task(function* test_event_order() {
         targetIsOption: true,
       },
     ];
 
     for (let mode of ["enter", "click"]) {
       let expected = mode == "enter" ? expectedEnter : expectedClick;
       yield openSelectPopup(selectPopup, true, mode == "enter" ? "#one" : "#two");
 
-      let eventsPromise = ContentTask.spawn(browser, [mode, expected], function*([contentMode, contentExpected]) {
+      let eventsPromise = ContentTask.spawn(browser, { mode, expected }, function*(args) {
+        let expected = args.expected;
+
         return new Promise((resolve) => {
           function onEvent(event) {
             select.removeEventListener(event.type, onEvent);
-            Assert.ok(contentExpected.length, "Unexpected event " + event.type);
-            let expectation = contentExpected.shift();
+            Assert.ok(expected.length, "Unexpected event " + event.type);
+            let expectation = expected.shift();
             Assert.equal(event.type, expectation.type,
                          "Expected the right event order");
             Assert.ok(event.bubbles, "All of these events should bubble");
             Assert.equal(event.cancelable, expectation.cancelable,
                          "Cancellation property should match");
             Assert.equal(event.target.localName,
                          expectation.targetIsOption ? "option" : "select",
                          "Target matches");
-            if (!contentExpected.length) {
+            if (!expected.length) {
               resolve();
             }
           }
 
-          let select = content.document.getElementById(contentMode == "enter" ? "one" : "two");
+          let select = content.document.getElementById(args.mode == "enter" ? "one" : "two");
           for (let event of ["input", "change", "mousedown", "mouseup", "click"]) {
             select.addEventListener(event, onEvent);
           }
         });
       });
 
       EventUtils.synthesizeKey("KEY_ArrowDown", { code: "ArrowDown" });
       yield hideSelectPopup(selectPopup, mode);
@@ -443,19 +445,19 @@ function* performLargePopupTests(win)
     yield hideSelectPopup(selectPopup, "enter", win);
 
     position = positions.shift();
     if (!position) {
       break;
     }
 
     let contentPainted = BrowserTestUtils.contentPainted(browser);
-    yield ContentTask.spawn(browser, position, function*(contentPosition) {
+    yield ContentTask.spawn(browser, position, function*(position) {
       let select = content.document.getElementById("one");
-      select.setAttribute("style", contentPosition);
+      select.setAttribute("style", position);
     });
     yield contentPainted;
   }
 }
 
 // This test checks select elements with a large number of options to ensure that
 // the popup appears within the browser area.
 add_task(function* test_large_popup() {
--- a/browser/base/content/test/general/browser_syncui.js
+++ b/browser/base/content/test/general/browser_syncui.js
@@ -39,19 +39,19 @@ function checkBroadcasterVisible(broadca
   for (let check of all) {
     let eltHidden = document.getElementById(check).hidden;
     Assert.equal(eltHidden, check == broadcasterId ? false : true, check);
   }
 }
 
 function promiseObserver(topic) {
   return new Promise(resolve => {
-    let obs = (aSubject, aTopic, aData) => {
-      Services.obs.removeObserver(obs, aTopic);
-      resolve(aSubject);
+    let obs = (subject, topic, data) => {
+      Services.obs.removeObserver(obs, topic);
+      resolve(subject);
     }
     Services.obs.addObserver(obs, topic, false);
   });
 }
 
 function checkButtonTooltips(stringPrefix) {
   for (let butId of ["PanelUI-remotetabs-syncnow", "PanelUI-fxa-icon"]) {
     let text = document.getElementById(butId).getAttribute("tooltiptext");
--- a/browser/base/content/test/general/browser_tabfocus.js
+++ b/browser/base/content/test/general/browser_tabfocus.js
@@ -58,17 +58,17 @@ function* getFocusedElementForBrowser(br
   }
   var focusedWindow = {};
   var node = fm.getFocusedElementForWindow(browser.contentWindow, false, focusedWindow);
   return "Focus is " + (node ? node.id : "<none>");
 }
 
 function focusInChild()
 {
-  var contentFM = Components.classes["@mozilla.org/focus-manager;1"].
+  var fm = Components.classes["@mozilla.org/focus-manager;1"].
                       getService(Components.interfaces.nsIFocusManager);
 
   function getWindowDocId(target)
   {
     return (String(target.location).indexOf("1") >= 0) ? "window1" : "window2";
   }
 
   function eventListener(event) {
@@ -86,34 +86,34 @@ function focusInChild()
   addEventListener("blur", eventListener, true);
 
   addMessageListener("Browser:ChangeFocus", function changeFocus(message) {
     content.document.getElementById(message.data.id)[message.data.type]();
   });
 
   addMessageListener("Browser:GetFocusedElement", function getFocusedElement(message) {
     var focusedWindow = {};
-    var node = contentFM.getFocusedElementForWindow(content, false, focusedWindow);
+    var node = fm.getFocusedElementForWindow(content, false, focusedWindow);
     var details = "Focus is " + (node ? node.id : "<none>");
 
     /* Check focus manager properties. Add an error onto the string if they are
        not what is expected which will cause matching to fail in the parent process. */
     let doc = content.document;
     if (!message.data.dontCheckExtraFocus) {
-      if (contentFM.focusedElement != node) {
+      if (fm.focusedElement != node) {
         details += "<ERROR: focusedElement doesn't match>";
       }
-      if (contentFM.focusedWindow && contentFM.focusedWindow != content) {
+      if (fm.focusedWindow && fm.focusedWindow != content) {
         details += "<ERROR: focusedWindow doesn't match>";
       }
-      if ((contentFM.focusedWindow == content) != doc.hasFocus()) {
+      if ((fm.focusedWindow == content) != doc.hasFocus()) {
         details += "<ERROR: child hasFocus() is not correct>";
       }
-      if ((contentFM.focusedElement && doc.activeElement != contentFM.focusedElement) ||
-          (!contentFM.focusedElement && doc.activeElement != doc.body)) {
+      if ((fm.focusedElement && doc.activeElement != fm.focusedElement) ||
+          (!fm.focusedElement && doc.activeElement != doc.body)) {
         details += "<ERROR: child activeElement is not correct>";
       }
     }
 
     sendSyncMessage("Browser:GetCurrentFocus", { details : details });
   });
 }
 
@@ -155,16 +155,17 @@ add_task(function*() {
 
   _lastfocus = "urlbar";
   _lastfocuswindow = "main-window";
 
   window.addEventListener("focus", _browser_tabfocus_test_eventOccured, true);
   window.addEventListener("blur", _browser_tabfocus_test_eventOccured, true);
 
   // make sure that the focus initially starts out blank
+  var fm = Services.focus;
   var focusedWindow = {};
 
   let focused = yield getFocusedElementForBrowser(browser1);
   is(focused, "Focus is <none>", "initial focus in tab 1");
 
   focused = yield getFocusedElementForBrowser(browser2);
   is(focused, "Focus is <none>", "initial focus in tab 2");
 
@@ -367,29 +368,29 @@ add_task(function*() {
   window.removeEventListener("blur", _browser_tabfocus_test_eventOccured, true);
 
   gBrowser.removeCurrentTab();
   gBrowser.removeCurrentTab();
 
   finish();
 });
 
+function getWindowDocId(target)
+{
+  if (target == browser1.contentWindow || target == browser1.contentDocument) {
+    return "window1";
+  }
+  if (target == browser2.contentWindow || target == browser2.contentDocument) {
+    return "window2";
+  }
+  return "main-window";
+}
+
 function _browser_tabfocus_test_eventOccured(event)
 {
-  function getWindowDocId(target)
-  {
-    if (target == browser1.contentWindow || target == browser1.contentDocument) {
-      return "window1";
-    }
-    if (target == browser2.contentWindow || target == browser2.contentDocument) {
-      return "window2";
-    }
-    return "main-window";
-  }
-
   var id;
 
   // Some focus events from the child bubble up? Ignore them.
   if (Cu.isCrossProcessWrapper(event.originalTarget))
     return;
 
   if (event.target instanceof Window)
     id = getWindowDocId(event.originalTarget) + "-window";
--- a/browser/base/content/test/general/browser_web_channel.js
+++ b/browser/base/content/test/general/browser_web_channel.js
@@ -125,29 +125,29 @@ var gTests = [
 
       let preRedirectChannel = new WebChannel("pre_redirect", Services.io.newURI(HTTP_IFRAME_PATH, null, null));
       let postRedirectChannel = new WebChannel("post_redirect", Services.io.newURI(HTTP_REDIRECTED_IFRAME_PATH, null, null));
 
       let promiseTestDone = new Promise(function (resolve, reject) {
         preRedirectChannel.listen(function (id, message, preRedirectSender) {
           if (message.command === "redirecting") {
 
-            postRedirectChannel.listen(function (aId, aMessage, aPostRedirectSender) {
-              is(aId, "post_redirect");
-              isnot(aMessage.command, "no_response_expected");
+            postRedirectChannel.listen(function (id, message, postRedirectSender) {
+              is(id, "post_redirect");
+              isnot(message.command, "no_response_expected");
 
-              if (aMessage.command === "loaded") {
+              if (message.command === "loaded") {
                 // The message should not be received on the preRedirectChannel
                 // because the target window has redirected.
                 preRedirectChannel.send({ command: "no_response_expected" }, preRedirectSender);
-                postRedirectChannel.send({ command: "done" }, aPostRedirectSender);
-              } else if (aMessage.command === "done") {
+                postRedirectChannel.send({ command: "done" }, postRedirectSender);
+              } else if (message.command === "done") {
                 resolve();
               } else {
-                reject(new Error(`Unexpected command ${aMessage.command}`));
+                reject(new Error(`Unexpected command ${message.command}`));
               }
             });
           } else {
             reject(new Error(`Unexpected command ${message.command}`));
           }
         });
       });
 
@@ -398,17 +398,17 @@ var gTests = [
     }
   }
 ]; // gTests
 
 function test() {
   waitForExplicitFinish();
 
   Task.spawn(function* () {
-    for (let testCase of gTests) {
-      info("Running: " + testCase.desc);
-      yield testCase.run();
+    for (let test of gTests) {
+      info("Running: " + test.desc);
+      yield test.run();
     }
   }).then(finish, ex => {
     ok(false, "Unexpected Exception: " + ex);
     finish();
   });
 }
--- a/browser/base/content/test/general/content_aboutAccounts.js
+++ b/browser/base/content/test/general/content_aboutAccounts.js
@@ -25,27 +25,27 @@ addEventListener("DOMContentLoaded", fun
   removeEventListener("DOMContentLoaded", domContentLoaded, true);
   let iframe = content.document.getElementById("remote");
   if (!iframe) {
     // at least one test initially loads about:blank - in that case, we are done.
     return;
   }
   // We use DOMContentLoaded here as that fires for our iframe even when we've
   // arranged for the URL in the iframe to cause an error.
-  addEventListener("DOMContentLoaded", function iframeLoaded(dclEvent) {
+  addEventListener("DOMContentLoaded", function iframeLoaded(event) {
     if (iframe.contentWindow.location.href == "about:blank" ||
-        dclEvent.target != iframe.contentDocument) {
+        event.target != iframe.contentDocument) {
       return;
     }
     removeEventListener("DOMContentLoaded", iframeLoaded, true);
     sendAsyncMessage("test:iframe:load", {url: iframe.contentDocument.location.href});
     // And an event listener for the test responses, which we send to the test
     // via a message.
-    iframe.contentWindow.addEventListener("FirefoxAccountsTestResponse", function (fxAccountsEvent) {
-      sendAsyncMessage("test:response", {data: fxAccountsEvent.detail.data});
+    iframe.contentWindow.addEventListener("FirefoxAccountsTestResponse", function (event) {
+      sendAsyncMessage("test:response", {data: event.detail.data});
     }, true);
   }, true);
 }, true);
 
 // Return the visibility state of a list of ids.
 addMessageListener("test:check-visibilities", function (message) {
   let result = {};
   for (let id of message.data.ids) {
@@ -67,19 +67,19 @@ addMessageListener("test:check-visibilit
 });
 
 addMessageListener("test:load-with-mocked-profile-path", function (message) {
   addEventListener("DOMContentLoaded", function domContentLoaded(event) {
     removeEventListener("DOMContentLoaded", domContentLoaded, true);
     content.getDefaultProfilePath = () => message.data.profilePath;
     // now wait for the iframe to load.
     let iframe = content.document.getElementById("remote");
-    iframe.addEventListener("load", function iframeLoaded(loadEvent) {
+    iframe.addEventListener("load", function iframeLoaded(event) {
       if (iframe.contentWindow.location.href == "about:blank" ||
-          loadEvent.target != iframe) {
+          event.target != iframe) {
         return;
       }
       iframe.removeEventListener("load", iframeLoaded, true);
       sendAsyncMessage("test:load-with-mocked-profile-path-response",
                        {url: iframe.contentDocument.location.href});
     }, true);
   });
   let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
--- a/browser/base/content/test/general/contextmenu_common.js
+++ b/browser/base/content/test/general/contextmenu_common.js
@@ -253,39 +253,39 @@ function* test_contextmenu(selector, men
 
   // Default to centered if no positioning is defined.
   if (!options.offsetX && !options.offsetY) {
     options.centered = true;
   }
 
   if (!options.skipFocusChange) {
     yield ContentTask.spawn(gBrowser.selectedBrowser,
-                            [lastElementSelector, selector],
-                            function*([contentLastElementSelector, contentSelector]) {
-      if (contentLastElementSelector) {
-        let contentLastElement = content.document.querySelector(contentLastElementSelector);
-        contentLastElement.blur();
+                            {lastElementSelector, selector},
+                            function*({lastElementSelector, selector}) {
+      if (lastElementSelector) {
+        let lastElement = content.document.querySelector(lastElementSelector);
+        lastElement.blur();
       }
-      let element = content.document.querySelector(contentSelector);
+      let element = content.document.querySelector(selector);
       element.focus();
     });
     lastElementSelector = selector;
     info(`Moved focus to ${selector}`);
   }
 
   if (options.preCheckContextMenuFn) {
     yield options.preCheckContextMenuFn();
     info("Completed preCheckContextMenuFn");
   }
 
   if (options.waitForSpellCheck) {
     info("Waiting for spell check");
-    yield ContentTask.spawn(gBrowser.selectedBrowser, selector, function*(contentSelector) {
+    yield ContentTask.spawn(gBrowser.selectedBrowser, selector, function*(selector) {
       let {onSpellCheck} = Cu.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm", {});
-      let element = content.document.querySelector(contentSelector);
+      let element = content.document.querySelector(selector);
       yield new Promise(resolve => onSpellCheck(element, resolve));
       info("Spell check running");
     });
   }
 
   let awaitPopupShown = BrowserTestUtils.waitForEvent(contextMenu, "popupshown");
   yield BrowserTestUtils.synthesizeMouse(selector, options.offsetX || 0, options.offsetY || 0, {
       type: "contextmenu",
--- a/browser/base/content/test/general/head.js
+++ b/browser/base/content/test/general/head.js
@@ -322,17 +322,17 @@ function waitForAsyncUpdates(aCallback, 
  * @param aURI The URI.
  * @param aExpectedValue The expected value.
  * @return {Promise}
  * @resolves When the check has been added successfully.
  * @rejects JavaScript exception.
  */
 function promiseIsURIVisited(aURI, aExpectedValue) {
   let deferred = Promise.defer();
-  PlacesUtils.asyncHistory.isURIVisited(aURI, function(unused, aIsVisited) {
+  PlacesUtils.asyncHistory.isURIVisited(aURI, function(aURI, aIsVisited) {
     deferred.resolve(aIsVisited);
   });
 
   return deferred.promise;
 }
 
 function whenNewTabLoaded(aWindow, aCallback) {
   aWindow.BrowserOpenTab();
@@ -368,19 +368,19 @@ function promiseHistoryClearedState(aURI
   let deferred = Promise.defer();
   let callbackCount = 0;
   let niceStr = aShouldBeCleared ? "no longer" : "still";
   function callbackDone() {
     if (++callbackCount == aURIs.length)
       deferred.resolve();
   }
   aURIs.forEach(function (aURI) {
-    PlacesUtils.asyncHistory.isURIVisited(aURI, function(uri, isVisited) {
-      is(isVisited, !aShouldBeCleared,
-         "history visit " + uri.spec + " should " + niceStr + " exist");
+    PlacesUtils.asyncHistory.isURIVisited(aURI, function(aURI, aIsVisited) {
+      is(aIsVisited, !aShouldBeCleared,
+         "history visit " + aURI.spec + " should " + niceStr + " exist");
       callbackDone();
     });
   });
 
   return deferred.promise;
 }
 
 /**
@@ -395,17 +395,17 @@ function promiseHistoryClearedState(aURI
  *        If you're using this method to avoid hitting the network, you want the default (true).
  *        However, the browser UI will behave differently for loads stopped directly from
  *        the progress listener (effectively in the middle of a call to loadURI) and so there
  *        are cases where you may want to avoid stopping the load directly from within the
  *        progress listener callback.
  * @return promise
  */
 function waitForDocLoadAndStopIt(aExpectedURL, aBrowser=gBrowser.selectedBrowser, aStopFromProgressListener=true) {
-  function content_script(contentStopFromProgressListener) {
+  function content_script(aStopFromProgressListener) {
     let { interfaces: Ci, utils: Cu } = Components;
     Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
     let wp = docShell.QueryInterface(Ci.nsIWebProgress);
 
     function stopContent(now, uri) {
       if (now) {
         /* Hammer time. */
         content.stop();
@@ -423,17 +423,17 @@ function waitForDocLoadAndStopIt(aExpect
 
         if (webProgress.isTopLevel &&
             flags & Ci.nsIWebProgressListener.STATE_START) {
           wp.removeProgressListener(progressListener);
 
           let chan = req.QueryInterface(Ci.nsIChannel);
           dump(`waitForDocLoadAndStopIt: Document start: ${chan.URI.spec}\n`);
 
-          stopContent(contentStopFromProgressListener, chan.originalURI.spec);
+          stopContent(aStopFromProgressListener, chan.originalURI.spec);
         }
       },
       QueryInterface: XPCOMUtils.generateQI(["nsISupportsWeakReference"])
     };
     wp.addProgressListener(progressListener, wp.NOTIFY_STATE_WINDOW);
 
     /**
      * As |this| is undefined and we can't extend |docShell|, adding an unload
@@ -903,18 +903,18 @@ function promiseNotificationShown(notifi
  * @resolves An object with subject and data properties from the observed
  *           notification.
  * @rejects Never.
  */
 function promiseTopicObserved(aTopic)
 {
   return new Promise((resolve) => {
     Services.obs.addObserver(
-      function PTO_observe(aSubject, aTopic2, aData) {
-        Services.obs.removeObserver(PTO_observe, aTopic2);
+      function PTO_observe(aSubject, aTopic, aData) {
+        Services.obs.removeObserver(PTO_observe, aTopic);
         resolve({subject: aSubject, data: aData});
       }, aTopic, false);
   });
 }
 
 function promiseNewSearchEngine(basename) {
   return new Promise((resolve, reject) => {
     info("Waiting for engine to be added: " + basename);
@@ -1040,17 +1040,17 @@ function getPropertyBagValue(bag, key) {
  *        will contain other extra information that is not
  *        compared against.
  * @returns Promise
  */
 function promiseCrashReport(expectedExtra={}) {
   return Task.spawn(function*() {
     info("Starting wait on crash-report-status");
     let [subject, ] =
-      yield TestUtils.topicObserved("crash-report-status", (unused, data) => {
+      yield TestUtils.topicObserved("crash-report-status", (subject, data) => {
         return data == "success";
       });
     info("Topic observed!");
 
     if (!(subject instanceof Ci.nsIPropertyBag2)) {
       throw new Error("Subject was not a Ci.nsIPropertyBag2");
     }
 
--- a/security/manager/ssl/tests/mochitest/stricttransportsecurity/test_sts_privatebrowsing_perwindowpb.html
+++ b/security/manager/ssl/tests/mochitest/stricttransportsecurity/test_sts_privatebrowsing_perwindowpb.html
@@ -92,20 +92,20 @@
   function startRound(win, isPrivate, round) {
     currentround = round;
     testsleftinround = NUM_TEST_FRAMES;
     SimpleTest.info("TESTS LEFT IN ROUND " + currentround + ": " + testsleftinround);
 
     let browser = win.gBrowser.selectedBrowser;
     let src = "https://example.com" + STSPATH + "/" + round + "_bootstrap.html";
 
-    ContentTask.spawn(browser, src, function* (contentSrc) {
+    ContentTask.spawn(browser, src, function* (src) {
       let frame = content.document.createElement("iframe");
       frame.setAttribute('id', 'ifr_bootstrap');
-      frame.setAttribute('src', contentSrc);
+      frame.setAttribute('src', src);
 
       return new Promise(resolve => {
         frame.addEventListener("load", resolve);
         content.document.body.appendChild(frame);
       });
     }).then(() => {
       onMessageReceived(win, isPrivate, "BOOTSTRAP " + round);
     });
@@ -121,20 +121,20 @@
     });
   }
 
   function loadVerifyFrame(win, isPrivate, test, testName, aCallback) {
     let id = 'ifr_' + testName;
     let src = test.url + '?id=' + testName;
     let browser = win.gBrowser.selectedBrowser;
 
-    ContentTask.spawn(browser, [id, src], function* ([contentId, contentSrc]) {
+    ContentTask.spawn(browser, [id, src], function* ([id, src]) {
       let frame = content.document.createElement("iframe");
-      frame.setAttribute('id', contentId);
-      frame.setAttribute('src', contentSrc);
+      frame.setAttribute('id', id);
+      frame.setAttribute('src', src);
 
       return new Promise(resolve => {
         frame.addEventListener("load", () => {
           resolve(frame.contentDocument.location.protocol);
         });
 
         content.document.body.appendChild(frame);
       });
@@ -177,20 +177,20 @@
                              ", test " + result[1]);
     testsleftinround--;
 
     // if this round is complete...
     if (testsleftinround < 1) {
       SimpleTest.info("DONE WITH ROUND " + currentround);
       // remove all the iframes in the document
       let browser = win.gBrowser.selectedBrowser;
-      ContentTask.spawn(browser, testframes, function* (contentTestFrames) {
+      ContentTask.spawn(browser, testframes, function* (testframes) {
         content.document.body.removeChild(
           content.document.getElementById('ifr_bootstrap'));
-        for (let test in contentTestFrames) {
+        for (let test in testframes) {
           content.document.body.removeChild(
             content.document.getElementById('ifr_' + test));
         }
       }).then(() => {
         currentround = "";
 
         if (!isPrivate) {
           clean_up_sts_state(isPrivate);
--- a/testing/mochitest/mochitest.eslintrc.js
+++ b/testing/mochitest/mochitest.eslintrc.js
@@ -1,14 +1,13 @@
 // Parent config file for all mochitest files.
 module.exports = {
   rules: {
     "mozilla/import-headjs-globals": 1,
     "mozilla/mark-test-function-used": 1,
-    "no-shadow": 2,
   },
 
   "env": {
     "browser": true,
   },
 
   // All globals made available in the test environment.
   "globals": {
--- a/toolkit/components/alerts/test/test_alerts_noobserve.html
+++ b/toolkit/components/alerts/test/test_alerts_noobserve.html
@@ -18,17 +18,17 @@
 
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 const Cc = SpecialPowers.Cc;
 const Ci = SpecialPowers.Ci;
 
 const chromeScript = SpecialPowers.loadChromeScript(_ => {
-  const { utils: Cu } = Components;
+  const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
   Cu.import("resource://gre/modules/Services.jsm");
   Cu.import("resource://gre/modules/Timer.jsm");
 
   function anyXULAlertsVisible() {
     var windows = Services.wm.getEnumerator("alert:alert");
     return windows.hasMoreElements();
   }
--- a/toolkit/components/alerts/test/test_alerts_requireinteraction.html
+++ b/toolkit/components/alerts/test/test_alerts_requireinteraction.html
@@ -9,33 +9,33 @@
 <body>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 const Cc = SpecialPowers.Cc;
 const Ci = SpecialPowers.Ci;
 
 const chromeScript = SpecialPowers.loadChromeScript(_ => {
-  const { utils: Cu } = Components;
+  const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
   Cu.import("resource://gre/modules/Services.jsm");
   Cu.import("resource://gre/modules/Timer.jsm");
 
   addMessageListener("waitForXULAlert", function() {
     var timer = setTimeout(function() {
       Services.ww.unregisterNotification(windowObserver);
       sendAsyncMessage("waitForXULAlert", false);
     }, 2000);
 
     var windowObserver = function(aSubject, aTopic, aData) {
       if (aTopic != "domwindowopened") {
         return;
       }
 
-      var win = aSubject.QueryInterface(Components.interfaces.nsIDOMWindow);
+      var win = aSubject.QueryInterface(Ci.nsIDOMWindow);
       win.addEventListener("load", function onLoad() {
         win.removeEventListener("load", onLoad);
         let windowType = win.document.documentElement.getAttribute("windowtype");
         if (windowType == "alert:alert") {
           clearTimeout(timer);
           Services.ww.unregisterNotification(windowObserver);
 
           sendAsyncMessage("waitForXULAlert", true);
--- a/toolkit/components/alerts/test/test_image.html
+++ b/toolkit/components/alerts/test/test_image.html
@@ -30,21 +30,21 @@ function promiseImage(alert, timeout = 0
   return new Promise(resolve => {
     var isDone = false;
     function done(value) {
       ok(!isDone, "Should call the image listener once");
       isDone = true;
       resolve(value);
     }
     alert.loadImage(timeout, SpecialPowers.wrapCallbackObject({
-      onImageReady(aUserData, aRequest) {
-        done([true, aRequest, aUserData]);
+      onImageReady(userData, request) {
+        done([true, request, userData]);
       },
-      onImageMissing(aUserData) {
-        done([false, aUserData]);
+      onImageMissing(userData) {
+        done([false, userData]);
       },
     }), SpecialPowers.wrap(userData));
   });
 }
 
 add_task(function* testContext() {
   var inUserData = Cc["@mozilla.org/supports-PRInt64;1"]
                      .createInstance(Ci.nsISupportsPRInt64);
@@ -80,20 +80,20 @@ add_task(function* testAnimatedGIF() {
   is(request.image.width, 256, "GIF width should be 256px");
   is(request.image.height, 256, "GIF height should be 256px");
 });
 
 add_task(function* testCancel() {
   var alert = makeAlert(null, imageServerURL + "?f=image.gif&t=180");
   yield new Promise((resolve, reject) => {
     var request = alert.loadImage(0, SpecialPowers.wrapCallbackObject({
-      onImageReady() {
+      onImageReady(userData, request) {
         reject(new Error("Should not load cancelled request"));
       },
-      onImageMissing() {
+      onImageMissing(userData) {
         resolve();
       },
     }), null);
     request.cancel(SpecialPowers.Cr.NS_BINDING_ABORTED);
   });
 });
 
 add_task(function* testMixedContent() {
--- a/toolkit/components/alerts/test/test_multiple_alerts.html
+++ b/toolkit/components/alerts/test/test_multiple_alerts.html
@@ -9,21 +9,23 @@
 <body>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 const Cc = SpecialPowers.Cc;
 const Ci = SpecialPowers.Ci;
 
 const chromeScript = SpecialPowers.loadChromeScript(_ => {
-  Components.utils.import("resource://gre/modules/Services.jsm");
-  Components.utils.import("resource://gre/modules/Timer.jsm");
+  const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-  const alertService = Components.classes["@mozilla.org/alerts-service;1"]
-                                 .getService(Components.interfaces.nsIAlertsService);
+  Cu.import("resource://gre/modules/Services.jsm");
+  Cu.import("resource://gre/modules/Timer.jsm");
+
+  const alertService = Cc["@mozilla.org/alerts-service;1"]
+                         .getService(Ci.nsIAlertsService);
 
   addMessageListener("waitForPosition", function() {
     var timer = setTimeout(function() {
       Services.ww.unregisterNotification(windowObserver);
       sendAsyncMessage("waitedForPosition", null);
     }, 2000);
 
     var windowObserver = function(aSubject, aTopic, aData) {
@@ -31,17 +33,17 @@ const chromeScript = SpecialPowers.loadC
         return;
       }
 
       // Alerts are implemented using XUL.
       clearTimeout(timer);
 
       Services.ww.unregisterNotification(windowObserver);
 
-      var win = aSubject.QueryInterface(Components.interfaces.nsIDOMWindow);
+      var win = aSubject.QueryInterface(Ci.nsIDOMWindow);
       win.addEventListener("pageshow", function onPageShow() {
         win.removeEventListener("pageshow", onPageShow, false);
 
         var x = win.screenX;
         var y = win.screenY;
 
         win.addEventListener("pagehide", function onPageHide() {
           win.removeEventListener("pagehide", onPageHide, false);
--- a/toolkit/components/alerts/test/test_principal.html
+++ b/toolkit/components/alerts/test/test_principal.html
@@ -16,17 +16,19 @@
 const Cc = SpecialPowers.Cc;
 const Ci = SpecialPowers.Ci;
 const Services = SpecialPowers.Services;
 
 const notifier = Cc["@mozilla.org/alerts-service;1"]
                    .getService(Ci.nsIAlertsService);
 
 const chromeScript = SpecialPowers.loadChromeScript(_ => {
-  Components.utils.import("resource://gre/modules/Services.jsm");
+  const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
+
+  Cu.import("resource://gre/modules/Services.jsm");
 
   addMessageListener("anyXULAlertsVisible", function() {
     var windows = Services.wm.getEnumerator("alert:alert");
     return windows.hasMoreElements();
   });
 
   addMessageListener("getAlertSource", function() {
     var alertWindows = Services.wm.getEnumerator("alert:alert");
--- a/toolkit/components/extensions/test/mochitest/test_chrome_ext_background_debug_global.html
+++ b/toolkit/components/extensions/test/mochitest/test_chrome_ext_background_debug_global.html
@@ -59,17 +59,17 @@ add_task(function* () {
           is("test!", context.testThing, "global context is the background script context");
           resolve();
         }
       },
     });
   });
 
   let addon = yield new Promise((resolve, reject) => {
-    AddonManager.getAddonByID(ID, aAddon => aAddon ? resolve(aAddon) : reject());
+    AddonManager.getAddonByID(ID, addon => addon ? resolve(addon) : reject());
   });
 
   ok(addon, `Got the addon wrapper for ${addon.id}`);
 
   function waitForDebugGlobalChanges(times, initialAddonInstanceID) {
     return new Promise((resolve) => {
       AddonManager.addAddonListener({
         count: 0,
--- a/toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_saveAs.html
+++ b/toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_saveAs.html
@@ -8,18 +8,19 @@
   <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
 </head>
 <body>
 
 <script type="text/javascript">
 "use strict";
 
 add_task(function* test_downloads_saveAs() {
+
   function background() {
-    const url = URL.createObjectURL(new Blob(["file content"]));
+    const url = URL.createObjectURL(new Blob(['file content']));
     browser.test.onMessage.addListener(() =>
       browser.downloads.download({url, saveAs: true})
         .then(id => browser.downloads.onChanged.addListener(delta => {
           if (delta.state.current === "complete") {
             browser.test.sendMessage("done", {ok: true, id});
           }
         })).catch(({message}) => {
           browser.test.sendMessage("done", {ok: false, message});
--- a/toolkit/components/extensions/test/mochitest/test_chrome_ext_storage_cleanup.html
+++ b/toolkit/components/extensions/test/mochitest/test_chrome_ext_storage_cleanup.html
@@ -31,20 +31,20 @@ add_task(function* test_uninstall() {
         db.createObjectStore("store", {keyPath: "name"});
       };
 
       req.onsuccess = e => {
         let db = e.target.result;
         let transaction = db.transaction("store", "readwrite");
         let addreq = transaction.objectStore("store")
                                 .add({name: "hello", value: "world"});
-        addreq.onerror = addreqError => {
-          reject(new Error(`add to indexedDB failed with ${addreqError.errorCode}`));
+        addreq.onerror = e => {
+          reject(new Error(`add to indexedDB failed with ${e.errorCode}`));
         };
-        addreq.onsuccess = () => {
+        addreq.onsuccess = e => {
           resolve();
         };
       };
     });
 
     let browserStoragePromise = browser.storage.local.set({hello: "world"});
 
     Promise.all([idbPromise, browserStoragePromise]).then(() => {
@@ -65,20 +65,20 @@ add_task(function* test_uninstall() {
         // no database, data is not present
         resolve(false);
       };
 
       req.onsuccess = e => {
         let db = e.target.result;
         let transaction = db.transaction("store", "readwrite");
         let addreq = transaction.objectStore("store").get("hello");
-        addreq.onerror = addreqError => {
-          reject(new Error(`read from indexedDB failed with ${addreqError.errorCode}`));
+        addreq.onerror = e => {
+          reject(new Error(`read from indexedDB failed with ${e.errorCode}`));
         };
-        addreq.onsuccess = () => {
+        addreq.onsuccess = e => {
           let match = (addreq.result.value == "world");
           resolve(match);
         };
       };
     });
 
     let browserStoragePromise = browser.storage.local.get("hello").then(result => {
       return (Object.keys(result).length == 1 && result.hello == "world");
--- a/toolkit/components/extensions/test/mochitest/test_ext_content_security_policy.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_content_security_policy.html
@@ -74,24 +74,24 @@ function* testPolicy(customCSP = null) {
   }
 
 
   function getCSP(window) {
     let {cspJSON} = SpecialPowers.Cu.getObjectPrincipal(window);
     return JSON.parse(cspJSON);
   }
 
-  function background(getCSPFn) {
+  function background(getCSP) {
     browser.test.sendMessage("base-url", browser.extension.getURL("").replace(/\/$/, ""));
 
-    browser.test.sendMessage("background-csp", getCSPFn(window));
+    browser.test.sendMessage("background-csp", getCSP(window));
   }
 
-  function tabScript(getCSPFn) {
-    browser.test.sendMessage("tab-csp", getCSPFn(window));
+  function tabScript(getCSP) {
+    browser.test.sendMessage("tab-csp", getCSP(window));
   }
 
   let extension = ExtensionTestUtils.loadExtension({
     background: `(${background})(${getCSP})`,
 
     files: {
       "tab.html": `<html><head><meta charset="utf-8">
                    <script src="tab.js"></${"script"}></head></html>`,
--- a/toolkit/components/extensions/test/mochitest/test_ext_cookies_permissions.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_cookies_permissions.html
@@ -14,17 +14,17 @@
 <script type="text/javascript">
 "use strict";
 
 function* testCookies(options) {
   // Changing the options object is a bit of a hack, but it allows us to easily
   // pass an expiration date to the background script.
   options.expiry = Date.now() / 1000 + 3600;
 
-  function background(backgroundOptions) {
+  function background(options) {
     // Ask the parent scope to change some cookies we may or may not have
     // permission for.
     let awaitChanges = new Promise(resolve => {
       browser.test.onMessage.addListener(msg => {
         browser.test.assertEq("cookies-changed", msg, "browser.test.onMessage");
         resolve();
       });
     });
@@ -32,43 +32,43 @@ function* testCookies(options) {
     let changed = [];
     browser.cookies.onChanged.addListener(event => {
       changed.push(`${event.cookie.name}:${event.cause}`);
     });
     browser.test.sendMessage("change-cookies");
 
 
     // Try to access some cookies in various ways.
-    let {url, domain, secure} = backgroundOptions;
+    let {url, domain, secure} = options;
 
     let failures = 0;
     let tallyFailure = error => {
       failures++;
     };
 
     awaitChanges.then(() => {
       return browser.cookies.get({url, name: "foo"});
     }).then(cookie => {
-      browser.test.assertEq(backgroundOptions.shouldPass, cookie != null, "should pass == get cookie");
+      browser.test.assertEq(options.shouldPass, cookie != null, "should pass == get cookie");
 
       return browser.cookies.getAll({domain});
     }).then(cookies => {
-      if (backgroundOptions.shouldPass) {
+      if (options.shouldPass) {
         browser.test.assertEq(2, cookies.length, "expected number of cookies");
       } else {
         browser.test.assertEq(0, cookies.length, "expected number of cookies");
       }
 
       return Promise.all([
-        browser.cookies.set({url, domain, secure, name: "foo", "value": "baz", expirationDate: backgroundOptions.expiry}).catch(tallyFailure),
-        browser.cookies.set({url, domain, secure, name: "bar", "value": "quux", expirationDate: backgroundOptions.expiry}).catch(tallyFailure),
+        browser.cookies.set({url, domain, secure, name: "foo", "value": "baz", expirationDate: options.expiry}).catch(tallyFailure),
+        browser.cookies.set({url, domain, secure, name: "bar", "value": "quux", expirationDate: options.expiry}).catch(tallyFailure),
         browser.cookies.remove({url, name: "deleted"}),
       ]);
     }).then(() => {
-      if (backgroundOptions.shouldPass) {
+      if (options.shouldPass) {
         // The order of eviction events isn't guaranteed, so just check that
         // it's there somewhere.
         let evicted = changed.indexOf("evicted:evicted");
         if (evicted < 0) {
           browser.test.fail("got no eviction event");
         } else {
           browser.test.succeed("got eviction event");
           changed.splice(evicted, 1);
@@ -77,17 +77,17 @@ function* testCookies(options) {
         browser.test.assertEq("x:explicit,x:overwrite,x:explicit,x:explicit,foo:overwrite,foo:explicit,bar:explicit,deleted:explicit",
                               changed.join(","), "expected changes");
       } else {
         browser.test.assertEq("", changed.join(","), "expected no changes");
       }
 
       browser.test.notifyPass("cookie-permissions");
     }).then(() => {
-      if (!(backgroundOptions.shouldPass || backgroundOptions.shouldWrite)) {
+      if (!(options.shouldPass || options.shouldWrite)) {
         browser.test.assertEq(2, failures, "Expected failures");
       } else {
         browser.test.assertEq(0, failures, "Expected no failures");
       }
     }).catch(error => {
       browser.test.fail(`Error: ${error} :: ${error.stack}`);
     });
   }
--- a/toolkit/components/extensions/test/mochitest/test_ext_i18n.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_i18n.html
@@ -125,35 +125,35 @@ add_task(function* test_i18n() {
         },
 
         "bar": {
           "message": "(bar)",
           "description": "bar",
         },
       },
 
-      "content.js": "new " + function(runTestsFn) {
-        runTestsFn((...args) => {
+      "content.js": "new " + function(runTests) {
+        runTests((...args) => {
           browser.runtime.sendMessage(["assertEq", ...args]);
         });
 
         browser.runtime.sendMessage(["content-script-finished"]);
       } + `(${runTests})`,
     },
 
-    background: "new " + function(runTestsFn) {
+    background: "new " + function(runTests) {
       browser.runtime.onMessage.addListener(([msg, ...args]) => {
         if (msg == "assertEq") {
           browser.test.assertEq(...args);
         } else {
           browser.test.sendMessage(msg, ...args);
         }
       });
 
-      runTestsFn(browser.test.assertEq.bind(browser.test));
+      runTests(browser.test.assertEq.bind(browser.test));
     } + `(${runTests})`,
   });
 
   yield extension.startup();
 
   let win = window.open("file_sample.html");
   yield extension.awaitMessage("content-script-finished");
   win.close();
@@ -243,17 +243,17 @@ add_task(function* test_get_accept_langu
 add_task(function* test_get_ui_language() {
   function getResults() {
     return {
       getUILanguage: browser.i18n.getUILanguage(),
       getMessage: browser.i18n.getMessage("@@ui_locale"),
     };
   }
 
-  function background(getResultsFn) {
+  function background(getResults) {
     function checkResults(source, results, expected) {
       browser.test.assertEq(
         expected,
         results.getUILanguage,
         `Got expected getUILanguage result in ${source}`
       );
       browser.test.assertEq(
         expected,
@@ -262,31 +262,31 @@ add_task(function* test_get_ui_language(
       );
     }
 
     let tabId;
 
     browser.test.onMessage.addListener(([msg, expected]) => {
       browser.tabs.sendMessage(tabId, "get-results", result => {
         checkResults("contentScript", result, expected);
-        checkResults("background", getResultsFn(), expected);
+        checkResults("background", getResults(), expected);
 
         browser.test.sendMessage("done");
       });
     });
 
     browser.tabs.query({currentWindow: true, active: true}, tabs => {
       tabId = tabs[0].id;
       browser.test.sendMessage("ready");
     });
   }
 
-  function content(getResultsFn) {
+  function content(getResults) {
     browser.runtime.onMessage.addListener((msg, sender, respond) => {
-      respond(getResultsFn());
+      respond(getResults());
     });
   }
 
   let extension = ExtensionTestUtils.loadExtension({
     manifest: {
       "content_scripts": [{
         "matches": ["http://mochi.test/*/file_sample.html"],
         "run_at": "document_start",
--- a/toolkit/components/extensions/test/mochitest/test_ext_i18n_css.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_i18n_css.html
@@ -11,27 +11,27 @@
 <body>
 
 <script type="text/javascript">
 "use strict";
 
 add_task(function* test_i18n_css() {
   let extension = ExtensionTestUtils.loadExtension({
     background: function() {
-      function backgroundFetch(url) {
+      function fetch(url) {
         return new Promise((resolve, reject) => {
           let xhr = new XMLHttpRequest();
           xhr.open("GET", url);
           xhr.onload = () => { resolve(xhr.responseText); };
           xhr.onerror = reject;
           xhr.send();
         });
       }
 
-      Promise.all([backgroundFetch("foo.css"), backgroundFetch("bar.CsS?x#y"), backgroundFetch("foo.txt")]).then(results => {
+      Promise.all([fetch("foo.css"), fetch("bar.CsS?x#y"), fetch("foo.txt")]).then(results => {
         browser.test.assertEq("body { max-width: 42px; }", results[0], "CSS file localized");
         browser.test.assertEq("body { max-width: 42px; }", results[1], "CSS file localized");
 
         browser.test.assertEq("body { __MSG_foo__; }", results[2], "Text file not localized");
 
         browser.test.notifyPass("i18n-css");
       });
 
--- a/toolkit/components/extensions/test/mochitest/test_ext_permission_xhr.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_permission_xhr.html
@@ -56,34 +56,34 @@ add_task(function* test_simple() {
       .then(() => run(true, window.fetch))
       .then(() => run(false, window.fetch))
       .catch(err => {
         browser.test.fail(`Error: ${err} :: ${err.stack}`);
         browser.test.notifyFail("permission_xhr");
       });
   }
 
-  function background(runTestsFn) {
-    runTestsFn("bg").then(() => {
+  function background(runTests) {
+    runTests("bg").then(() => {
       browser.test.notifyPass("permission_xhr");
     });
   }
 
   let extensionData = {
     background: `(${background})(${runTests})`,
     manifest: {
       permissions: ["http://example.com/"],
       content_scripts: [{
         "matches": ["http://mochi.test/*/file_permission_xhr.html"],
         "js": ["content.js"],
       }],
     },
     files: {
-      "content.js": "new " + function(runTestsFn) {
-        runTestsFn("content").then(() => {
+      "content.js": "new " + function(runTests) {
+        runTests("content").then(() => {
           window.wrappedJSObject.privilegedFetch = fetch;
           window.wrappedJSObject.privilegedXHR = XMLHttpRequest;
 
           window.addEventListener("message", function rcv({data}) {
             switch (data.msg) {
               case "test":
                 break;
 
--- a/toolkit/components/extensions/test/mochitest/test_ext_storage_content.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_storage_content.html
@@ -30,19 +30,19 @@ function contentScript() {
       return storage.get({[prop]: undefined});
     }).then(data => {
       browser.test.assertEq(value, data[prop], "object getter worked for " + prop);
     });
   }
 
   let globalChanges = {};
 
-  browser.storage.onChanged.addListener((aChanges, aStorage) => {
-    browser.test.assertEq("local", aStorage, "storage is local");
-    Object.assign(globalChanges, aChanges);
+  browser.storage.onChanged.addListener((changes, storage) => {
+    browser.test.assertEq("local", storage, "storage is local");
+    Object.assign(globalChanges, changes);
   });
 
   function checkChanges(changes) {
     function checkSub(obj1, obj2) {
       for (let prop in obj1) {
         browser.test.assertEq(obj1[prop].oldValue, obj2[prop].oldValue);
         browser.test.assertEq(obj1[prop].newValue, obj2[prop].newValue);
       }
--- a/toolkit/components/extensions/test/mochitest/test_ext_storage_tab.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_storage_tab.html
@@ -35,18 +35,18 @@ add_task(function* test_multiple_pages()
           setTimeout(resolve, 0);
         }
       });
     });
 
     let storage = browser.storage.local;
 
     browser.test.log("create");
-    browser.tabs.create({url: "tab.html"}).then(tabObj => {
-      tabId = tabObj.id;
+    browser.tabs.create({url: "tab.html"}).then(tab => {
+      tabId = tab.id;
 
       return tabReady;
     }).then(() => {
       return storage.get("key");
     }).then(result => {
       browser.test.assertEq(undefined, result.key, "Key should be undefined");
 
       return browser.runtime.sendMessage("tab-set-key");
--- a/toolkit/components/extensions/test/mochitest/test_ext_web_accessible_resources.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_web_accessible_resources.html
@@ -204,19 +204,19 @@ add_task(function* test_web_accessible_r
   function content() {
     window.addEventListener("message", function rcv(event) {
       browser.runtime.sendMessage("script-ran");
       window.removeEventListener("message", rcv, false);
     }, false);
 
     testImageLoading(browser.extension.getURL("image.png"), "loaded");
 
-    let testScriptElement = document.createElement("script");
-    testScriptElement.setAttribute("src", browser.extension.getURL("test_script.js"));
-    document.head.appendChild(testScriptElement);
+    let testScript = document.createElement("script");
+    testScript.setAttribute("src", browser.extension.getURL("test_script.js"));
+    document.head.appendChild(testScript);
     browser.runtime.sendMessage("script-loaded");
   }
 
   function testScript() {
     window.postMessage("test-script-loaded", "*");
   }
 
   let extension = ExtensionTestUtils.loadExtension({
@@ -296,19 +296,19 @@ add_task(function* test_web_accessible_r
 
     browser.test.sendMessage("background-ready");
   }
 
   function content() {
     testImageLoading("http://example.com/tests/toolkit/components/extensions/test/mochitest/file_image_bad.png", "blocked");
     testImageLoading(browser.extension.getURL("image.png"), "loaded");
 
-    let testScriptElement = document.createElement("script");
-    testScriptElement.setAttribute("src", browser.extension.getURL("test_script.js"));
-    document.head.appendChild(testScriptElement);
+    let testScript = document.createElement("script");
+    testScript.setAttribute("src", browser.extension.getURL("test_script.js"));
+    document.head.appendChild(testScript);
 
     window.addEventListener("message", event => {
       browser.runtime.sendMessage(event.data);
     });
   }
 
   function testScript() {
     window.postMessage("accessible-script-loaded", "*");
--- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html
@@ -41,18 +41,18 @@
 <input type="text" name="textInput" value="value2">
 </form>
 <script>
 "use strict";
 
 let files, testFile, blob, file, uploads;
 add_task(function* test_setup() {
   files = yield new Promise(resolve => {
-    SpecialPowers.createFiles([{name: "testFile.pdf", data: "Not really a PDF file :)", "type": "application/x-pdf"}], (result) => {
-      resolve(result);
+    SpecialPowers.createFiles([{name: "testFile.pdf", data: "Not really a PDF file :)", "type": "application/x-pdf"}], (files) => {
+      resolve(files);
     });
   });
   testFile = files[0];
   blob = {
     name: "blobAsFile",
     content: new Blob(["A blob sent as a file"], {type: "text/csv"}),
     fileName: "blobAsFile.csv",
   };
--- a/toolkit/components/passwordmgr/test/browser/browser_DOMFormHasPassword.js
+++ b/toolkit/components/passwordmgr/test/browser/browser_DOMFormHasPassword.js
@@ -1,16 +1,16 @@
 const ids = {
   INPUT_ID: "input1",
   FORM1_ID: "form1",
   FORM2_ID: "form2",
   CHANGE_INPUT_ID: "input2",
 };
 
-function task(contentIds) {
+function task(ids) {
   let resolve;
   let promise = new Promise(r => { resolve = r; });
 
   function unexpectedContentEvent(evt) {
     ok(false, "Received a " + evt.type + " event on content");
   }
 
   var gDoc = null;
@@ -26,50 +26,50 @@ function task(contentIds) {
     gDoc.addEventListener("DOMFormHasPassword", unexpectedContentEvent, false);
     gDoc.defaultView.setTimeout(test_inputAdd, 0);
   }
 
   function test_inputAdd() {
     addEventListener("DOMFormHasPassword", test_inputAddHandler, false);
     let input = gDoc.createElementNS("http://www.w3.org/1999/xhtml", "input");
     input.setAttribute("type", "password");
-    input.setAttribute("id", contentIds.INPUT_ID);
+    input.setAttribute("id", ids.INPUT_ID);
     input.setAttribute("data-test", "unique-attribute");
-    gDoc.getElementById(contentIds.FORM1_ID).appendChild(input);
+    gDoc.getElementById(ids.FORM1_ID).appendChild(input);
   }
 
   function test_inputAddHandler(evt) {
     removeEventListener(evt.type, test_inputAddHandler, false);
-    is(evt.target.id, contentIds.FORM1_ID,
+    is(evt.target.id, ids.FORM1_ID,
        evt.type + " event targets correct form element (added password element)");
     gDoc.defaultView.setTimeout(test_inputChangeForm, 0);
   }
 
   function test_inputChangeForm() {
     addEventListener("DOMFormHasPassword", test_inputChangeFormHandler, false);
-    let input = gDoc.getElementById(contentIds.INPUT_ID);
-    input.setAttribute("form", contentIds.FORM2_ID);
+    let input = gDoc.getElementById(ids.INPUT_ID);
+    input.setAttribute("form", ids.FORM2_ID);
   }
 
   function test_inputChangeFormHandler(evt) {
     removeEventListener(evt.type, test_inputChangeFormHandler, false);
-    is(evt.target.id, contentIds.FORM2_ID,
+    is(evt.target.id, ids.FORM2_ID,
        evt.type + " event targets correct form element (changed form)");
     gDoc.defaultView.setTimeout(test_inputChangesType, 0);
   }
 
   function test_inputChangesType() {
     addEventListener("DOMFormHasPassword", test_inputChangesTypeHandler, false);
-    let input = gDoc.getElementById(contentIds.CHANGE_INPUT_ID);
+    let input = gDoc.getElementById(ids.CHANGE_INPUT_ID);
     input.setAttribute("type", "password");
   }
 
   function test_inputChangesTypeHandler(evt) {
     removeEventListener(evt.type, test_inputChangesTypeHandler, false);
-    is(evt.target.id, contentIds.FORM1_ID,
+    is(evt.target.id, ids.FORM1_ID,
        evt.type + " event targets correct form element (changed type)");
     gDoc.defaultView.setTimeout(finish, 0);
   }
 
   function finish() {
     gDoc.removeEventListener("DOMFormHasPassword", unexpectedContentEvent, false);
     resolve();
   }
--- a/toolkit/components/passwordmgr/test/browser/browser_DOMInputPasswordAdded.js
+++ b/toolkit/components/passwordmgr/test/browser/browser_DOMInputPasswordAdded.js
@@ -3,17 +3,17 @@ const consts = {
 
   INPUT_ID: "input1",
   FORM1_ID: "form1",
   FORM2_ID: "form2",
   CHANGE_INPUT_ID: "input2",
   BODY_INPUT_ID: "input3",
 };
 
-function task(contentConsts) {
+function task(consts) {
   let resolve;
   let promise = new Promise(r => { resolve = r; });
 
   function unexpectedContentEvent(evt) {
     Assert.ok(false, "Received a " + evt.type + " event on content");
   }
 
   var gDoc = null;
@@ -25,57 +25,57 @@ function task(contentConsts) {
     gDoc = content.document;
     // These events shouldn't escape to content.
     gDoc.addEventListener("DOMInputPasswordAdded", unexpectedContentEvent, false);
     gDoc.defaultView.setTimeout(test_inputAdd, 0);
   }
 
   function test_inputAdd() {
     addEventListener("DOMInputPasswordAdded", test_inputAddHandler, false);
-    let input = gDoc.createElementNS(contentConsts.HTML_NS, "input");
+    let input = gDoc.createElementNS(consts.HTML_NS, "input");
     input.setAttribute("type", "password");
-    input.setAttribute("id", contentConsts.INPUT_ID);
+    input.setAttribute("id", consts.INPUT_ID);
     input.setAttribute("data-test", "unique-attribute");
-    gDoc.getElementById(contentConsts.FORM1_ID).appendChild(input);
+    gDoc.getElementById(consts.FORM1_ID).appendChild(input);
     info("Done appending the input element");
   }
 
   function test_inputAddHandler(evt) {
     removeEventListener(evt.type, test_inputAddHandler, false);
-    Assert.equal(evt.target.id, contentConsts.INPUT_ID,
+    Assert.equal(evt.target.id, consts.INPUT_ID,
       evt.type + " event targets correct input element (added password element)");
     gDoc.defaultView.setTimeout(test_inputAddOutsideForm, 0);
   }
 
   function test_inputAddOutsideForm() {
     addEventListener("DOMInputPasswordAdded", test_inputAddOutsideFormHandler, false);
-    let input = gDoc.createElementNS(contentConsts.HTML_NS, "input");
+    let input = gDoc.createElementNS(consts.HTML_NS, "input");
     input.setAttribute("type", "password");
-    input.setAttribute("id", contentConsts.BODY_INPUT_ID);
+    input.setAttribute("id", consts.BODY_INPUT_ID);
     input.setAttribute("data-test", "unique-attribute");
     gDoc.body.appendChild(input);
     info("Done appending the input element to the body");
   }
 
   function test_inputAddOutsideFormHandler(evt) {
     removeEventListener(evt.type, test_inputAddOutsideFormHandler, false);
-    Assert.equal(evt.target.id, contentConsts.BODY_INPUT_ID,
+    Assert.equal(evt.target.id, consts.BODY_INPUT_ID,
       evt.type + " event targets correct input element (added password element outside form)");
     gDoc.defaultView.setTimeout(test_inputChangesType, 0);
   }
 
   function test_inputChangesType() {
     addEventListener("DOMInputPasswordAdded", test_inputChangesTypeHandler, false);
-    let input = gDoc.getElementById(contentConsts.CHANGE_INPUT_ID);
+    let input = gDoc.getElementById(consts.CHANGE_INPUT_ID);
     input.setAttribute("type", "password");
   }
 
   function test_inputChangesTypeHandler(evt) {
     removeEventListener(evt.type, test_inputChangesTypeHandler, false);
-    Assert.equal(evt.target.id, contentConsts.CHANGE_INPUT_ID,
+    Assert.equal(evt.target.id, consts.CHANGE_INPUT_ID,
       evt.type + " event targets correct input element (changed type)");
     gDoc.defaultView.setTimeout(completeTest, 0);
   }
 
   function completeTest() {
     Assert.ok(true, "Test completed");
     gDoc.removeEventListener("DOMInputPasswordAdded", unexpectedContentEvent, false);
     resolve();
--- a/toolkit/components/passwordmgr/test/browser/browser_http_autofill.js
+++ b/toolkit/components/passwordmgr/test/browser/browser_http_autofill.js
@@ -18,60 +18,60 @@ add_task(function* setup() {
   yield SpecialPowers.pushPrefEnv({ "set": [["signon.autofillForms.http", false]] });
 });
 
 add_task(function* test_http_autofill() {
   for (let scheme of ["http", "https"]) {
     let tab = yield BrowserTestUtils
       .openNewForegroundTab(gBrowser, `${scheme}${TEST_URL_PATH}form_basic.html`);
 
-    let [username, password] = yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
+    let {username, password} = yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
       let doc = content.document;
-      let contentUsername = doc.getElementById("form-basic-username").value;
-      let contentPassword = doc.getElementById("form-basic-password").value;
-      return [contentUsername, contentPassword];
+      let username = doc.getElementById("form-basic-username").value;
+      let password = doc.getElementById("form-basic-password").value;
+      return { username, password };
     });
 
     is(username, scheme == "http" ? "" : "username", "Username filled correctly");
     is(password, scheme == "http" ? "" : "password", "Password filled correctly");
 
     gBrowser.removeTab(tab);
   }
 });
 
 add_task(function* test_iframe_in_http_autofill() {
   for (let scheme of ["http", "https"]) {
     let tab = yield BrowserTestUtils
       .openNewForegroundTab(gBrowser, `${scheme}${TEST_URL_PATH}form_basic_iframe.html`);
 
-    let [username, password] = yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
+    let {username, password} = yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
       let doc = content.document;
       let iframe = doc.getElementById("test-iframe");
-      let contentUsername = iframe.contentWindow.document.getElementById("form-basic-username").value;
-      let contentPassword = iframe.contentWindow.document.getElementById("form-basic-password").value;
-      return [contentUsername, contentPassword];
+      let username = iframe.contentWindow.document.getElementById("form-basic-username").value;
+      let password = iframe.contentWindow.document.getElementById("form-basic-password").value;
+      return { username, password };
     });
 
     is(username, scheme == "http" ? "" : "username", "Username filled correctly");
     is(password, scheme == "http" ? "" : "password", "Password filled correctly");
 
     gBrowser.removeTab(tab);
   }
 });
 
 add_task(function* test_http_action_autofill() {
   for (let type of ["insecure", "secure"]) {
     let tab = yield BrowserTestUtils
       .openNewForegroundTab(gBrowser, `https${TEST_URL_PATH}form_cross_origin_${type}_action.html`);
 
-    let [username, password] = yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
+    let {username, password} = yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
       let doc = content.document;
-      let contentUsername = doc.getElementById("form-basic-username").value;
-      let contentPassword = doc.getElementById("form-basic-password").value;
-      return [contentUsername, contentPassword];
+      let username = doc.getElementById("form-basic-username").value;
+      let password = doc.getElementById("form-basic-password").value;
+      return { username, password };
     });
 
     is(username, type == "insecure" ? "" : "username", "Username filled correctly");
     is(password, type == "insecure" ? "" : "password", "Password filled correctly");
 
     gBrowser.removeTab(tab);
   }
 });
--- a/toolkit/components/passwordmgr/test/browser/browser_insecurePasswordWarning.js
+++ b/toolkit/components/passwordmgr/test/browser/browser_insecurePasswordWarning.js
@@ -8,31 +8,31 @@ const WARNING_PATTERN = [{
 }, {
   key: "INSECURE_PAGE",
   msg: 'JavaScript Warning: "Password fields present on an insecure (http://) page. This is a security risk that allows user login credentials to be stolen."'
 }];
 
 add_task(function* testInsecurePasswordWarning() {
   let warningPatternHandler;
 
-  function messageHandler(msgObj) {
+  function messageHandler(msg) {
     function findWarningPattern(msg) {
       return WARNING_PATTERN.find(patternPair => {
         return msg.indexOf(patternPair.msg) !== -1;
       });
     }
 
-    let warning = findWarningPattern(msgObj.message);
+    let warning = findWarningPattern(msg.message);
 
     // Only handle the insecure password related warning messages.
     if (warning) {
       // Prevent any unexpected or redundant matched warning message coming after
       // the test case is ended.
       ok(warningPatternHandler, "Invoke a valid warning message handler");
-      warningPatternHandler(warning, msgObj.message);
+      warningPatternHandler(warning, msg.message);
     }
   }
   Services.console.registerListener(messageHandler);
   registerCleanupFunction(function() {
     Services.console.unregisterListener(messageHandler);
   });
 
   for (let [origin, testFile, expectWarnings] of [
--- a/toolkit/components/passwordmgr/test/browser/browser_notifications.js
+++ b/toolkit/components/passwordmgr/test/browser/browser_notifications.js
@@ -35,21 +35,21 @@ add_task(function* test_save_change() {
       url: "https://example.com/browser/toolkit/components/" +
            "passwordmgr/test/browser/form_basic.html",
     }, function* (browser) {
       // Submit the form in the content page with the credentials from the test
       // case. This will cause the doorhanger notification to be displayed.
       let promiseShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel,
                                                        "popupshown",
                                                        (event) => event.target == PopupNotifications.panel);
-      yield ContentTask.spawn(browser, [username, password],
-        function* ([contentUsername, contentPassword]) {
+      yield ContentTask.spawn(browser, { username, password },
+        function* ({ username, password }) {
           let doc = content.document;
-          doc.getElementById("form-basic-username").value = contentUsername;
-          doc.getElementById("form-basic-password").value = contentPassword;
+          doc.getElementById("form-basic-username").value = username;
+          doc.getElementById("form-basic-password").value = password;
           doc.getElementById("form-basic").submit();
         });
       yield promiseShown;
       let notificationElement = PopupNotifications.panel.childNodes[0];
       // Style flush to make sure binding is attached
       notificationElement.querySelector("#password-notification-password").clientTop;
 
       // Check the actual content of the popup notification.
--- a/toolkit/components/passwordmgr/test/browser/browser_notifications_password.js
+++ b/toolkit/components/passwordmgr/test/browser/browser_notifications_password.js
@@ -76,20 +76,20 @@ add_task(function* test_edit_password() 
            "passwordmgr/test/browser/form_basic.html",
     }, function* (browser) {
       // Submit the form in the content page with the credentials from the test
       // case. This will cause the doorhanger notification to be displayed.
       let promiseShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel,
                                                        "popupshown",
                                                        (event) => event.target == PopupNotifications.panel);
       yield ContentTask.spawn(browser, testCase,
-        function* (contentTestCase) {
+        function* (testCase) {
           let doc = content.document;
-          doc.getElementById("form-basic-username").value = contentTestCase.usernameInPage;
-          doc.getElementById("form-basic-password").value = contentTestCase.passwordInPage;
+          doc.getElementById("form-basic-username").value = testCase.usernameInPage;
+          doc.getElementById("form-basic-password").value = testCase.passwordInPage;
           doc.getElementById("form-basic").submit();
         });
       yield promiseShown;
       let notificationElement = PopupNotifications.panel.childNodes[0];
       // Style flush to make sure binding is attached
       notificationElement.querySelector("#password-notification-password").clientTop;
 
       // Modify the username in the dialog if requested.
--- a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_sort.js
+++ b/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_sort.js
@@ -73,20 +73,20 @@ function test() {
             let showMode = (toggleCalls++ % 2) == 0;
 
             // only watch for a confirmation dialog every other time being called
             if (showMode) {
                 Services.ww.registerNotification(function (aSubject, aTopic, aData) {
                     if (aTopic == "domwindowclosed")
                         Services.ww.unregisterNotification(arguments.callee);
                     else if (aTopic == "domwindowopened") {
-                        let targetWin = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
+                        let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
                         SimpleTest.waitForFocus(function() {
-                            EventUtils.sendKey("RETURN", targetWin);
-                        }, targetWin);
+                            EventUtils.sendKey("RETURN", win);
+                        }, win);
                     }
                 });
             }
 
             Services.obs.addObserver(function (aSubject, aTopic, aData) {
                 if (aTopic == "passwordmgr-password-toggle-complete") {
                     Services.obs.removeObserver(arguments.callee, aTopic);
                     func();
--- a/toolkit/components/passwordmgr/test/browser/browser_passwordmgrdlg.js
+++ b/toolkit/components/passwordmgr/test/browser/browser_passwordmgrdlg.js
@@ -84,20 +84,20 @@ function test() {
             let showMode = (toggleCalls++ % 2) == 0;
 
             // only watch for a confirmation dialog every other time being called
             if (showMode) {
                 Services.ww.registerNotification(function (aSubject, aTopic, aData) {
                     if (aTopic == "domwindowclosed")
                         Services.ww.unregisterNotification(arguments.callee);
                     else if (aTopic == "domwindowopened") {
-                        let targetWin = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
+                        let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
                         SimpleTest.waitForFocus(function() {
-                            EventUtils.sendKey("RETURN", targetWin);
-                        }, targetWin);
+                            EventUtils.sendKey("RETURN", win);
+                        }, win);
                     }
                 });
             }
 
             Services.obs.addObserver(function (aSubject, aTopic, aData) {
                 if (aTopic == "passwordmgr-password-toggle-complete") {
                     Services.obs.removeObserver(arguments.callee, aTopic);
                     func();
@@ -110,34 +110,34 @@ function test() {
         function runTests(mode, endFunction) {
             let testCounter = 0;
 
             function setFilter(string) {
                 filter.value = string;
                 filter.doCommand();
             }
 
-            function runOneTest(testCase) {
+            function runOneTest(test) {
                 function tester() {
-                    is(view.rowCount, expected, expected + " logins should match '" + testCase.filter + "'");
+                    is(view.rowCount, expected, expected + " logins should match '" + test.filter + "'");
                 }
 
                 let expected;
                 switch (mode) {
                 case 1: // without showing passwords
-                    expected = testCase.count;
+                    expected = test.count;
                     break;
                 case 2: // showing passwords
-                    expected = ("count2" in testCase) ? testCase.count2 : testCase.count;
+                    expected = ("count2" in test) ? test.count2 : test.count;
                     break;
                 case 3: // toggle
-                    expected = testCase.count;
+                    expected = test.count;
                     tester();
                     toggleShowPasswords(function () {
-                        expected = ("count2" in testCase) ? testCase.count2 : testCase.count;
+                        expected = ("count2" in test) ? test.count2 : test.count;
                         tester();
                         toggleShowPasswords(proceed);
                     });
                     return;
                 }
                 tester();
                 proceed();
             }
@@ -146,19 +146,19 @@ function test() {
                 // run the next test if necessary or proceed with the tests
                 if (testCounter != tests.length)
                     runNextTest();
                 else
                     endFunction();
             }
 
             function runNextTest() {
-                let testCase = tests[testCounter++];
-                setFilter(testCase.filter);
-                setTimeout(runOneTest, 0, testCase);
+                let test = tests[testCounter++];
+                setFilter(test.filter);
+                setTimeout(runOneTest, 0, test);
             }
 
             runNextTest();
         }
 
         function step1() {
             runTests(1, step2);
         }
--- a/toolkit/components/passwordmgr/test/browser/head.js
+++ b/toolkit/components/passwordmgr/test/browser/head.js
@@ -6,17 +6,17 @@ Cu.import("resource://testing-common/Con
 registerCleanupFunction(function* cleanup_removeAllLoginsAndResetRecipes() {
   Services.logins.removeAllLogins();
 
   let recipeParent = LoginTestUtils.recipes.getRecipeParent();
   if (!recipeParent) {
     // No need to reset the recipes if the recipe module wasn't even loaded.
     return;
   }
-  yield recipeParent.then(recipeParentResult => recipeParentResult.reset());
+  yield recipeParent.then(recipeParent => recipeParent.reset());
 });
 
 /**
  * Loads a test page in `DIRECTORY_URL` which automatically submits to formsubmit.sjs and returns a
  * promise resolving with the field values when the optional `aTaskFn` is done.
  *
  * @param {String} aPageFile - test page file name which auto-submits to formsubmit.sjs
  * @param {Function} aTaskFn - task which can be run before the tab closes.
--- a/toolkit/components/passwordmgr/test/chrome/test_privbrowsing_perwindowpb.html
+++ b/toolkit/components/passwordmgr/test/chrome/test_privbrowsing_perwindowpb.html
@@ -199,19 +199,19 @@ var mainWindow = window.QueryInterface(C
                     .QueryInterface(Ci.nsIDocShellTreeItem)
                     .rootTreeItem
                     .QueryInterface(Ci.nsIInterfaceRequestor)
                     .getInterface(Ci.nsIDOMWindow);
 var contentPage = "http://mochi.test:8888/chrome/toolkit/components/passwordmgr/test/chrome/privbrowsing_perwindowpb_iframe.html";
 var testWindows = [];
 
 function whenDelayedStartupFinished(aWindow, aCallback) {
-  Services.obs.addObserver(function obs(aSubject, aTopic) {
+  Services.obs.addObserver(function observer(aSubject, aTopic) {
     if (aWindow == aSubject) {
-      Services.obs.removeObserver(obs, aTopic);
+      Services.obs.removeObserver(observer, aTopic);
       setTimeout(aCallback, 0);
     }
   }, "browser-delayed-startup-finished", false);
 }
 
 function testOnWindow(aIsPrivate, aCallback) {
   var win = mainWindow.OpenBrowserWindow({private: aIsPrivate});
   win.addEventListener("load", function onLoad() {
--- a/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html
+++ b/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html
@@ -59,67 +59,67 @@
       mm.addMessageListener("prepareForNextTestDone", function prepared(msg) {
         mm.removeMessageListener("prepareForNextTestDone", prepared);
         if (pendingTests.length > 0) {
           ({expectedDialogs: gExpectedDialogs,
             test: gCurrentTest} = pendingTests.shift());
           gCurrentTest.call(this);
         } else {
           mm.sendAsyncMessage("cleanup");
-          mm.addMessageListener("cleanupDone", () => {
+          mm.addMessageListener("cleanupDone", msg => {
             // mm.destroy() is called as a cleanup function by runInParent(), no
             // need to do it here.
             SimpleTest.finish();
           });
         }
       });
     }
 
     var pendingTests = [{expectedDialogs: 2, test: testNonAnonymousCredentials},
                         {expectedDialogs: 1, test: testAnonymousCredentials},
                         {expectedDialogs: 0, test: testAnonymousNoAuth}];
 
     let mm = runInParent(() => {
-      const { classes: parentCc, interfaces: parentCi, utils: parentCu } = Components;
+      const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
-      parentCu.import("resource://gre/modules/Services.jsm");
-      parentCu.import("resource://gre/modules/NetUtil.jsm");
-      parentCu.import("resource://gre/modules/Timer.jsm");
-      parentCu.import("resource://gre/modules/XPCOMUtils.jsm");
+      Cu.import("resource://gre/modules/Services.jsm");
+      Cu.import("resource://gre/modules/NetUtil.jsm");
+      Cu.import("resource://gre/modules/Timer.jsm");
+      Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
       let channel = NetUtil.newChannel({
         uri: "http://example.com",
         loadUsingSystemPrincipal: true
       });
 
-      let pps = parentCc["@mozilla.org/network/protocol-proxy-service;1"].
-                getService(parentCi.nsIProtocolProxyService);
+      let pps = Cc["@mozilla.org/network/protocol-proxy-service;1"].
+                getService(Ci.nsIProtocolProxyService);
       pps.asyncResolve(channel, 0, {
         onProxyAvailable(req, uri, pi, status) {
           let mozproxy = "moz-proxy://" + pi.host + ":" + pi.port;
-          let login = parentCc["@mozilla.org/login-manager/loginInfo;1"].
-                      createInstance(parentCi.nsILoginInfo);
+          let login = Cc["@mozilla.org/login-manager/loginInfo;1"].
+                      createInstance(Ci.nsILoginInfo);
           login.init(mozproxy, null, "proxy_realm", "proxy_user", "proxy_pass",
                      "", "");
           Services.logins.addLogin(login);
 
-          let login2 = parentCc["@mozilla.org/login-manager/loginInfo;1"].
-                       createInstance(parentCi.nsILoginInfo);
+          let login2 = Cc["@mozilla.org/login-manager/loginInfo;1"].
+                       createInstance(Ci.nsILoginInfo);
           login2.init("http://mochi.test:8888", null, "mochirealm", "user1name",
                        "user1pass", "", "");
           Services.logins.addLogin(login2);
 
           sendAsyncMessage("setupDone");
         },
-        QueryInterface: XPCOMUtils.generateQI([parentCi.nsIProtocolProxyCallback]),
+        QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolProxyCallback]),
       });
 
       addMessageListener("prepareForNextTest", message => {
-        parentCc["@mozilla.org/network/http-auth-manager;1"].
-          getService(parentCi.nsIHttpAuthManager).
+        Cc["@mozilla.org/network/http-auth-manager;1"].
+          getService(Ci.nsIHttpAuthManager).
           clearAll();
         sendAsyncMessage("prepareForNextTestDone");
       });
 
       let dialogObserverTopic = "common-dialog-loaded";
 
       function dialogObserver(subj, topic, data) {
         subj.Dialog.ui.prompt.document.documentElement.acceptDialog();
--- a/toolkit/components/passwordmgr/test/mochitest/test_prompt_http.html
+++ b/toolkit/components/passwordmgr/test/mochitest/test_prompt_http.html
@@ -13,16 +13,17 @@
 <p id="display"></p>
 
 <div id="content" style="display: none">
   <iframe id="iframe"></iframe>
 </div>
 
 <pre id="test">
 <script class="testbody" type="text/javascript">
+var state, action;
 var iframe = document.getElementById("iframe");
 
 // Force parent to not look for tab-modal prompts, as they're not used for auth prompts.
 isTabModal = false;
 
 const AUTHENTICATE_PATH = new URL("authenticate.sjs", window.location.href).pathname;
 
 let chromeScript = runInParent(SimpleTest.getTestFileURL("pwmgr_common.js"));
@@ -74,32 +75,32 @@ runInParent(() => {
   pwmgr.addLogin(login4);
   pwmgr.addLogin(httpUpgradeLogin);
   pwmgr.addLogin(httpsDowngradeLogin);
   pwmgr.addLogin(dedupeHttpUpgradeLogin);
   pwmgr.addLogin(dedupeHttpsUpgradeLogin);
 });
 
 add_task(function* test_iframe() {
-  let state = {
+  state = {
     msg         : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest”",
     title       : "Authentication Required",
     textValue   : "mochiuser1",
     passValue   : "mochipass1",
     iconClass   : "authentication-icon question-icon",
     titleHidden : true,
     textHidden  : false,
     passHidden  : false,
     checkHidden : true,
     checkMsg    : "",
     checked     : false,
     focused     : "textField",
     defButton   : "button0",
   };
-  let action = {
+  action = {
     buttonClick : "ok",
   };
   promptDone = handlePrompt(state, action);
 
   // The following tests are driven by iframe loads
 
   var iframeLoaded = onloadPromiseFor("iframe");
   iframe.src = "authenticate.sjs?user=mochiuser1&pass=mochipass1";
--- a/toolkit/components/passwordmgr/test/mochitest/test_prompt_noWindow.html
+++ b/toolkit/components/passwordmgr/test/mochitest/test_prompt_noWindow.html
@@ -53,20 +53,20 @@ add_task(function* test_sandbox_xhr() {
   let action = {
     buttonClick : "ok",
   };
   let promptDone = handlePrompt(state, action);
 
   let url = new URL("authenticate.sjs?user=mochiuser1&pass=mochipass1", window.location.href);
   let sandboxConstructor = SpecialPowers.Cu.Sandbox;
   let sandbox = new sandboxConstructor(this, {wantXrays: true});
-  function sandboxedRequest(sandboxedUrl) {
+  function sandboxedRequest(url) {
     let req = SpecialPowers.Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
                            .createInstance(SpecialPowers.Ci.nsIXMLHttpRequest);
-    req.open("GET", sandboxedUrl, true);
+    req.open("GET", url, true);
     req.send(null);
   }
 
   let loginModifiedPromise = promiseStorageChanged(["modifyLogin"]);
   sandbox.sandboxedRequest = sandboxedRequest(url);
   info("send the XHR request in the sandbox");
   SpecialPowers.Cu.evalInSandbox("sandboxedRequest;", sandbox);
 
--- a/toolkit/components/passwordmgr/test/pwmgr_common.js
+++ b/toolkit/components/passwordmgr/test/pwmgr_common.js
@@ -183,18 +183,18 @@ function registerRunTests() {
 
     var observer = SpecialPowers.wrapCallback(function(subject, topic, data) {
       var formLikeRoot = subject.QueryInterface(SpecialPowers.Ci.nsIDOMNode);
       if (formLikeRoot.id !== 'observerforcer')
         return;
       SpecialPowers.removeObserver(observer, "passwordmgr-processed-form");
       formLikeRoot.remove();
       SimpleTest.executeSoon(() => {
-        var runTestEvent = new Event("runTests");
-        window.dispatchEvent(runTestEvent);
+        var event = new Event("runTests");
+        window.dispatchEvent(event);
       });
     });
     SpecialPowers.addObserver(observer, "passwordmgr-processed-form", false);
 
     document.body.appendChild(form);
   });
 }
 
@@ -396,23 +396,24 @@ if (this.addMessageListener) {
     // Force LoginManagerParent to init for the tests since it's normally delayed
     // by apps such as on Android.
     LoginManagerParent.init();
 
     commonInit(selfFilling);
     sendAsyncMessage("doneSetup");
   });
 
-  addMessageListener("loadRecipes", Task.async(function*(recipes) {
+  addMessageListener("loadRecipes", Task.async(function* loadRecipes(recipes) {
+
     var recipeParent = yield LoginManagerParent.recipeParentPromise;
     yield recipeParent.load(recipes);
     sendAsyncMessage("loadedRecipes", recipes);
   }));
 
-  addMessageListener("resetRecipes", Task.async(function*() {
+  addMessageListener("resetRecipes", Task.async(function* resetRecipes() {
     let recipeParent = yield LoginManagerParent.recipeParentPromise;
     yield recipeParent.reset();
     sendAsyncMessage("recipesReset");
   }));
 
   addMessageListener("proxyLoginManager", msg => {
     // Recreate nsILoginInfo objects from vanilla JS objects.
     let recreatedArgs = msg.args.map((arg, index) => {
--- a/toolkit/components/passwordmgr/test/test_master_password.html
+++ b/toolkit/components/passwordmgr/test/test_master_password.html
@@ -68,25 +68,25 @@ addEventListener("message", () => {
 /*
  * handleDialog
  *
  * Invoked a short period of time after calling startCallbackTimer(), and
  * allows testing the actual auth dialog while it's being displayed. Tests
  * should call startCallbackTimer() each time the auth dialog is expected (the
  * timer is a one-shot).
  */
-function handleDialog(doc, testNumber) {
-  ok(true, "handleDialog running for test " + testNumber);
+function handleDialog(doc, testNum) {
+  ok(true, "handleDialog running for test " + testNum);
 
   var clickOK   = true;
   var doNothing = false;
   var passfield = doc.getElementById("password1Textbox");
   var dialog    = doc.getElementById("commonDialog");
 
-    switch (testNumber) {
+    switch (testNum) {
       case 1:
         is(passfield.getAttribute("value"), "", "Checking empty prompt");
         passfield.setAttribute("value", masterPassword);
         is(passfield.getAttribute("value"), masterPassword, "Checking filled prompt");
         break;
 
       case 2:
         clickOK = false;
@@ -102,33 +102,33 @@ function handleDialog(doc, testNumber) {
         break;
 
       case 5:
         is(passfield.getAttribute("value"), "", "Checking empty prompt");
         passfield.setAttribute("value", masterPassword);
         break;
 
       default:
-        ok(false, "Uhh, unhandled switch for testNum #" + testNumber);
+        ok(false, "Uhh, unhandled switch for testNum #" + testNum);
         break;
     }
 
     didDialog = true;
 
     if (!doNothing) {
         SpecialPowers.addObserver(outerWindowObserver, "outer-window-destroyed", false);
         if (clickOK)
             dialog.acceptDialog();
         else
             dialog.cancelDialog();
     }
 
-    ok(true, "handleDialog done for test " + testNumber);
+    ok(true, "handleDialog done for test " + testNum);
 
-    if (testNumber == 4)
+    if (testNum == 4)
         checkTest4A();
 }
 
 var outerWindowObserver = {
   observe: function(id) {
     SpecialPowers.removeObserver(outerWindowObserver, "outer-window-destroyed");
     var func;
     if (testNum == 1)
--- a/toolkit/components/passwordmgr/test/test_prompt_async.html
+++ b/toolkit/components/passwordmgr/test/test_prompt_async.html
@@ -184,31 +184,31 @@
                 doCheck(testNum);
                 monitor.reset();
 
                 testNum++;
                 doTest(testNum);
             }
         }
 
-        function doTest(testNumber)
+        function doTest(testNum)
         {
             /*
              * These contentDocument variables are located here,
              * rather than in the global scope, because SpecialPowers threw
              * errors (complaining that the objects were deleted)
              * when these were in the global scope.
              */
             var iframe1Doc = SpecialPowers.wrap(iframe1).contentDocument;
             var iframe2aDoc = SpecialPowers.wrap(iframe2a).contentDocument;
             var iframe2bDoc = SpecialPowers.wrap(iframe2b).contentDocument;
             var exampleCom = "http://example.com/tests/toolkit/components/passwordmgr/test/";
             var exampleOrg = "http://example.org/tests/toolkit/components/passwordmgr/test/";
 
-            switch (testNumber)
+            switch (testNum)
             {
             case 1:
                 // Load through a single proxy with authentication required 3 different
                 // pages, first with one login, other two with their own different login.
                 // We expect to show just a single dialog for proxy authentication and
                 // then two dialogs to authenticate to login 1 and then login 2.
                 ok(true, "doTest testNum 1");
                 expectedLoads = 3;
@@ -351,21 +351,21 @@
             case 9:
                 finishTest();
                 return;
             }
 
             startCallbackTimer();
         }
 
-        function handleDialog(doc, testNumber)
+        function handleDialog(doc, testNum)
         {
             var dialog        = doc.getElementById("commonDialog");
 
-            switch (testNumber)
+            switch (testNum)
             {
                 case 1:
                 case 2:
                     dialog.acceptDialog();
                     break;
 
                 case 3:
                     dialog.cancelDialog();
@@ -398,32 +398,32 @@
                 case 8:
                     if (expectedDialogs == 3 || expectedDialogs == 1)
                         dialog.acceptDialog();
                     else
                         dialog.cancelDialog();
                     break;
 
                 default:
-                    ok(false, "Unhandled testNum " + testNumber + " in handleDialog");
+                    ok(false, "Unhandled testNum " + testNum + " in handleDialog");
             }
 
             if (--expectedDialogs > 0)
                 startCallbackTimer();
         }
 
-        function doCheck(testNumber)
+        function doCheck(testNum)
         {
             var iframe1Doc = SpecialPowers.wrap(iframe1).contentDocument;
             var iframe2aDoc = SpecialPowers.wrap(iframe2a).contentDocument;
             var iframe2bDoc = SpecialPowers.wrap(iframe2b).contentDocument;
             var authok1;
             var proxyok1;
             var footnote;
-            switch (testNumber)
+            switch (testNum)
             {
                 case 1:
                     ok(true, "doCheck testNum 1");
                     is(monitor.windowsRegistered, 3, "Registered 3 open dialogs");
 
                     authok1 = iframe1Doc.getElementById("ok").textContent;
                     proxyok1 = iframe1Doc.getElementById("proxy").textContent;
 
@@ -521,17 +521,17 @@
 
                     is(authok1, "PASS", "WWW Authorization OK, frame1");
                     is(proxyok1, "PASS", "Proxy Authorization OK, frame1");
                     is(footnote, "This is a footnote after the huge content fill",
                         "Footnote present and loaded completely");
                     break;
 
                 default:
-                    ok(false, "Unhandled testNum " + testNumber + " in doCheck");
+                    ok(false, "Unhandled testNum " + testNum + " in doCheck");
             }
         }
 
     </script>
 </head>
 <body>
     <iframe id="iframe1"></iframe>
     <iframe id="iframe2a"></iframe>
--- a/toolkit/components/passwordmgr/test/unit/test_context_menu.js
+++ b/toolkit/components/passwordmgr/test/unit/test_context_menu.js
@@ -84,20 +84,20 @@ function createLoginsFragment(url, conte
   };
 }
 
 /**
  * Check if every login have it's corresponding menuitem.
  * Duplicates and empty usernames have a date appended.
  */
 function checkLoginItems(logins, items) {
-  function findDuplicates(unfilteredLoginList) {
+  function findDuplicates(loginList) {
     var seen = new Set();
     var duplicates = new Set();
-    for (let login of unfilteredLoginList) {
+    for (let login of loginList) {
       if (seen.has(login.username)) {
         duplicates.add(login.username);
       }
       seen.add(login.username);
     }
     return duplicates;
   }
   let duplicates = findDuplicates(logins);
--- a/toolkit/components/places/tests/bookmarks/test_bookmarks.js
+++ b/toolkit/components/places/tests/bookmarks/test_bookmarks.js
@@ -180,17 +180,17 @@ add_task(function* test_bookmarks() {
   let title = bs.getItemTitle(newId);
   do_check_eq(title, "Google");
 
   // test getItemType for bookmarks
   do_check_eq(bs.getItemType(newId), bs.TYPE_BOOKMARK);
 
   // get item title bad input
   try {
-    bs.getItemTitle(-3);
+    let title = bs.getItemTitle(-3);
     do_throw("getItemTitle accepted bad input");
   } catch (ex) {}
 
   // get the folder that the bookmark is in
   let folderId = bs.getFolderIdForItem(newId);
   do_check_eq(folderId, testRoot);
 
   // test getItemIndex for bookmarks
@@ -365,18 +365,18 @@ add_task(function* test_bookmarks() {
   } catch (ex) {
     do_throw("removeFolderChildren(): " + ex);
   }
 
   // XXX - test folderReadOnly
 
   // test bookmark id in query output
   try {
-    options = hs.getNewQueryOptions();
-    query = hs.getNewQuery();
+    let options = hs.getNewQueryOptions();
+    let query = hs.getNewQuery();
     query.setFolders([testRoot], 1);
     let result = hs.executeQuery(query, options);
     let rootNode = result.root;
     rootNode.containerOpen = true;
     let cc = rootNode.childCount;
     do_print("bookmark itemId test: CC = " + cc);
     do_check_true(cc > 0);
     for (let i=0; i < cc; ++i) {
@@ -404,18 +404,18 @@ add_task(function* test_bookmarks() {
     let mURI = uri("http://multiple.uris.in.query");
 
     let testFolder = bs.createFolder(testRoot, "test Folder", bs.DEFAULT_INDEX);
     // add 2 bookmarks
     bs.insertBookmark(testFolder, mURI, bs.DEFAULT_INDEX, "title 1");
     bs.insertBookmark(testFolder, mURI, bs.DEFAULT_INDEX, "title 2");
 
     // query
-    options = hs.getNewQueryOptions();
-    query = hs.getNewQuery();
+    let options = hs.getNewQueryOptions();
+    let query = hs.getNewQuery();
     query.setFolders([testFolder], 1);
     let result = hs.executeQuery(query, options);
     let rootNode = result.root;
     rootNode.containerOpen = true;
     let cc = rootNode.childCount;
     do_check_eq(cc, 2);
     do_check_eq(rootNode.getChild(0).title, "title 1");
     do_check_eq(rootNode.getChild(1).title, "title 2");
@@ -494,20 +494,20 @@ add_task(function* test_bookmarks() {
   anno.setItemAnnotation(newId3, "test-annotation", "foo", 0, 0);
   do_check_eq(bookmarksObserver._itemChangedId, newId3);
   do_check_eq(bookmarksObserver._itemChangedProperty, "test-annotation");
   do_check_true(bookmarksObserver._itemChanged_isAnnotationProperty);
   do_check_eq(bookmarksObserver._itemChangedValue, "");
 
   // test search on bookmark title ZZZXXXYYY
   try {
-    options = hs.getNewQueryOptions();
+    let options = hs.getNewQueryOptions();
     options.excludeQueries = 1;
     options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
-    query = hs.getNewQuery();
+    let query = hs.getNewQuery();
     query.searchTerms = "ZZZXXXYYY";
     let result = hs.executeQuery(query, options);
     let rootNode = result.root;
     rootNode.containerOpen = true;
     let cc = rootNode.childCount;
     do_check_eq(cc, 1);
     let node = rootNode.getChild(0);
     do_check_eq(node.title, "ZZZXXXYYY");
@@ -516,20 +516,20 @@ add_task(function* test_bookmarks() {
   }
   catch (ex) {
     do_throw("bookmarks query: " + ex);
   }
 
   // test dateAdded and lastModified properties
   // for a search query
   try {
-    options = hs.getNewQueryOptions();
+    let options = hs.getNewQueryOptions();
     options.excludeQueries = 1;
     options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
-    query = hs.getNewQuery();
+    let query = hs.getNewQuery();
     query.searchTerms = "ZZZXXXYYY";
     let result = hs.executeQuery(query, options);
     let rootNode = result.root;
     rootNode.containerOpen = true;
     let cc = rootNode.childCount;
     do_check_eq(cc, 1);
     let node = rootNode.getChild(0);
 
@@ -543,18 +543,18 @@ add_task(function* test_bookmarks() {
   }
   catch (ex) {
     do_throw("bookmarks query: " + ex);
   }
 
   // test dateAdded and lastModified properties
   // for a folder query
   try {
-    options = hs.getNewQueryOptions();
-    query = hs.getNewQuery();
+    let options = hs.getNewQueryOptions();
+    let query = hs.getNewQuery();
     query.setFolders([testRoot], 1);
     let result = hs.executeQuery(query, options);
     let rootNode = result.root;
     rootNode.containerOpen = true;
     let cc = rootNode.childCount;
     do_check_true(cc > 0);
     for (let i = 0; i < cc; i++) {
       let node = rootNode.getChild(i);
--- a/toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage.js
+++ b/toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage.js
@@ -131,22 +131,22 @@ function test() {
     // we can set the preference back to true immediately.  We don't clear the
     // preference because not all products enable Places by default.
     aWindow.Services.prefs.setBoolPref("places.history.enabled", true);
   }
 
   getIconFile(function () {
     testOnWindow({}, function(aWin) {
       testNormal(aWin, function () {
-        testOnWindow({}, function(aWin2) {
-          testAboutURIBookmarked(aWin2, function () {
-            testOnWindow({private: true}, function(aWin3) {
-              testPrivateBrowsingBookmarked(aWin3, function () {
-                testOnWindow({}, function(aWin4) {
-                  testDisabledHistoryBookmarked(aWin4, finish);
+        testOnWindow({}, function(aWin) {
+          testAboutURIBookmarked(aWin, function () {
+            testOnWindow({private: true}, function(aWin) {
+              testPrivateBrowsingBookmarked(aWin, function () {
+                testOnWindow({}, function(aWin) {
+                  testDisabledHistoryBookmarked(aWin, finish);
                 });
               });
             });
           });
         });
       });
     });
   });
--- a/toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage_failures.js
+++ b/toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage_failures.js
@@ -17,16 +17,17 @@ function test() {
   let favIcon16URI = NetUtil.newURI(favIcon16Location);
   let favIcon32URI = NetUtil.newURI(favIcon32Location);
   let lastPageURI = NetUtil.newURI("http://example.com/verification");
   // This error icon must stay in sync with FAVICON_ERRORPAGE_URL in
   // nsIFaviconService.idl, aboutCertError.xhtml and netError.xhtml.
   let favIconErrorPageURI =
     NetUtil.newURI("chrome://global/skin/icons/warning-16.png");
   let favIconsResultCount = 0;
+  let pageURI;
 
   function testOnWindow(aOptions, aCallback) {
     whenNewWindowLoaded(aOptions, function(aWin) {
       windowsToClose.push(aWin);
       executeSoon(() => aCallback(aWin));
     });
   }
 
@@ -222,30 +223,30 @@ function test() {
           aWindow.PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE, null,
           Services.scriptSecurityManager.getSystemPrincipal());
     });
   }
 
   checkFavIconsDBCount(function () {
     testOnWindow({}, function(aWin) {
       testNullPageURI(aWin, function () {
-        testOnWindow({}, function(aWin2) {
-          testNullFavIconURI(aWin2, function() {
-            testOnWindow({}, function(aWin3) {
-              testAboutURI(aWin3, function() {
-                testOnWindow({private: true}, function(aWin4) {
-                  testPrivateBrowsingNonBookmarkedURI(aWin4, function () {
-                    testOnWindow({}, function(aWin5) {
-                      testDisabledHistory(aWin5, function () {
-                        testOnWindow({}, function(aWin6) {
-                          testErrorIcon(aWin6, function() {
-                            testOnWindow({}, function(aWin7) {
-                              testNonExistingPage(aWin7, function() {
-                                testOnWindow({}, function(aWin8) {
-                                  testFinalVerification(aWin8, function() {
+        testOnWindow({}, function(aWin) {
+          testNullFavIconURI(aWin, function() {
+            testOnWindow({}, function(aWin) {
+              testAboutURI(aWin, function() {
+                testOnWindow({private: true}, function(aWin) {
+                  testPrivateBrowsingNonBookmarkedURI(aWin, function () {
+                    testOnWindow({}, function(aWin) {
+                      testDisabledHistory(aWin, function () {
+                        testOnWindow({}, function(aWin) {
+                          testErrorIcon(aWin, function() {
+                            testOnWindow({}, function(aWin) {
+                              testNonExistingPage(aWin, function() {
+                                testOnWindow({}, function(aWin) {
+                                  testFinalVerification(aWin, function() {
                                     finish();
                                   });
                                 });
                               });
                             });
                           });
                         });
                       });
--- a/toolkit/components/places/tests/browser/browser_redirect.js
+++ b/toolkit/components/places/tests/browser/browser_redirect.js
@@ -25,21 +25,21 @@ add_task(function* () {
         ok(this._redirectNotified, "The redirect should have been notified");
 
         fieldForUrl(REDIRECT_URI, "frecency", function (aFrecency) {
           ok(aFrecency != 0, "Frecency or the redirecting page should not be 0");
 
           fieldForUrl(REDIRECT_URI, "hidden", function (aHidden) {
             is(aHidden, 1, "The redirecting page should be hidden");
 
-            fieldForUrl(TARGET_URI, "frecency", function (aFrecency2) {
-              ok(aFrecency2 != 0, "Frecency of the target page should not be 0");
+            fieldForUrl(TARGET_URI, "frecency", function (aFrecency) {
+              ok(aFrecency != 0, "Frecency of the target page should not be 0");
 
-              fieldForUrl(TARGET_URI, "hidden", function (aHidden2) {
-                is(aHidden2, 0, "The target page should not be hidden");
+              fieldForUrl(TARGET_URI, "hidden", function (aHidden) {
+                is(aHidden, 0, "The target page should not be hidden");
                 resolve();
               });
             });
           });
         });
       },
       onBeginUpdateBatch: function () {},
       onEndUpdateBatch: function () {},
--- a/toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js
+++ b/toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js
@@ -59,16 +59,16 @@ function test() {
       aWin.close();
     });
   });
 
   // test first when on private mode
   testOnWindow({private: true}, function(aWin) {
     doTest(true, aWin, initialURL, function() {
       // then test when not on private mode
-      testOnWindow({}, function(aWin2) {
-        doTest(false, aWin2, finalURL, function () {
+      testOnWindow({}, function(aWin) {
+        doTest(false, aWin, finalURL, function () {
           PlacesTestUtils.clearHistory().then(finish);
         });
       });
     });
   });
 }
--- a/toolkit/components/places/tests/browser/head.js
+++ b/toolkit/components/places/tests/browser/head.js
@@ -283,17 +283,17 @@ function whenNewWindowLoaded(aOptions, a
  * @param aURI The URI.
  * @param aExpectedValue The expected value.
  * @return {Promise}
  * @resolves When the check has been added successfully.
  * @rejects JavaScript exception.
  */
 function promiseIsURIVisited(aURI, aExpectedValue) {
   return new Promise(resolve => {
-    PlacesUtils.asyncHistory.isURIVisited(aURI, function(unused, aIsVisited) {
+    PlacesUtils.asyncHistory.isURIVisited(aURI, function(aURI, aIsVisited) {
       resolve(aIsVisited);
     });
   });
 }
 
 function waitForCondition(condition, nextTest, errorMsg) {
   let tries = 0;
   let interval = setInterval(function() {
--- a/toolkit/components/places/tests/expiration/test_annos_expire_policy.js
+++ b/toolkit/components/places/tests/expiration/test_annos_expire_policy.js
@@ -77,17 +77,17 @@ function run_test() {
 
 add_task(function* test_annos_expire_policy() {
   // Set interval to a large value so we don't expire on it.
   setInterval(3600); // 1h
 
   // Expire all expirable pages.
   setMaxPages(0);
 
-  now = getExpirablePRTime();
+  let now = getExpirablePRTime();
   // Add some bookmarked page and timed annotations for each.
   for (let i = 0; i < 5; i++) {
     let pageURI = uri("http://item_anno." + i + ".mozilla.org/");
     yield PlacesTestUtils.addVisits({ uri: pageURI, visitDate: now++ });
     let bm = yield PlacesUtils.bookmarks.insert({
       parentGuid: PlacesUtils.bookmarks.unfiledGuid,
       url: pageURI,
       title: null
--- a/toolkit/components/places/tests/expiration/test_pref_interval.js
+++ b/toolkit/components/places/tests/expiration/test_pref_interval.js
@@ -36,16 +36,18 @@ var tests = [
 
   { desc: "Set interval to a large value.",
     interval: 100,
     expectedTimerDelay: 100
   },
 
 ];
 
+var currentTest;
+
 add_task(function* test() {
   // The pref should not exist by default.
   Assert.throws(() => getInterval());
 
   // Force the component, so it will start observing preferences.
   force_expiration_start();
 
   for (let currentTest of tests) {
--- a/toolkit/components/places/tests/head_common.js
+++ b/toolkit/components/places/tests/head_common.js
@@ -365,19 +365,19 @@ function check_no_bookmarks() {
  *
  * @return {Promise}
  * @resolves The array [aSubject, aData] from the observed notification.
  * @rejects Never.
  */
 function promiseTopicObserved(aTopic)
 {
   return new Promise(resolve => {
-    Services.obs.addObserver(function observe(aObsSubject, aObsTopic, aObsData) {
-      Services.obs.removeObserver(observe, aObsTopic);
-      resolve([aObsSubject, aObsData]);
+    Services.obs.addObserver(function observe(aSubject, aTopic, aData) {
+      Services.obs.removeObserver(observe, aTopic);
+      resolve([aSubject, aData]);
     }, aTopic, false);
   });
 }
 
 /**
  * Simulates a Places shutdown.
  */
 var shutdownPlaces = function() {
@@ -816,17 +816,17 @@ NavHistoryResultObserver.prototype = {
  * @param aURI The URI.
  * @return {Promise}
  * @resolves When the check has been added successfully.
  * @rejects JavaScript exception.
  */
 function promiseIsURIVisited(aURI) {
   let deferred = Promise.defer();
 
-  PlacesUtils.asyncHistory.isURIVisited(aURI, function(unused, aIsVisited) {
+  PlacesUtils.asyncHistory.isURIVisited(aURI, function(aURI, aIsVisited) {
     deferred.resolve(aIsVisited);
   });
 
   return deferred.promise;
 }
 
 /**
  * Asynchronously set the favicon associated with a page.
--- a/toolkit/components/places/tests/history/test_remove.js
+++ b/toolkit/components/places/tests/history/test_remove.js
@@ -39,27 +39,27 @@ add_task(function* test_remove_single() 
     }
 
     let shouldRemove = !options.addBookmark;
     let observer;
     let promiseObserved = new Promise((resolve, reject) => {
       observer = {
         onBeginUpdateBatch: function() {},
         onEndUpdateBatch: function() {},
-        onVisit: function(aUri) {
-          reject(new Error("Unexpected call to onVisit " + aUri.spec));
+        onVisit: function(uri) {
+          reject(new Error("Unexpected call to onVisit " + uri.spec));
         },
-        onTitleChanged: function(aUri) {
-          reject(new Error("Unexpected call to onTitleChanged " + aUri.spec));
+        onTitleChanged: function(uri) {
+          reject(new Error("Unexpected call to onTitleChanged " + uri.spec));
         },
         onClearHistory: function() {
           reject("Unexpected call to onClearHistory");
         },
-        onPageChanged: function(aUri) {
-          reject(new Error("Unexpected call to onPageChanged " + aUri.spec));
+        onPageChanged: function(uri) {
+          reject(new Error("Unexpected call to onPageChanged " + uri.spec));
         },
         onFrecencyChanged: function(aURI) {
           try {
             Assert.ok(!shouldRemove, "Observing onFrecencyChanged");
             Assert.equal(aURI.spec, uri.spec, "Observing effect on the right uri");
           } finally {
             resolve();
           }
--- a/toolkit/components/places/tests/queries/head_queries.js
+++ b/toolkit/components/places/tests/queries/head_queries.js
@@ -36,21 +36,21 @@ const olderthansixmonths = today - (DAY_
  * Generalized function to pull in an array of objects of data and push it into
  * the database.  It does NOT do any checking to see that the input is
  * appropriate.  This function is an asynchronous task, it can be called using
  * "Task.spawn" or using the "yield" function inside another task.
  */
 function* task_populateDB(aArray)
 {
   // Iterate over aArray and execute all instructions.
-  for (let arrayItem of aArray) {
+  for (let data of aArray) {
     try {
       // make the data object into a query data object in order to create proper
       // default values for anything left unspecified
-      var qdata = new queryData(arrayItem);
+      var qdata = new queryData(data);
       if (qdata.isVisit) {
         // Then we should add a visit for this node
         yield PlacesTestUtils.addVisits({
           uri: uri(qdata.uri),
           transition: qdata.transType,
           visitDate: qdata.lastVisit,
           referrer: qdata.referrer ? uri(qdata.referrer) : null,
           title: qdata.title
@@ -179,18 +179,18 @@ function* task_populateDB(aArray)
       if (qdata.isSeparator) {
         yield PlacesUtils.bookmarks.insert({
           parentGuid: qdata.parentGuid,
           type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
           index: qdata.index
         });
       }
     } catch (ex) {
-      // use the arrayItem object here in case instantiation of qdata failed
-      do_print("Problem with this URI: " + arrayItem.uri);
+      // use the data object here in case instantiation of qdata failed
+      do_print("Problem with this URI: " + data.uri);
       do_throw("Error creating database: " + ex + "\n");
     }
   }
 }
 
 
 /**
  * The Query Data Object - this object encapsulates data for our queries and is
--- a/toolkit/components/places/tests/queries/test_results-as-visit.js
+++ b/toolkit/components/places/tests/queries/test_results-as-visit.js
@@ -56,17 +56,17 @@ add_task(function* test_results_as_visit
    options.resultType = options.RESULTS_AS_VISIT;
 
    // Results
    var result = PlacesUtils.history.executeQuery(query, options);
    var root = result.root;
    root.containerOpen = true;
 
    do_print("Number of items in result set: " + root.childCount);
-   for (let i=0; i < root.childCount; ++i) {
+   for (var i=0; i < root.childCount; ++i) {
      do_print("result: " + root.getChild(i).uri + " Title: " + root.getChild(i).title);
    }
 
    // Check our inital result set
    compareArrayToResult(testData, root);
 
    // If that passes, check liveupdate
    // Add to the query set
--- a/toolkit/components/places/tests/unit/test_408221.js
+++ b/toolkit/components/places/tests/unit/test_408221.js
@@ -87,17 +87,17 @@ function ensure_tag_results(uris, search
   };
 
   input.onSearchComplete = function() {
     do_check_eq(numSearchesStarted, 1);
     do_check_eq(controller.searchStatus,
                 Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH);
     do_check_eq(controller.matchCount, uris.length);
     let vals = [];
-    for (let i=0; i<controller.matchCount; i++) {
+    for (var i=0; i<controller.matchCount; i++) {
       // Keep the URL for later because order of tag results is undefined
       vals.push(controller.getValueAt(i));
       do_check_eq(controller.getStyleAt(i), "bookmark-tag");
     }
     // Sort the results then check if we have the right items
     vals.sort().forEach((val, i) => do_check_eq(val, uris[i].spec))
 
     if (current_test < (tests.length - 1)) {
--- a/toolkit/components/places/tests/unit/test_415757.js
+++ b/toolkit/components/places/tests/unit/test_415757.js
@@ -66,17 +66,17 @@ add_task(function* test_execute()
                                             testAnnoRetainedName,
                                             testAnnoRetainedValue, 0,
                                             PlacesUtils.annotations.EXPIRE_WITH_HISTORY);
 
   // remove pages from www.test.com
   PlacesUtils.history.removePagesFromHost("www.test.com", false);
 
   // check that all pages in www.test.com have been removed
-  for (let i = 0; i < TOTAL_SITES; i++) {
+  for (var i = 0; i < TOTAL_SITES; i++) {
     let site = "http://www.test.com/" + i + "/";
     let testURI = uri(site);
     do_check_false(uri_in_db(testURI));
   }
 
   // check that all pages in www.test-X.com have NOT been removed
   for (let i = 0; i < TOTAL_SITES; i++) {
     let site = "http://www.test-" + i + ".com/";
--- a/toolkit/components/places/tests/unit/test_async_transactions.js
+++ b/toolkit/components/places/tests/unit/test_async_transactions.js
@@ -446,32 +446,32 @@ add_task(function* test_new_bookmark() {
 });
 
 add_task(function* test_merge_create_folder_and_item() {
   let folder_info = createTestFolderInfo();
   let bm_info = { url: NetUtil.newURI("http://test_create_item_to_folder.com")
                 , title: "Test Bookmark"
                 , index: bmStartIndex };
 
-  let { folderTxnResult, bkmTxnResult } = yield PT.batch(function* () {
+  let { folderTxn, bkmTxn } = yield PT.batch(function* () {
     let folderTxn = PT.NewFolder(folder_info);
     folder_info.guid = bm_info.parentGuid = yield folderTxn.transact();
     let bkmTxn = PT.NewBookmark(bm_info);
     bm_info.guid = yield bkmTxn.transact();
     return { folderTxn, bkmTxn };
   });
 
   let ensureDo = function* () {
-    ensureUndoState([[bkmTxnResult, folderTxnResult]], 0);
+    ensureUndoState([[bkmTxn, folderTxn]], 0);
     yield ensureItemsAdded(folder_info, bm_info);
     observer.reset();
   };
 
   let ensureUndo = () => {
-    ensureUndoState([[bkmTxnResult, folderTxnResult]], 1);
+    ensureUndoState([[bkmTxn, folderTxn]], 1);
     ensureItemsRemoved(folder_info, bm_info);
     observer.reset();
   };
 
   yield ensureDo();
   yield PT.undo();
   ensureUndo();
   yield PT.redo();
@@ -486,45 +486,45 @@ add_task(function* test_merge_create_fol
 add_task(function* test_move_items_to_folder() {
   let folder_a_info = createTestFolderInfo("Folder A");
   let bkm_a_info = { url: new URL("http://test_move_items.com")
                    , title: "Bookmark A" };
   let bkm_b_info = { url: NetUtil.newURI("http://test_move_items.com")
                    , title: "Bookmark B" };
 
   // Test moving items within the same folder.
-  let [folder_a_txn_result, bkm_a_txn_result, bkm_b_txn_result] = yield PT.batch(function* () {
+  let [folder_a_txn, bkm_a_txn, bkm_b_txn] = yield PT.batch(function* () {
     let folder_a_txn = PT.NewFolder(folder_a_info);
 
     folder_a_info.guid = bkm_a_info.parentGuid = bkm_b_info.parentGuid =
       yield folder_a_txn.transact();
     let bkm_a_txn = PT.NewBookmark(bkm_a_info);
     bkm_a_info.guid = yield bkm_a_txn.transact();
     let bkm_b_txn = PT.NewBookmark(bkm_b_info);
     bkm_b_info.guid = yield bkm_b_txn.transact();
     return [folder_a_txn, bkm_a_txn, bkm_b_txn];
   });
 
-  ensureUndoState([[bkm_b_txn_result, bkm_a_txn_result, folder_a_txn_result]], 0);
+  ensureUndoState([[bkm_b_txn, bkm_a_txn, folder_a_txn]], 0);
 
   let moveTxn = PT.Move({ guid:          bkm_a_info.guid
                         , newParentGuid: folder_a_info.guid });
   yield moveTxn.transact();
 
   let ensureDo = () => {
-    ensureUndoState([[moveTxn], [bkm_b_txn_result, bkm_a_txn_result, folder_a_txn_result]], 0);
+    ensureUndoState([[moveTxn], [bkm_b_txn, bkm_a_txn, folder_a_txn]], 0);
     ensureItemsMoved({ guid:          bkm_a_info.guid
                      , oldParentGuid: folder_a_info.guid
                      , newParentGuid: folder_a_info.guid
                      , oldIndex:      0
                      , newIndex:      1 });
     observer.reset();
   };
   let ensureUndo = () => {
-    ensureUndoState([[moveTxn], [bkm_b_txn_result, bkm_a_txn_result, folder_a_txn_result]], 1);
+    ensureUndoState([[moveTxn], [bkm_b_txn, bkm_a_txn, folder_a_txn]], 1);
     ensureItemsMoved({ guid:          bkm_a_info.guid
                      , oldParentGuid: folder_a_info.guid
                      , newParentGuid: folder_a_info.guid
                      , oldIndex:      1
                      , newIndex:      0 });
     observer.reset();
   };
 
@@ -591,93 +591,93 @@ add_task(function* test_move_items_to_fo
                   , [bkm_b_txn, bkm_a_txn, folder_a_txn] ], 3);
   yield PT.clearTransactionsHistory();
   ensureUndoState();
 });
 
 add_task(function* test_remove_folder() {
   let folder_level_1_info = createTestFolderInfo("Folder Level 1");
   let folder_level_2_info = { title: "Folder Level 2" };
-  let [folder_level_1_txn_result,
-       folder_level_2_txn_result] = yield PT.batch(function* () {
+  let [folder_level_1_txn,
+       folder_level_2_txn] = yield PT.batch(function* () {
     let folder_level_1_txn  = PT.NewFolder(folder_level_1_info);
     folder_level_1_info.guid = yield folder_level_1_txn.transact();
     folder_level_2_info.parentGuid = folder_level_1_info.guid;
     let folder_level_2_txn = PT.NewFolder(folder_level_2_info);
     folder_level_2_info.guid = yield folder_level_2_txn.transact();
     return [folder_level_1_txn, folder_level_2_txn];
   });
 
-  ensureUndoState([[folder_level_2_txn_result, folder_level_1_txn_result]]);
+  ensureUndoState([[folder_level_2_txn, folder_level_1_txn]]);
   yield ensureItemsAdded(folder_level_1_info, folder_level_2_info);
   observer.reset();
 
   let remove_folder_2_txn = PT.Remove(folder_level_2_info);
   yield remove_folder_2_txn.transact();
 
   ensureUndoState([ [remove_folder_2_txn]
-                  , [folder_level_2_txn_result, folder_level_1_txn_result] ]);
+                  , [folder_level_2_txn, folder_level_1_txn] ]);
   yield ensureItemsRemoved(folder_level_2_info);
 
   // Undo Remove "Folder Level 2"
   yield PT.undo();
   ensureUndoState([ [remove_folder_2_txn]
-                  , [folder_level_2_txn_result, folder_level_1_txn_result] ], 1);
+                  , [folder_level_2_txn, folder_level_1_txn] ], 1);
   yield ensureItemsAdded(folder_level_2_info);
   ensureTimestampsUpdated(folder_level_2_info.guid, true);
   observer.reset();
 
   // Redo Remove "Folder Level 2"
   yield PT.redo();
   ensureUndoState([ [remove_folder_2_txn]
-                  , [folder_level_2_txn_result, folder_level_1_txn_result] ]);
+                  , [folder_level_2_txn, folder_level_1_txn] ]);
   yield ensureItemsRemoved(folder_level_2_info);
   observer.reset();
 
   // Undo it again
   yield PT.undo();
   ensureUndoState([ [remove_folder_2_txn]
-                  , [folder_level_2_txn_result, folder_level_1_txn_result] ], 1);
+                  , [folder_level_2_txn, folder_level_1_txn] ], 1);
   yield ensureItemsAdded(folder_level_2_info);
   ensureTimestampsUpdated(folder_level_2_info.guid, true);
   observer.reset();
 
   // Undo the creation of both folders
   yield PT.undo();
   ensureUndoState([ [remove_folder_2_txn]
-                  , [folder_level_2_txn_result, folder_level_1_txn_result] ], 2);
+                  , [folder_level_2_txn, folder_level_1_txn] ], 2);
   yield ensureItemsRemoved(folder_level_2_info, folder_level_1_info);
   observer.reset();
 
   // Redo the creation of both folders
   yield PT.redo();
   ensureUndoState([ [remove_folder_2_txn]
-                  , [folder_level_2_txn_result, folder_level_1_txn_result] ], 1);
+                  , [folder_level_2_txn, folder_level_1_txn] ], 1);
   yield ensureItemsAdded(folder_level_1_info, folder_level_2_info);
   ensureTimestampsUpdated(folder_level_1_info.guid, true);
   ensureTimestampsUpdated(folder_level_2_info.guid, true);
   observer.reset();
 
   // Redo Remove "Folder Level 2"
   yield PT.redo();
   ensureUndoState([ [remove_folder_2_txn]
-                  , [folder_level_2_txn_result, folder_level_1_txn_result] ]);
+                  , [folder_level_2_txn, folder_level_1_txn] ]);
   yield ensureItemsRemoved(folder_level_2_info);
   observer.reset();
 
   // Undo everything one last time
   yield PT.undo();
   ensureUndoState([ [remove_folder_2_txn]
-                  , [folder_level_2_txn_result, folder_level_1_txn_result] ], 1);
+                  , [folder_level_2_txn, folder_level_1_txn] ], 1);
   yield ensureItemsAdded(folder_level_2_info);
   observer.reset();
 
   yield PT.undo();
   ensureUndoState([ [remove_folder_2_txn]
-                  , [folder_level_2_txn_result, folder_level_1_txn_result] ], 2);
+                  , [folder_level_2_txn, folder_level_1_txn] ], 2);
   yield ensureItemsRemoved(folder_level_2_info, folder_level_2_info);
   observer.reset();
 
   yield PT.clearTransactionsHistory();
   ensureUndoState();
 });
 
 add_task(function* test_add_and_remove_bookmarks_with_additional_info() {
--- a/toolkit/components/places/tests/unit/test_bookmarks_html.js
+++ b/toolkit/components/places/tests/unit/test_bookmarks_html.js
@@ -199,17 +199,17 @@ add_task(function* test_import_chromefav
     PlacesUtils.favicons.setAndFetchFaviconForPage(
       PAGE_URI, CHROME_FAVICON_URI, true,
       PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
       resolve, Services.scriptSecurityManager.getSystemPrincipal());
   });
 
   let data = yield new Promise(resolve => {
     PlacesUtils.favicons.getFaviconDataForPage(
-      PAGE_URI, (uri, dataLen, faviconData, mimeType) => resolve(faviconData));
+      PAGE_URI, (uri, dataLen, data, mimeType) => resolve(data));
   });
 
   let base64Icon = "data:image/png;base64," +
       base64EncodeString(String.fromCharCode.apply(String, data));
 
   test_bookmarks.unfiled.push(
     { title: "Test", url: PAGE_URI.spec, icon: base64Icon });
 
--- a/toolkit/components/places/tests/unit/test_bookmarks_html_corrupt.js
+++ b/toolkit/components/places/tests/unit/test_bookmarks_html_corrupt.js
@@ -26,17 +26,17 @@ add_task(function* test_corrupt_file() {
   yield database_check();
 });
 
 add_task(function* test_corrupt_database() {
   // Create corruption in the database, then export.
   let corruptBookmark = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.toolbarGuid,
                                                              url: "http://test.mozilla.org",
                                                              title: "We love belugas" });
-  yield PlacesUtils.withConnectionWrapper("test", Task.async(function*(db) {
+  let db = yield PlacesUtils.withConnectionWrapper("test", Task.async(function*(db) {
     yield db.execute("UPDATE moz_bookmarks SET fk = NULL WHERE guid = :guid",
                      { guid: corruptBookmark.guid });
   }));
 
   let bookmarksFile = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.exported.html");
   if ((yield OS.File.exists(bookmarksFile)))
     yield OS.File.remove(bookmarksFile);
   yield BookmarkHTMLUtils.exportToFile(bookmarksFile);
--- a/toolkit/components/places/tests/unit/test_download_history.js
+++ b/toolkit/components/places/tests/unit/test_download_history.js
@@ -80,18 +80,18 @@ add_test(function test_dh_is_from_places
 add_test(function test_dh_addRemoveDownload()
 {
   waitForOnVisit(function DHAD_onVisit(aURI) {
     do_check_true(aURI.equals(DOWNLOAD_URI));
 
     // Verify that the URI is already available in results at this time.
     do_check_true(!!page_in_database(DOWNLOAD_URI));
 
-    waitForOnDeleteURI(function DHRAD_onDeleteURI(aDeletedURI) {
-      do_check_true(aDeletedURI.equals(DOWNLOAD_URI));
+    waitForOnDeleteURI(function DHRAD_onDeleteURI(aURI) {
+      do_check_true(aURI.equals(DOWNLOAD_URI));
 
       // Verify that the URI is already available in results at this time.
       do_check_false(!!page_in_database(DOWNLOAD_URI));
 
       run_next_test();
     });
     gDownloadHistory.removeAllDownloads();
   });
@@ -104,18 +104,18 @@ add_test(function test_dh_addMultiRemove
   PlacesTestUtils.addVisits({
     uri: DOWNLOAD_URI,
     transition: TRANSITION_TYPED
   }).then(function () {
     waitForOnVisit(function DHAD_onVisit(aURI) {
       do_check_true(aURI.equals(DOWNLOAD_URI));
       do_check_true(!!page_in_database(DOWNLOAD_URI));
 
-      waitForOnDeleteVisits(function DHRAD_onDeleteVisits(aDeletedURI) {
-        do_check_true(aDeletedURI.equals(DOWNLOAD_URI));
+      waitForOnDeleteVisits(function DHRAD_onDeleteVisits(aURI) {
+        do_check_true(aURI.equals(DOWNLOAD_URI));
         do_check_true(!!page_in_database(DOWNLOAD_URI));
 
         PlacesTestUtils.clearHistory().then(run_next_test);
       });
       gDownloadHistory.removeAllDownloads();
     });
 
     gDownloadHistory.addDownload(DOWNLOAD_URI, null, Date.now() * 1000);
@@ -127,37 +127,37 @@ add_test(function test_dh_addBookmarkRem
   PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
                                        DOWNLOAD_URI,
                                        PlacesUtils.bookmarks.DEFAULT_INDEX,
                                        "A bookmark");
   waitForOnVisit(function DHAD_onVisit(aURI) {
     do_check_true(aURI.equals(DOWNLOAD_URI));
     do_check_true(!!page_in_database(DOWNLOAD_URI));
 
-    waitForOnDeleteVisits(function DHRAD_onDeleteVisits(aDeletedURI) {
-      do_check_true(aDeletedURI.equals(DOWNLOAD_URI));
+    waitForOnDeleteVisits(function DHRAD_onDeleteVisits(aURI) {
+      do_check_true(aURI.equals(DOWNLOAD_URI));
       do_check_true(!!page_in_database(DOWNLOAD_URI));
 
       PlacesTestUtils.clearHistory().then(run_next_test);
     });
     gDownloadHistory.removeAllDownloads();
   });
 
   gDownloadHistory.addDownload(DOWNLOAD_URI, null, Date.now() * 1000);
 });
 
 add_test(function test_dh_addDownload_referrer()
 {
   waitForOnVisit(function DHAD_prepareReferrer(aURI, aVisitID) {
     do_check_true(aURI.equals(REFERRER_URI));
     let referrerVisitId = aVisitID;
 
-    waitForOnVisit(function DHAD_onVisit(aVisitedURI, unused, unused2, unused3,
-                                         aReferringID) {
-      do_check_true(aVisitedURI.equals(DOWNLOAD_URI));
+    waitForOnVisit(function DHAD_onVisit(aURI, aVisitID, aTime, aSessionID,
+                                              aReferringID) {
+      do_check_true(aURI.equals(DOWNLOAD_URI));
       do_check_eq(aReferringID, referrerVisitId);
 
       // Verify that the URI is already available in results at this time.
       do_check_true(!!page_in_database(DOWNLOAD_URI));
 
       PlacesTestUtils.clearHistory().then(run_next_test);
     });
 
--- a/toolkit/components/places/tests/unit/test_getPlacesInfo.js
+++ b/toolkit/components/places/tests/unit/test_getPlacesInfo.js
@@ -57,17 +57,17 @@ add_task(test_getPlacesInfoNonExistentPl
 function* test_promisedHelper() {
   let uri = NetUtil.newURI("http://www.helper_existent_example.tld");
   yield PlacesTestUtils.addVisits(uri);
   let placeInfo = yield PlacesUtils.promisePlaceInfo(uri);
   do_check_true(placeInfo instanceof Ci.mozIPlaceInfo);
 
   uri = NetUtil.newURI("http://www.helper_non_existent_example.tld");
   try {
-    yield PlacesUtils.promisePlaceInfo(uri);
+    let placeInfo = yield PlacesUtils.promisePlaceInfo(uri);
     do_throw("PlacesUtils.promisePlaceInfo should have rejected the promise");
   }
   catch (ex) { }
 }
 add_task(test_promisedHelper);
 
 function* test_infoByGUID() {
   let testURI = NetUtil.newURI("http://www.guid_example.tld");
--- a/toolkit/components/places/tests/unit/test_history_autocomplete_tags.js
+++ b/toolkit/components/places/tests/unit/test_history_autocomplete_tags.js
@@ -90,17 +90,17 @@ function ensure_tag_results(uris, search
   input.onSearchComplete = function() {
     do_check_eq(numSearchesStarted, 1);
     do_check_eq(controller.searchStatus,
                 uris.length ?
                 Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH :
                 Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH);
     do_check_eq(controller.matchCount, uris.length);
     let vals = [];
-    for (let i=0; i<controller.matchCount; i++) {
+    for (var i=0; i<controller.matchCount; i++) {
       // Keep the URL for later because order of tag results is undefined
       vals.push(controller.getValueAt(i));
       do_check_eq(controller.getStyleAt(i), "bookmark-tag");
     }
     // Sort the results then check if we have the right items
     vals.sort().forEach((val, i) => do_check_eq(val, uris[i].spec))
 
     if (current_test < (tests.length - 1)) {
--- a/toolkit/components/places/tests/unit/test_isURIVisited.js
+++ b/toolkit/components/places/tests/unit/test_isURIVisited.js
@@ -49,25 +49,25 @@ function* step()
         do_check_false(aIsVisited);
 
         let callback = {
           handleError:  function () {},
           handleResult: function () {},
           handleCompletion: function () {
             do_print("Added visit to " + uri.spec);
 
-            history.isURIVisited(uri, function (aURI2, aIsVisited2) {
-              do_check_true(uri.equals(aURI2));
+            history.isURIVisited(uri, function (aURI, aIsVisited) {
+              do_check_true(uri.equals(aURI));
               let checker = SCHEMES[scheme] ? do_check_true : do_check_false;
-              checker(aIsVisited2);
+              checker(aIsVisited);
 
               PlacesTestUtils.clearHistory().then(function () {
-                history.isURIVisited(uri, function(aURI3, aIsVisited3) {
-                  do_check_true(uri.equals(aURI3));
-                  do_check_false(aIsVisited3);
+                history.isURIVisited(uri, function(aURI, aIsVisited) {
+                  do_check_true(uri.equals(aURI));
+                  do_check_false(aIsVisited);
                   gRunner.next();
                 });
               });
             });
           },
         };
 
         history.updatePlaces({ uri:    uri
--- a/toolkit/components/satchel/test/test_form_autocomplete.html
+++ b/toolkit/components/satchel/test/test_form_autocomplete.html
@@ -1047,21 +1047,21 @@ function waitForScroll()
   }, false);
 }
 
 function waitForMenuChange(expectedCount, expectedFirstValue)
 {
     notifyMenuChanged(expectedCount, expectedFirstValue, runTest);
 }
 
-function checkMenuEntries(expectedValues, testNumber) {
+function checkMenuEntries(expectedValues, testNum) {
     var actualValues = getMenuEntries();
-    is(actualValues.length, expectedValues.length, testNumber + " Checking length of expected menu");
+    is(actualValues.length, expectedValues.length, testNum + " Checking length of expected menu");
     for (var i = 0; i < expectedValues.length; i++)
-        is(actualValues[i], expectedValues[i], testNumber + " Checking menu entry #"+i);
+        is(actualValues[i], expectedValues[i], testNum + " Checking menu entry #"+i);
 }
 
 function startTest() {
     setupFormHistory(function() {
         runTest();
     });
 }
 
--- a/toolkit/components/satchel/test/test_form_autocomplete_with_list.html
+++ b/toolkit/components/satchel/test/test_form_autocomplete_with_list.html
@@ -481,21 +481,21 @@ function runTest() {
       return;
     }
 }
 
 function waitForMenuChange(expectedCount) {
     notifyMenuChanged(expectedCount, null, runTest);
 }
 
-function checkMenuEntries(expectedValues, testNumber) {
+function checkMenuEntries(expectedValues, testNum) {
     var actualValues = getMenuEntries();
-    is(actualValues.length, expectedValues.length, testNumber + " Checking length of expected menu");
+    is(actualValues.length, expectedValues.length, testNum + " Checking length of expected menu");
     for (var i = 0; i < expectedValues.length; i++)
-        is(actualValues[i], expectedValues[i], testNumber + " Checking menu entry #"+i);
+        is(actualValues[i], expectedValues[i], testNum + " Checking menu entry #"+i);
 }
 
 function startTest() {
     setupFormHistory(runTest);
 }
 
 window.onload = startTest;
 
--- a/toolkit/components/satchel/test/test_form_submission.html
+++ b/toolkit/components/satchel/test/test_form_submission.html
@@ -95,34 +95,34 @@
     <input type="text" name="test1">
     <button type="submit">Submit</button>
   </form>
 
   <!-- input with sensitive data (16 digit credit card number) -->
   <form id="form15" onsubmit="return checkSubmit(15)">
     <script type="text/javascript">
       var form = document.getElementById('form15');
-      for (let i = 0; i != 10; i++)
+      for (var i = 0; i != 10; i++)
       {
-        let input = document.createElement('input');
+        var input = document.createElement('input');
         input.type = 'text';
         input.name = 'test' + (i + 1);
         form.appendChild(input);
       }
     </script>
     <button type="submit">Submit</button>
   </form>
 
   <!-- input with sensitive data (15 digit credit card number) -->
   <form id="form16" onsubmit="return checkSubmit(16)">
     <script type="text/javascript">
       form = document.getElementById('form16');
-      for (let i = 0; i != 10; i++)
+      for (i = 0; i != 10; i++)
       {
-        let input = document.createElement('input');
+        input = document.createElement('input');
         input.type = 'text';
         input.name = 'test' + (i + 1);
         form.appendChild(input);
       }
     </script>
     <button type="submit">Submit</button>
   </form>
 
@@ -212,35 +212,35 @@
     <button type="submit">Submit</button>
   </form>
 
   <!-- input that looks like sensitive data but doesn't
        satisfy the requirements (Luhn check fails for 16 chars) -->
   <form id="form107" onsubmit="return checkSubmit(107)">
     <script type="text/javascript">
       form = document.getElementById('form107');
-      for (let i = 0; i != 10; i++)
+      for (i = 0; i != 10; i++)
       {
-        let input = document.createElement('input');
+        input = document.createElement('input');
         input.type = 'text';
         input.name = 'test7_' + (i + 1);
         form.appendChild(input);
       }
     </script>
     <button type="submit">Submit</button>
   </form>
 
   <!-- input that looks like sensitive data but doesn't
        satisfy the requirements (Luhn check fails for 15 chars) -->
   <form id="form108" onsubmit="return checkSubmit(108)">
     <script type="text/javascript">
       form = document.getElementById('form108');
-      for (let i = 0; i != 10; i++)
+      for (i = 0; i != 10; i++)
       {
-        let input = document.createElement('input');
+        input = document.createElement('input');
         input.type = 'text';
         input.name = 'test8_' + (i + 1);
         form.appendChild(input);
       }
     </script>
     <button type="submit">Submit</button>
   </form>
 
@@ -308,34 +308,34 @@ function startTest() {
   $_(1, "test1").value = "dontSaveThis";
   $_(2, "test1").value = "dontSaveThis";
   $_(3, "test1").value = "dontSaveThis";
   $_(4, "test1").value = "dontSaveThis";
   $_(5, "test1").value = "";
   $_(6, "test1").value = "dontSaveThis";
   // Form 7 deliberately left untouched.
   // Form 8 has an input with no name or input attribute.
-  let input = document.getElementById("form8").elements[0];
+  var input = document.getElementById("form8").elements[0];
   is(input.type, "text", "checking we got unidentified input");
   input.value = "dontSaveThis";
   // Form 9 has nothing to modify.
   $_(10, "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890").value = "dontSaveThis";
   $_(11, "test1").value = "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890";
   $_(12, "test1").value = " ";
   $_(13, "test1").value = "dontSaveThis";
   $_(14, "test1").type  = "password";
   $_(14, "test1").value = "dontSaveThis";
 
   var testData = ccNumbers.valid16;
-  for (let i = 0; i != testData.length; i++) {
+  for (var i = 0; i != testData.length; i++) {
     $_(15, "test" + (i + 1)).value = testData[i];
   }
 
   testData = ccNumbers.valid15;
-  for (let i = 0; i != testData.length; i++) {
+  for (i = 0; i != testData.length; i++) {
     $_(16, "test" + (i + 1)).value = testData[i];
   }
   $_(17, "test1").value = "001064088";
   $_(18, "test1").value = "0000-0000-0080-4609";
   $_(19, "test1").value = "0000 0000 0222 331";
   $_(20, "test1").value = "dontSaveThis";
   $_(22, "test1").value = "dontSaveThis";
   $_(23, "test1").value = "dontSaveThis";
@@ -344,22 +344,22 @@ function startTest() {
   $_(101, "test1").value = "savedValue";
   $_(102, "test2").value = "savedValue";
   $_(103, "test3").value = "savedValue";
   $_(104, "test4").value = " trimTrailingAndLeadingSpace ";
   $_(105, "test5").value = "\t trimTrailingAndLeadingWhitespace\t ";
   $_(106, "test6").value = "00000000109181";
 
   testData = ccNumbers.invalid16;
-  for (let i = 0; i != testData.length; i++) {
+  for (i = 0; i != testData.length; i++) {
     $_(107, "test7_" + (i + 1)).value = testData[i];
   }
 
   testData = ccNumbers.invalid15;
-  for (let i = 0; i != testData.length; i++) {
+  for (i = 0; i != testData.length; i++) {
     $_(108, "test8_" + (i + 1)).value = testData[i];
   }
 
   $_(109, "test9").value = "savedValue";
   $_(110, "test10").value = "savedValue";
 
   // submit the first form.
   var button = getFormSubmitButton(1);
@@ -425,22 +425,22 @@ function checkSubmit(formNum) {
         break;
     case 105:
         checkForSave("test5", "trimTrailingAndLeadingWhitespace", "checking saved value is trimmed on both sides");
         break;
     case 106:
         checkForSave("test6", "00000000109181", "checking saved value");
         break;
     case 107:
-        for (let i = 0; i != ccNumbers.invalid16.length; i++) {
+        for (var i = 0; i != ccNumbers.invalid16.length; i++) {
           checkForSave("test7_" + (i + 1), ccNumbers.invalid16[i], "checking saved value");
         }
         break;
     case 108:
-        for (let i = 0; i != ccNumbers.invalid15.length; i++) {
+        for (i = 0; i != ccNumbers.invalid15.length; i++) {
           checkForSave("test8_" + (i + 1), ccNumbers.invalid15[i], "checking saved value");
         }
         break;
     case 109:
         checkForSave("test9", "savedValue", "checking saved value");
         break;
     case 110:
         checkForSave("test10", "savedValue", "checking saved value");
--- a/toolkit/components/satchel/test/unit/test_autocomplete.js
+++ b/toolkit/components/satchel/test/unit/test_autocomplete.js
@@ -69,17 +69,17 @@ add_test(function test0() {
     }
 
     updateFormHistory(changes, run_next_test);
 });
 
 add_test(function test1() {
     do_log_info("Check initial state is as expected");
 
-    countEntries(null, null, function () {
+    countEntries(null, null, function (count) {
       countEntries("field1", null, function (count) {
         do_check_true(count > 0);
         run_next_test();
       });
     });
 });
 
 add_test(function test2() {
--- a/toolkit/content/tests/widgets/popup_shared.js
+++ b/toolkit/content/tests/widgets/popup_shared.js
@@ -360,18 +360,18 @@ function compareEdge(anchor, popup, edge
   else {
     is(Math.round(popuprect.width), gPopupWidth, testname + " width");
     is(Math.round(popuprect.height), gPopupHeight, testname + " height");
   }
 
   var spaceIdx = edge.indexOf(" ");
   if (spaceIdx > 0) {
     let cornerX, cornerY;
-    let [position, align] = edge.split(" ");
-    switch (position) {
+    let [anchor, align] = edge.split(" ");
+    switch (anchor) {
       case "topleft": cornerX = anchorrect.left; cornerY = anchorrect.top; break;
       case "topcenter": cornerX = anchorrect.left + anchorrect.width / 2; cornerY = anchorrect.top; break;
       case "topright": cornerX = anchorrect.right; cornerY = anchorrect.top; break;
       case "leftcenter": cornerX = anchorrect.left; cornerY = anchorrect.top + anchorrect.height / 2; break;
       case "rightcenter": cornerX = anchorrect.right; cornerY = anchorrect.top + anchorrect.height / 2; break;
       case "bottomleft": cornerX = anchorrect.left; cornerY = anchorrect.bottom; break;
       case "bottomcenter": cornerX = anchorrect.left + anchorrect.width / 2; cornerY = anchorrect.bottom; break;
       case "bottomright": cornerX = anchorrect.right; cornerY = anchorrect.bottom; break;
--- a/toolkit/content/tests/widgets/tree_shared.js
+++ b/toolkit/content/tests/widgets/tree_shared.js
@@ -1098,17 +1098,17 @@ function testtag_tree_column_reorder()
   if (testframe) {
     testframe.scrollIntoView();
   }
 
   var tree = document.getElementById("tree-column-reorder");
   var numColumns = tree.columns.count;
 
   var reference = [];
-  for (let i = 0; i < numColumns; i++) {
+  for (var i = 0; i < numColumns; i++) {
     reference.push("col_" + i);
   }
 
   // Drag the first column to each position
   for (let i = 0; i < numColumns - 1; i++) {
     synthesizeColumnDrag(tree, i, i + 1, true);
     arrayMove(reference, i, i + 1, true);
     checkColumns(tree, reference, "drag first column right");
@@ -1276,27 +1276,27 @@ function arrayMove(aArray, aFrom, aTo, a
   }
 
   aArray.splice(aTo, 0, o);
 }
 
 function getSortedColumnArray(aTree)
 {
   var columns = aTree.columns;
-  var array = [];
-  for (let i = 0; i < columns.length; i++) {
-    array.push(columns.getColumnAt(i));
+  var a = [];
+  for (var i = 0; i < columns.length; i++) {
+    a.push(columns.getColumnAt(i));
   }
 
-  array.sort(function(a, b) {
+  a.sort(function(a, b) {
     var o1 = parseInt(a.element.getAttribute("ordinal"));
     var o2 = parseInt(b.element.getAttribute("ordinal"));
     return o1 - o2;
   });
-  return array;
+  return a;
 }
 
 function checkColumns(aTree, aReference, aMessage)
 {
   var columns = getSortedColumnArray(aTree);
   var ids = [];
   columns.forEach(function(e) {
     ids.push(e.element.id);
@@ -1313,17 +1313,17 @@ function mouseOnCell(tree, row, column, 
 
 function mouseClickOnColumnHeader(aColumns, aColumnIndex, aButton, aClickCount)
 {
   var columnHeader = aColumns[aColumnIndex].element;
   var columnHeaderRect = columnHeader.getBoundingClientRect();
   var columnWidth = columnHeaderRect.right - columnHeaderRect.left;
   // For multiple click we send separate click events, with increasing
   // clickCount.  This simulates the common behavior of multiple clicks.
-  for (let i = 1; i <= aClickCount; i++) {
+  for (var i = 1; i <= aClickCount; i++) {
     // Target the middle of the column header.
     synthesizeMouse(columnHeader, columnWidth / 2, 3,
                     { button: aButton,
                       clickCount: i }, null);
   }
 }
 
 function mouseDblClickOnCell(tree, row, column, testname)
@@ -1339,29 +1339,29 @@ function mouseDblClickOnCell(tree, row, 
   synthesizeMouse(tree.body, rect.x, rect.y, { clickCount: 2 }, null);
 }
 
 function compareArrays(arr1, arr2)
 {
   if (arr1.length != arr2.length)
     return false;
 
-  for (let i = 0; i < arr1.length; i++) {
+  for (var i = 0; i < arr1.length; i++) {
     if (arr1[i] != arr2[i])
       return false;
   }
 
   return true;
 }
 
 function convertProperties(arr)
 {
   var results = [];
   var count = arr.Count();
-  for (let i = 0; i < count; i++)
+  for (var i = 0; i < count; i++)
     results.push(arr.GetElementAt(i).QueryInterface(Components.interfaces.nsIAtom).toString());
 
   results.sort();
   return results.join(" ");
 }
 
 function convertDOMtoTreeRowInfo(treechildren, level, rowidx)
 {