From 4d4051d2e27ac9b26317d4114a29daeb5bd3c2a8 Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Mon, 24 Jul 2017 17:25:37 -0700 Subject: [PATCH] Backed out changeset 2e0c2b3bc28b (bug 1380065) for eslint failures in browser_ext_popup_select.js a=backout MozReview-Commit-ID: HZqI6A06YiO --- .../test/about/browser_aboutStopReload.js | 7 ------- .../alerts/browser_notification_tab_switching.js | 7 ------- .../test/general/browser_alltabslistener.js | 8 -------- .../performance/browser_tabclose_grow_reflows.js | 7 ------- .../test/performance/browser_tabclose_reflows.js | 7 ------- .../test/performance/browser_tabopen_reflows.js | 7 ------- .../browser_tabopen_squeeze_reflows.js | 7 ------- .../base/content/test/popupNotifications/head.js | 5 ----- .../test/siteIdentity/browser_bug902156.js | 8 +------- .../test/tabcrashed/browser_noPermanentKey.js | 7 ------- .../test/tabcrashed/browser_withoutDump.js | 5 ----- .../content/test/tabs/browser_tabCloseProbes.js | 6 +----- .../test/urlbar/browser_page_action_menu.js | 7 ------- .../test/browser/browser_ext_popup_select.js | 7 ------- .../tests/browser/browser_undo_notification.js | 8 -------- .../browser/browser_ProcessHangNotifications.js | 7 ------- .../browser/browser_UnsubmittedCrashHandler.js | 5 ----- dom/html/test/test_fullscreen-api-race.html | 8 -------- testing/profiles/prefs_general.js | 3 --- toolkit/content/tests/chrome/test_arrowpanel.xul | 7 ------- toolkit/content/tests/chrome/test_bug457632.xul | 10 ++-------- .../tests/mochitest/test_mousecapture.xhtml | 7 ------- toolkit/content/widgets/popup.xml | 16 +--------------- toolkit/themes/osx/mochitests/test_bug510426.xul | 12 ++++++++---- 24 files changed, 13 insertions(+), 165 deletions(-) diff --git a/browser/base/content/test/about/browser_aboutStopReload.js b/browser/base/content/test/about/browser_aboutStopReload.js index 90eee47d84ab..85162d73a80d 100644 --- a/browser/base/content/test/about/browser_aboutStopReload.js +++ b/browser/base/content/test/about/browser_aboutStopReload.js @@ -11,13 +11,6 @@ function stopReloadMutationCallback() { Assert.ok(false, "stop-reload's animate attribute should not have been mutated"); } -// run these tests with notification animations enabled -add_task(async function setup() { - await SpecialPowers.pushPrefEnv({ - "set": [["toolkit.cosmeticAnimations.enabled", true]] - }); -}); - add_task(async function checkDontShowStopOnNewTab() { let stopReloadContainer = document.getElementById("stop-reload-button"); let stopReloadContainerObserver = new MutationObserver(stopReloadMutationCallback); diff --git a/browser/base/content/test/alerts/browser_notification_tab_switching.js b/browser/base/content/test/alerts/browser_notification_tab_switching.js index 709583f0dfc5..47d0f8f56305 100644 --- a/browser/base/content/test/alerts/browser_notification_tab_switching.js +++ b/browser/base/content/test/alerts/browser_notification_tab_switching.js @@ -9,13 +9,6 @@ var notification; var notificationURL = "http://example.org/browser/browser/base/content/test/alerts/file_dom_notifications.html"; var newWindowOpenedFromTab; -// run these tests with notification animations enabled -add_task(async function setup() { - await SpecialPowers.pushPrefEnv({ - "set": [["toolkit.cosmeticAnimations.enabled", true]] - }); -}); - add_task(async function test_notificationPreventDefaultAndSwitchTabs() { let pm = Services.perms; pm.add(makeURI(notificationURL), "desktop-notification", pm.ALLOW_ACTION); diff --git a/browser/base/content/test/general/browser_alltabslistener.js b/browser/base/content/test/general/browser_alltabslistener.js index 58fd969acf24..e8e9c0ad8330 100644 --- a/browser/base/content/test/general/browser_alltabslistener.js +++ b/browser/base/content/test/general/browser_alltabslistener.js @@ -84,17 +84,9 @@ var gTestPage = "/browser/browser/base/content/test/general/alltabslistener.html const kBasePage = "http://example.org/browser/browser/base/content/test/general/dummy_page.html"; var gNextTest; - function test() { waitForExplicitFinish(); - // run these tests with notification animations enabled - const origAnimationsPrefValue = Services.prefs.getBoolPref("toolkit.cosmeticAnimations.enabled"); - Services.prefs.setBoolPref("toolkit.cosmeticAnimations.enabled", true); - registerCleanupFunction(() => { - Services.prefs.setBoolPref("toolkit.cosmeticAnimations.enabled", origAnimationsPrefValue); - }); - gBackgroundTab = BrowserTestUtils.addTab(gBrowser); gForegroundTab = BrowserTestUtils.addTab(gBrowser); gBackgroundBrowser = gBrowser.getBrowserForTab(gBackgroundTab); diff --git a/browser/base/content/test/performance/browser_tabclose_grow_reflows.js b/browser/base/content/test/performance/browser_tabclose_grow_reflows.js index 6779a32f346b..5ce742719687 100644 --- a/browser/base/content/test/performance/browser_tabclose_grow_reflows.js +++ b/browser/base/content/test/performance/browser_tabclose_grow_reflows.js @@ -15,13 +15,6 @@ const EXPECTED_REFLOWS = [ */ ]; -// run these tests with notification animations enabled -add_task(async function setup() { - await SpecialPowers.pushPrefEnv({ - "set": [["toolkit.cosmeticAnimations.enabled", true]] - }); -}); - /* * This test ensures that there are no unexpected * uninterruptible reflows when closing a tab that will diff --git a/browser/base/content/test/performance/browser_tabclose_reflows.js b/browser/base/content/test/performance/browser_tabclose_reflows.js index 08999e4e49f3..85089ff533eb 100644 --- a/browser/base/content/test/performance/browser_tabclose_reflows.js +++ b/browser/base/content/test/performance/browser_tabclose_reflows.js @@ -15,13 +15,6 @@ const EXPECTED_REFLOWS = [ */ ]; -// run these tests with notification animations enabled -add_task(async function setup() { - await SpecialPowers.pushPrefEnv({ - "set": [["toolkit.cosmeticAnimations.enabled", true]] - }); -}); - /* * This test ensures that there are no unexpected * uninterruptible reflows when closing new tabs. diff --git a/browser/base/content/test/performance/browser_tabopen_reflows.js b/browser/base/content/test/performance/browser_tabopen_reflows.js index 5bd36a0f2e4a..1fe7363a5e9d 100644 --- a/browser/base/content/test/performance/browser_tabopen_reflows.js +++ b/browser/base/content/test/performance/browser_tabopen_reflows.js @@ -20,13 +20,6 @@ const EXPECTED_REFLOWS = [ ], ]; -// run these tests with notification animations enabled -add_task(async function setup() { - await SpecialPowers.pushPrefEnv({ - "set": [["toolkit.cosmeticAnimations.enabled", true]] - }); -}); - /* * This test ensures that there are no unexpected * uninterruptible reflows when opening new tabs. diff --git a/browser/base/content/test/performance/browser_tabopen_squeeze_reflows.js b/browser/base/content/test/performance/browser_tabopen_squeeze_reflows.js index 295150424143..6776864c91a1 100644 --- a/browser/base/content/test/performance/browser_tabopen_squeeze_reflows.js +++ b/browser/base/content/test/performance/browser_tabopen_squeeze_reflows.js @@ -17,13 +17,6 @@ const EXPECTED_REFLOWS = [ ], ]; -// run these tests with notification animations enabled -add_task(async function setup() { - await SpecialPowers.pushPrefEnv({ - "set": [["toolkit.cosmeticAnimations.enabled", true]] - }); -}); - /* * This test ensures that there are no unexpected * uninterruptible reflows when opening a new tab that will diff --git a/browser/base/content/test/popupNotifications/head.js b/browser/base/content/test/popupNotifications/head.js index 6484a860746a..c7a433a0ce37 100644 --- a/browser/base/content/test/popupNotifications/head.js +++ b/browser/base/content/test/popupNotifications/head.js @@ -68,16 +68,11 @@ const PREF_SECURITY_DELAY_INITIAL = Services.prefs.getIntPref("security.notifica // tests to be run. /* global tests */ function setup() { - // run these tests with notification animations enabled - const origAnimationsPrefValue = Services.prefs.getBoolPref("toolkit.cosmeticAnimations.enabled"); - Services.prefs.setBoolPref("toolkit.cosmeticAnimations.enabled", true); - BrowserTestUtils.openNewForegroundTab(gBrowser, "http://example.com/") .then(goNext); registerCleanupFunction(() => { gBrowser.removeTab(gBrowser.selectedTab); PopupNotifications.buttonDelay = PREF_SECURITY_DELAY_INITIAL; - Services.prefs.setBoolPref("toolkit.cosmeticAnimations.enabled", origAnimationsPrefValue); }); } diff --git a/browser/base/content/test/siteIdentity/browser_bug902156.js b/browser/base/content/test/siteIdentity/browser_bug902156.js index f00f39fc1bbd..db0373e1303f 100644 --- a/browser/base/content/test/siteIdentity/browser_bug902156.js +++ b/browser/base/content/test/siteIdentity/browser_bug902156.js @@ -23,20 +23,17 @@ */ const PREF_ACTIVE = "security.mixed_content.block_active_content"; -const ANIMATIONS_ENABLED = "toolkit.cosmeticAnimations.enabled"; // We alternate for even and odd test cases to simulate different hosts const HTTPS_TEST_ROOT_1 = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "https://test1.example.com"); const HTTPS_TEST_ROOT_2 = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "https://test2.example.com"); var origBlockActive; -var origAnimationsPrefValue; var gTestBrowser = null; registerCleanupFunction(function() { // Set preferences back to their original values Services.prefs.setBoolPref(PREF_ACTIVE, origBlockActive); - Services.prefs.setBoolPref(ANIMATIONS_ENABLED, origAnimationsPrefValue); }); function cleanUpAfterTests() { @@ -161,11 +158,8 @@ function test() { // Store original preferences so we can restore settings after testing origBlockActive = Services.prefs.getBoolPref(PREF_ACTIVE); - origAnimationsPrefValue = Services.prefs.getBoolPref(ANIMATIONS_ENABLED); -Services.prefs.setBoolPref(PREF_ACTIVE, true); - // run these tests with animations enabled - Services.prefs.setBoolPref(ANIMATIONS_ENABLED, true); + Services.prefs.setBoolPref(PREF_ACTIVE, true); // Not really sure what this is doing var newTab = BrowserTestUtils.addTab(gBrowser); diff --git a/browser/base/content/test/tabcrashed/browser_noPermanentKey.js b/browser/base/content/test/tabcrashed/browser_noPermanentKey.js index c88ef7a87242..b31aa1d2ab10 100644 --- a/browser/base/content/test/tabcrashed/browser_noPermanentKey.js +++ b/browser/base/content/test/tabcrashed/browser_noPermanentKey.js @@ -2,13 +2,6 @@ const PAGE = "data:text/html,A%20regular,%20everyday,%20normal%20page."; -// run these tests with notification animations enabled -add_task(async function setup() { - await SpecialPowers.pushPrefEnv({ - "set": [["toolkit.cosmeticAnimations.enabled", true]] - }); -}); - add_task(async function setup() { await setupLocalCrashReportServer(); }); diff --git a/browser/base/content/test/tabcrashed/browser_withoutDump.js b/browser/base/content/test/tabcrashed/browser_withoutDump.js index 0973b11ae429..62d997240af4 100644 --- a/browser/base/content/test/tabcrashed/browser_withoutDump.js +++ b/browser/base/content/test/tabcrashed/browser_withoutDump.js @@ -5,13 +5,8 @@ const PAGE = "data:text/html,A%20regular,%20everyday,%20normal%20pag /** * Monkey patches TabCrashHandler.getDumpID to return null in order to test * about:tabcrashed when a dump is not available. - * Set pref to ensure these tests are run with notification animations enabled */ add_task(async function setup() { - // run these tests with animations enabled - await SpecialPowers.pushPrefEnv({ - "set": [["toolkit.cosmeticAnimations.enabled", true]] - }); let originalGetDumpID = TabCrashHandler.getDumpID; TabCrashHandler.getDumpID = function(browser) { return null; }; registerCleanupFunction(() => { diff --git a/browser/base/content/test/tabs/browser_tabCloseProbes.js b/browser/base/content/test/tabs/browser_tabCloseProbes.js index ed514d4df23c..c3669cb51062 100644 --- a/browser/base/content/test/tabs/browser_tabCloseProbes.js +++ b/browser/base/content/test/tabs/browser_tabCloseProbes.js @@ -27,12 +27,8 @@ function assertCount(snapshot, expectedCount) { add_task(async function setup() { // These probes are opt-in, meaning we only capture them if extended // Telemetry recording is enabled. - // Run these tests with animations enabled await SpecialPowers.pushPrefEnv({ - set: [ - ["toolkit.telemetry.enabled", true], - ["toolkit.cosmeticAnimations.enabled", true] - ] + set: [["toolkit.telemetry.enabled", true]] }); let oldCanRecord = Services.telemetry.canRecordExtended; diff --git a/browser/base/content/test/urlbar/browser_page_action_menu.js b/browser/base/content/test/urlbar/browser_page_action_menu.js index 3c431aafc166..2b45412cc56f 100644 --- a/browser/base/content/test/urlbar/browser_page_action_menu.js +++ b/browser/base/content/test/urlbar/browser_page_action_menu.js @@ -15,13 +15,6 @@ const mockRemoteClients = [ { id: "2", name: "baz", type: "mobile" }, ]; -// run these tests with animations enabled -add_task(async function setup() { - await SpecialPowers.pushPrefEnv({ - "set": [["toolkit.cosmeticAnimations.enabled", true]] - }); -}); - add_task(async function bookmark() { // Open a unique page. let url = "http://example.com/browser_page_action_menu"; diff --git a/browser/components/extensions/test/browser/browser_ext_popup_select.js b/browser/components/extensions/test/browser/browser_ext_popup_select.js index 22297b100e1a..d2b786edbaec 100644 --- a/browser/components/extensions/test/browser/browser_ext_popup_select.js +++ b/browser/components/extensions/test/browser/browser_ext_popup_select.js @@ -2,13 +2,6 @@ /* vim: set sts=2 sw=2 et tw=80: */ "use strict"; -// run these tests with animations enabled -add_task(async function setup() { - await SpecialPowers.pushPrefEnv({ - "set": [["toolkit.cosmeticAnimations.enabled", true]] - }); -}); - add_task(async function testPopupSelectPopup() { let extension = ExtensionTestUtils.loadExtension({ background() { diff --git a/browser/components/migration/tests/browser/browser_undo_notification.js b/browser/components/migration/tests/browser/browser_undo_notification.js index 5119191eba0b..a4d470548cbc 100644 --- a/browser/components/migration/tests/browser/browser_undo_notification.js +++ b/browser/components/migration/tests/browser/browser_undo_notification.js @@ -4,7 +4,6 @@ let scope = {}; Cu.import("resource:///modules/AutoMigrate.jsm", scope); let oldCanUndo = scope.AutoMigrate.canUndo; let oldUndo = scope.AutoMigrate.undo; - registerCleanupFunction(function() { scope.AutoMigrate.canUndo = oldCanUndo; scope.AutoMigrate.undo = oldUndo; @@ -12,13 +11,6 @@ registerCleanupFunction(function() { const kExpectedNotificationId = "automigration-undo"; -// run these tests with notification animations enabled -add_task(async function setup() { - await SpecialPowers.pushPrefEnv({ - "set": [["toolkit.cosmeticAnimations.enabled", true]] - }); -}); - add_task(async function autoMigrationUndoNotificationShows() { let getNotification = browser => gBrowser.getNotificationBox(browser).getNotificationWithValue(kExpectedNotificationId); diff --git a/browser/modules/test/browser/browser_ProcessHangNotifications.js b/browser/modules/test/browser/browser_ProcessHangNotifications.js index 729475104e0f..bc9ffe5512d8 100644 --- a/browser/modules/test/browser/browser_ProcessHangNotifications.js +++ b/browser/modules/test/browser/browser_ProcessHangNotifications.js @@ -26,13 +26,6 @@ function promiseReportCallMade(aValue) { }); } -// run these tests with notification animations enabled -add_task(async function setup() { - await SpecialPowers.pushPrefEnv({ - "set": [["toolkit.cosmeticAnimations.enabled", true]] - }); -}); - function pushPrefs(...aPrefs) { return SpecialPowers.pushPrefEnv({"set": aPrefs}); } diff --git a/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js b/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js index d861ea099621..64efb17fa7f1 100644 --- a/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js +++ b/browser/modules/test/browser/browser_UnsubmittedCrashHandler.js @@ -172,11 +172,6 @@ function waitForIgnoredReports(reportIDs) { let gNotificationBox; add_task(async function setup() { - // run these tests with notification animations enabled - await SpecialPowers.pushPrefEnv({ - "set": [["toolkit.cosmeticAnimations.enabled", true]] - }); - // Pending crash reports are stored in the UAppData folder, // which exists outside of the profile folder. In order to // not overwrite / clear pending crash reports for the poor diff --git a/dom/html/test/test_fullscreen-api-race.html b/dom/html/test/test_fullscreen-api-race.html index 68219dc3ac0c..03c6c6da3aa5 100644 --- a/dom/html/test/test_fullscreen-api-race.html +++ b/dom/html/test/test_fullscreen-api-race.html @@ -22,14 +22,6 @@ function checkIsChromeFullscreen(win, inFullscreen) { } SimpleTest.waitForExplicitFinish(); - -// run these tests with animations enabled -const origAnimationsPrefValue = SpecialPowers.getBoolPref("toolkit.cosmeticAnimations.enabled"); -SpecialPowers.setBoolPref("toolkit.cosmeticAnimations.enabled", true); -SimpleTest.registerCleanupFunction(() => { - SpecialPowers.setBoolPref("toolkit.cosmeticAnimations.enabled", origAnimationsPrefValue); -}); - // XXX This actually exposes a true race condition, but it could rarely // happen in real world, because it only happens when requestFullscreen // is called immediately after exiting fullscreen in certain condition, diff --git a/testing/profiles/prefs_general.js b/testing/profiles/prefs_general.js index 7bf6429fb33b..16fa89a2ab1d 100644 --- a/testing/profiles/prefs_general.js +++ b/testing/profiles/prefs_general.js @@ -260,9 +260,6 @@ user_pref("toolkit.telemetry.newProfilePing.enabled", false); user_pref("toolkit.telemetry.test.pref1", true); user_pref("toolkit.telemetry.test.pref2", false); -// Disable cosmetic-only UI animations and transitions -user_pref("toolkit.cosmeticAnimations.enabled", false); - // We don't want to hit the real Firefox Accounts server for tests. We don't // actually need a functioning FxA server, so just set it to something that // resolves and accepts requests, even if they all fail. diff --git a/toolkit/content/tests/chrome/test_arrowpanel.xul b/toolkit/content/tests/chrome/test_arrowpanel.xul index ee452d4ebe33..6ba6ba2791f0 100644 --- a/toolkit/content/tests/chrome/test_arrowpanel.xul +++ b/toolkit/content/tests/chrome/test_arrowpanel.xul @@ -194,10 +194,6 @@ function* nextTest() } } - // Run this check with animations enabled - let origPrefValue = SpecialPowers.getBoolPref("toolkit.cosmeticAnimations.enabled"); - SpecialPowers.setBoolPref("toolkit.cosmeticAnimations.enabled", true); - // Check that the transition occurs for an arrow panel with animate="true" window.addEventListener("transitionend", transitionEnded, false); $("animatepanel").openPopup($("topleft"), "after_start", 0, 0, false, false, null, "start"); @@ -208,9 +204,6 @@ function* nextTest() synthesizeKey("VK_ESCAPE", { }); ok(!animatedPopupHidden, "animated popup not hidden yet"); yield; - - // restore the pref value - SpecialPowers.setBoolPref("toolkit.cosmeticAnimations.enabled", origPrefValue); } SimpleTest.finish() diff --git a/toolkit/content/tests/chrome/test_bug457632.xul b/toolkit/content/tests/chrome/test_bug457632.xul index 598c14f8caa8..7bc70f2cc378 100644 --- a/toolkit/content/tests/chrome/test_bug457632.xul +++ b/toolkit/content/tests/chrome/test_bug457632.xul @@ -6,7 +6,7 @@ --> - + @@ -28,14 +28,8 @@ function completeAnimation(nextTest) { setTimeout(completeAnimation, 50, nextTest); } -async function test() { +function test() { SimpleTest.waitForExplicitFinish(); - - // run these tests with notification animations enabled - await SpecialPowers.pushPrefEnv({ - "set": [["toolkit.cosmeticAnimations.enabled", true]] - }); - gNotificationBox = document.getElementById("nb"); is(gNotificationBox.allNotifications.length, 0, "There should be no initial notifications"); diff --git a/toolkit/content/tests/mochitest/test_mousecapture.xhtml b/toolkit/content/tests/mochitest/test_mousecapture.xhtml index 5b1c85bd96ef..75edadf1a9ac 100644 --- a/toolkit/content/tests/mochitest/test_mousecapture.xhtml +++ b/toolkit/content/tests/mochitest/test_mousecapture.xhtml @@ -25,13 +25,6 @@ var cachedMouseDown = null; var previousWidth = 0, originalWidth = 0; var loadInWindow = false; - // run these tests with animations enabled -const origAnimationsPrefValue = SpecialPowers.getBoolPref("toolkit.cosmeticAnimations.enabled"); -SpecialPowers.setBoolPref("toolkit.cosmeticAnimations.enabled", true); -SimpleTest.registerCleanupFunction(() => { - SpecialPowers.setBoolPref("toolkit.cosmeticAnimations.enabled", origAnimationsPrefValue); -}) - function splitterCallback(adjustment) { var newWidth = Number($("leftbox").width); // getBoundingClientRect().width; var expectedWidth = previousWidth + adjustment; diff --git a/toolkit/content/widgets/popup.xml b/toolkit/content/widgets/popup.xml index 4bfc3ce45da4..94d013e2c0ef 100644 --- a/toolkit/content/widgets/popup.xml +++ b/toolkit/content/widgets/popup.xml @@ -402,7 +402,6 @@ null - null @@ -488,16 +487,6 @@ this.removeAttribute("panelopen"); - - if (this._previousAnimateAttrValue == "false") { - this.setAttribute("animate", this._previousAnimateAttrValue); - } else { + if (this.getAttribute("animate") != "false") { this.removeAttribute("animate"); } diff --git a/toolkit/themes/osx/mochitests/test_bug510426.xul b/toolkit/themes/osx/mochitests/test_bug510426.xul index 54d5fda3361f..4294ce42de34 100644 --- a/toolkit/themes/osx/mochitests/test_bug510426.xul +++ b/toolkit/themes/osx/mochitests/test_bug510426.xul @@ -37,10 +37,14 @@ function openNotification() { callback: null, popup: null }]); - setTimeout(function () { - is(n.getBoundingClientRect().height, 27, "notification bar has wrong height"); - SimpleTest.finish(); - }, 0); + n.addEventListener("transitionend", function (event) { + if (event.propertyName == "margin-top") { + setTimeout(function () { + is(n.getBoundingClientRect().height, 27, "notification bar has wrong height"); + SimpleTest.finish(); + }, 0); + } + }, false); } window.onload = openNotification;