Bug 1379896 - Disable cosmetic animations in mozscreenshots. r=MattN draft
authorJohann Hofmann <jhofmann@mozilla.com>
Tue, 11 Jul 2017 09:31:20 +0200
changeset 606636 045bf5ea03fd8b10c1d5cb05abe3aee871b0f1e4
parent 606556 0e41d07a703f19224f60b01577b2cbb5708046c9
child 636817 df71f782f280f8f1eebc5a0c701d6d08b27c65ea
push id67755
push userbmo:jhofmann@mozilla.com
push dateTue, 11 Jul 2017 07:31:46 +0000
reviewersMattN
bugs1379896
milestone56.0a1
Bug 1379896 - Disable cosmetic animations in mozscreenshots. r=MattN MozReview-Commit-ID: AWM1jgdpb9u
browser/tools/mozscreenshots/mozscreenshots/extension/TestRunner.jsm
--- 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));