Backed out changeset 5d7640ffbf2a (bug 1595135) for causing bc failures in toolkit/components/thumbnails CLOSED TREE
authorMihai Alexandru Michis <malexandru@mozilla.com>
Thu, 14 Nov 2019 18:34:47 +0200
changeset 501974 f09b9242197689e2949df164e6d628a01593b526
parent 501973 5c9324524d5148b1ae6963768dad2f0d3779f8c1
child 501975 8c1ac1675109471d8e302229f34998b6d4e73928
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1595135
milestone72.0a1
backs out5d7640ffbf2ad18d3bc99bac56b6500d80db987b
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 5d7640ffbf2a (bug 1595135) for causing bc failures in toolkit/components/thumbnails CLOSED TREE
toolkit/components/thumbnails/BackgroundPageThumbs.jsm
toolkit/components/thumbnails/content/backgroundPageThumbsContent.js
--- a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
+++ b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
@@ -1,18 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const EXPORTED_SYMBOLS = ["BackgroundPageThumbs"];
 
 const DEFAULT_CAPTURE_TIMEOUT = 30000; // ms
-// For testing, the above timeout is excessive, and makes our tests overlong.
-const TESTING_CAPTURE_TIMEOUT = 5000; // ms
-
 const DESTROY_BROWSER_TIMEOUT = 60000; // ms
 const FRAME_SCRIPT_URL =
   "chrome://global/content/backgroundPageThumbsContent.js";
 
 const TELEMETRY_HISTOGRAM_ID_PREFIX = "FX_THUMBNAILS_BG_";
 
 const ABOUT_NEWTAB_SEGREGATION_PREF =
   "privacy.usercontext.about_newtab_segregation.enabled";
@@ -471,25 +468,21 @@ Capture.prototype = {
    * Sends a message to the content script to start the capture.
    *
    * @param messageManager  The nsIMessageSender of the thumbnail browser.
    */
   start(messageManager) {
     this.startDate = new Date();
     tel("CAPTURE_QUEUE_TIME_MS", this.startDate - this.creationDate);
 
-    let fallbackTimeout = Cu.isInAutomation
-      ? TESTING_CAPTURE_TIMEOUT
-      : DEFAULT_CAPTURE_TIMEOUT;
-
     // timeout timer
     let timeout =
       typeof this.options.timeout == "number"
         ? this.options.timeout
-        : fallbackTimeout;
+        : DEFAULT_CAPTURE_TIMEOUT;
     this._timeoutTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
     this._timeoutTimer.initWithCallback(
       this,
       timeout,
       Ci.nsITimer.TYPE_ONE_SHOT
     );
 
     // didCapture registration
--- a/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js
+++ b/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js
@@ -12,18 +12,16 @@ const { XPCOMUtils } = ChromeUtils.impor
 );
 const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyGlobalGetters(this, ["Blob", "FileReader"]);
 
 // Let the page settle for this amount of milliseconds before capturing to allow
 // for any in-page changes or redirects.
 const SETTLE_WAIT_TIME = 2500;
-// For testing, the above timeout is excessive, and makes our tests overlong.
-const TESTING_SETTLE_WAIT_TIME = 0;
 
 const STATE_LOADING = 1;
 const STATE_CAPTURING = 2;
 const STATE_CANCELED = 3;
 
 // NOTE: Copied from nsSandboxFlags.h
 /**
  * This flag prevents content from creating new auxiliary browsing contexts,
@@ -137,36 +135,33 @@ const backgroundPageThumbsContent = {
         } else if (this._state == STATE_CANCELED) {
           delete this._currentCapture;
           this._startNextCapture();
         }
       } else if (
         this._state == STATE_LOADING &&
         (Components.isSuccessCode(status) || status === Cr.NS_BINDING_ABORTED)
       ) {
-        let waitTime = Cu.isInAutomation
-          ? TESTING_SETTLE_WAIT_TIME
-          : SETTLE_WAIT_TIME;
         // The requested page has loaded or stopped/aborted, so capture the page
         // soon but first let it settle in case of in-page redirects
         if (this._captureTimer) {
           // There was additional activity, so restart the wait timer
-          this._captureTimer.delay = waitTime;
+          this._captureTimer.delay = SETTLE_WAIT_TIME;
         } else {
           // Stay in LOADING until we're actually ready to be CAPTURING
           this._captureTimer = Cc["@mozilla.org/timer;1"].createInstance(
             Ci.nsITimer
           );
           this._captureTimer.init(
             () => {
               this._state = STATE_CAPTURING;
               this._captureCurrentPage();
               delete this._captureTimer;
             },
-            waitTime,
+            SETTLE_WAIT_TIME,
             Ci.nsITimer.TYPE_ONE_SHOT
           );
         }
       } else if (this._state != STATE_CANCELED) {
         // Something went wrong.  Cancel the capture.  Loading about:blank
         // while onStateChange is still on the stack does not actually stop
         // the request if it redirects, so do it asyncly.
         this._state = STATE_CANCELED;