зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 2e0c2b3bc28b (bug 1380065) for eslint failures in browser_ext_popup_select.js a=backout
MozReview-Commit-ID: HZqI6A06YiO
This commit is contained in:
Родитель
e044c4fc6f
Коммит
4d4051d2e2
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -2,13 +2,6 @@
|
|||
|
||||
const PAGE = "data:text/html,<html><body>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();
|
||||
});
|
||||
|
|
|
@ -5,13 +5,8 @@ const PAGE = "data:text/html,<html><body>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(() => {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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});
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
-->
|
||||
<window title="Bug 457632" width="500" height="600"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<notificationbox id="nb"/>
|
||||
|
||||
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -402,7 +402,6 @@
|
|||
</content>
|
||||
<implementation>
|
||||
<field name="_fadeTimer">null</field>
|
||||
<field name="_previousAnimateAttrValue">null</field>
|
||||
<method name="sizeTo">
|
||||
<parameter name="aWidth"/>
|
||||
<parameter name="aHeight"/>
|
||||
|
@ -488,16 +487,6 @@
|
|||
<handlers>
|
||||
<handler event="popupshowing" phase="target">
|
||||
<![CDATA[
|
||||
let prefsService = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
let animationsEnabled = prefsService.getBoolPref("toolkit.cosmeticAnimations.enabled");
|
||||
if (!animationsEnabled) {
|
||||
this._previousAnimateAttrValue = this.getAttribute("animate");
|
||||
this.setAttribute("animate", "false");
|
||||
} else {
|
||||
this._previousAnimateAttrValue = null;
|
||||
}
|
||||
|
||||
var arrow = document.getAnonymousElementByAttribute(this, "anonid", "arrow");
|
||||
arrow.hidden = this.anchorNode == null;
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "arrowbox")
|
||||
|
@ -540,10 +529,7 @@
|
|||
</handler>
|
||||
<handler event="popuphidden" phase="target">
|
||||
this.removeAttribute("panelopen");
|
||||
|
||||
if (this._previousAnimateAttrValue == "false") {
|
||||
this.setAttribute("animate", this._previousAnimateAttrValue);
|
||||
} else {
|
||||
if (this.getAttribute("animate") != "false") {
|
||||
this.removeAttribute("animate");
|
||||
}
|
||||
</handler>
|
||||
|
|
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче