зеркало из https://github.com/mozilla/gecko-dev.git
Bug 916735 - use a pref to fast-forward animation for tests, r=Unfocused
This commit is contained in:
Родитель
3e74dc00f9
Коммит
04333b296d
|
@ -9,6 +9,7 @@ this.EXPORTED_SYMBOLS = ["CustomizeMode"];
|
|||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
||||
const kPrefCustomizationDebug = "browser.uiCustomization.debug";
|
||||
const kPrefCustomizationAnimation = "browser.uiCustomization.disableAnimation";
|
||||
const kPaletteId = "customization-palette";
|
||||
const kAboutURI = "about:customizing";
|
||||
const kDragDataTypePrefix = "text/toolbarwrapper-id/";
|
||||
|
@ -27,7 +28,13 @@ Cu.import("resource://gre/modules/Promise.jsm");
|
|||
let gModuleName = "[CustomizeMode]";
|
||||
#include logging.js
|
||||
|
||||
let gDisableAnimation = null;
|
||||
|
||||
function CustomizeMode(aWindow) {
|
||||
if (gDisableAnimation === null) {
|
||||
gDisableAnimation = Services.prefs.getPrefType(kPrefCustomizationAnimation) == Ci.nsIPrefBranch.PREF_BOOL &&
|
||||
Services.prefs.getBoolPref(kPrefCustomizationAnimation);
|
||||
}
|
||||
this.window = aWindow;
|
||||
this.document = aWindow.document;
|
||||
this.browser = aWindow.gBrowser;
|
||||
|
@ -293,6 +300,9 @@ CustomizeMode.prototype = {
|
|||
}.bind(this);
|
||||
deck.addEventListener("transitionend", customizeTransitionEnd);
|
||||
|
||||
if (gDisableAnimation) {
|
||||
deck.setAttribute("fastcustomizeanimation", true);
|
||||
}
|
||||
if (aEntering) {
|
||||
this.document.documentElement.setAttribute("customizing", true);
|
||||
} else {
|
||||
|
|
|
@ -174,6 +174,7 @@ function waitForCondition(aConditionFn, aMaxTries=50, aCheckInterval=100) {
|
|||
}
|
||||
|
||||
function testRunner(testAry, asyncCleanup) {
|
||||
Services.prefs.setBoolPref("browser.uiCustomization.disableAnimation", true);
|
||||
for (let test of testAry) {
|
||||
info(test.desc);
|
||||
|
||||
|
@ -191,6 +192,7 @@ function testRunner(testAry, asyncCleanup) {
|
|||
yield asyncCleanup();
|
||||
}
|
||||
ok(CustomizableUI.inDefaultState, "Should remain in default state");
|
||||
Services.prefs.clearUserPref("browser.uiCustomization.disableAnimation");
|
||||
}
|
||||
|
||||
function runTests(testAry, asyncCleanup) {
|
||||
|
|
|
@ -10,6 +10,11 @@
|
|||
transition-timing-function: ease-out;
|
||||
}
|
||||
|
||||
#tab-view-deck[fastcustomizeanimation] {
|
||||
transition-duration: 1ms;
|
||||
transition-timing-function: linear;
|
||||
}
|
||||
|
||||
#main-window[customizing] .customization-target {
|
||||
margin: 3px;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче