From fcb73495b2c5f096c768061a180a95be45bbb437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Fri, 20 Jan 2012 16:21:46 +0100 Subject: [PATCH] No bug - fix some browser chrome tests that pollute the global scope --- browser/base/content/test/browser_bug416661.js | 3 ++- browser/base/content/test/browser_bug555224.js | 3 ++- browser/base/content/test/browser_bug592338.js | 4 +++- browser/base/content/test/browser_bug623155.js | 2 ++ browser/base/content/test/browser_gestureSupport.js | 2 +- browser/base/content/test/browser_identity_UI.js | 2 +- testing/mochitest/tests/SimpleTest/SimpleTest.js | 2 +- testing/mochitest/tests/SimpleTest/specialpowersAPI.js | 2 +- 8 files changed, 13 insertions(+), 7 deletions(-) diff --git a/browser/base/content/test/browser_bug416661.js b/browser/base/content/test/browser_bug416661.js index e4d0d28043b9..f459284eeeba 100644 --- a/browser/base/content/test/browser_bug416661.js +++ b/browser/base/content/test/browser_bug416661.js @@ -43,7 +43,8 @@ function test() { } function afterZoomAndLoad(cb) { - let didLoad = didZoom = false; + let didLoad = false; + let didZoom = false; tabElm.linkedBrowser.addEventListener("load", function() { tabElm.linkedBrowser.removeEventListener("load", arguments.callee, true); didLoad = true; diff --git a/browser/base/content/test/browser_bug555224.js b/browser/base/content/test/browser_bug555224.js index 3e1a483e2e7e..b0cff4eec730 100644 --- a/browser/base/content/test/browser_bug555224.js +++ b/browser/base/content/test/browser_bug555224.js @@ -37,7 +37,8 @@ const TEST_PAGE = "/browser/browser/base/content/test/dummy_page.html"; var gTestTab, gBgTab, gTestZoom; function afterZoomAndLoad(aCallback, aTab) { - let didLoad = didZoom = false; + let didLoad = false; + let didZoom = false; aTab.linkedBrowser.addEventListener("load", function() { aTab.linkedBrowser.removeEventListener("load", arguments.callee, true); didLoad = true; diff --git a/browser/base/content/test/browser_bug592338.js b/browser/base/content/test/browser_bug592338.js index 61414811bff4..a9ec62566739 100644 --- a/browser/base/content/test/browser_bug592338.js +++ b/browser/base/content/test/browser_bug592338.js @@ -4,7 +4,9 @@ const TESTROOT = "http://example.com/browser/toolkit/mozapps/extensions/test/xpinstall/"; -Components.utils.import("resource://gre/modules/LightweightThemeManager.jsm"); +var tempScope = {}; +Components.utils.import("resource://gre/modules/LightweightThemeManager.jsm", tempScope); +var LightweightThemeManager = tempScope.LightweightThemeManager; function wait_for_notification(aCallback) { PopupNotifications.panel.addEventListener("popupshown", function() { diff --git a/browser/base/content/test/browser_bug623155.js b/browser/base/content/test/browser_bug623155.js index 3a36d2a1148f..7a09e3e4ecf2 100644 --- a/browser/base/content/test/browser_bug623155.js +++ b/browser/base/content/test/browser_bug623155.js @@ -43,6 +43,8 @@ https://example.com/browser/browser/base/content/test/redirect_bug623155.sjs#FG */ +var gNewTab; + function test() { waitForExplicitFinish(); diff --git a/browser/base/content/test/browser_gestureSupport.js b/browser/base/content/test/browser_gestureSupport.js index 1a7a5f609fbb..054251bb51ef 100644 --- a/browser/base/content/test/browser_gestureSupport.js +++ b/browser/base/content/test/browser_gestureSupport.js @@ -383,7 +383,7 @@ function test_latchedGesture(gesture, inc, dec, eventPrefix) // Restore the gesture to its original configuration. gPrefService.setBoolPref(branch + "latched", oldLatchedValue); - for (dir in cmd) + for (let dir in cmd) test_removeCommand(cmd[dir]); } diff --git a/browser/base/content/test/browser_identity_UI.js b/browser/base/content/test/browser_identity_UI.js index ba220ea6c93c..b0e32d32297d 100644 --- a/browser/base/content/test/browser_identity_UI.js +++ b/browser/base/content/test/browser_identity_UI.js @@ -68,7 +68,7 @@ var tests = [ }, ] -let gCurrentTest, gCurrentTestIndex = -1; +let gCurrentTest, gCurrentTestIndex = -1, gTestDesc; // Go through the tests in both directions, to add additional coverage for // transitions between different states. let gForward = true; diff --git a/testing/mochitest/tests/SimpleTest/SimpleTest.js b/testing/mochitest/tests/SimpleTest/SimpleTest.js index 6a933fa07738..493048ab192c 100644 --- a/testing/mochitest/tests/SimpleTest/SimpleTest.js +++ b/testing/mochitest/tests/SimpleTest/SimpleTest.js @@ -611,7 +611,7 @@ SimpleTest.waitForClipboard = function(aExpectedStringOrValidatorFn, aSetupFn, return; } - data = SpecialPowers.getClipboardData(flavor); + var data = SpecialPowers.getClipboardData(flavor); if (validatorFn(data)) { // Don't show the success message when waiting for preExpectedVal diff --git a/testing/mochitest/tests/SimpleTest/specialpowersAPI.js b/testing/mochitest/tests/SimpleTest/specialpowersAPI.js index e9196828d5a6..3f17f8980995 100644 --- a/testing/mochitest/tests/SimpleTest/specialpowersAPI.js +++ b/testing/mochitest/tests/SimpleTest/specialpowersAPI.js @@ -934,7 +934,7 @@ SpecialPowersAPI.prototype = { // :jdm gets credit for this. ex: getPrivilegedProps(window, 'location.href'); getPrivilegedProps: function(obj, props) { - parts = props.split('.'); + var parts = props.split('.'); for (var i = 0; i < parts.length; i++) { var p = parts[i];