Bug 1379896 - Disable cosmetic animations in mozscreenshots. r=MattN
MozReview-Commit-ID: AWM1jgdpb9u
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/TestRunner.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/TestRunner.jsm
@@ -83,16 +83,19 @@ this.TestRunner = {
this._lastCombo = null;
// Setup some prefs
Services.prefs.setCharPref("browser.aboutHomeSnippets.updateUrl",
"data:text/html;charset=utf-8,Generated by mozscreenshots");
Services.prefs.setCharPref("extensions.ui.lastCategory", "addons://list/extension");
// Don't let the caret blink since it causes false positives for image diffs
Services.prefs.setIntPref("ui.caretBlinkTime", -1);
+ // Disable some animations that can cause false positives, such as the
+ // reload/stop button spinning animation.
+ Services.prefs.setBoolPref("toolkit.cosmeticAnimations.enabled", false);
let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
// When being automated through Marionette, Firefox shows a prominent indication
// in the urlbar and identity block. We don't want this to show when testing browser UI.
// Note that this doesn't prevent subsequently opened windows from showing the automation UI.
browserWindow.document.getElementById("main-window").removeAttribute("remotecontrol");
@@ -146,16 +149,17 @@ this.TestRunner = {
let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
let gBrowser = browserWindow.gBrowser;
while (gBrowser.tabs.length > 1) {
gBrowser.removeTab(gBrowser.selectedTab, {animate: false});
}
gBrowser.unpinTab(gBrowser.selectedTab);
gBrowser.selectedBrowser.loadURI("data:text/html;charset=utf-8,<h1>Done!");
browserWindow.restore();
+ Services.prefs.clearUserPref("toolkit.cosmeticAnimations.enabled");
},
// helpers
async _performCombo(combo) {
let paddedComboIndex = padLeft(this.currentComboIndex + 1, String(this.combos.length).length);
log.info("Combination " + paddedComboIndex + "/" + this.combos.length + ": " +
this._comboName(combo).substring(1));