Bug 1480953 - Force disabling tab animations in DAMP. r=jdescottes, a=RyanVM
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 31 Oct 2018 14:42:48 +0000
changeset 500982 c79685defc28ae220abf01b05485536ac32c51bb
parent 500981 e062a0236c8e7167bcb1b7f72e7c867f98a49dc3
child 500983 fa0dfb7abb5e0cc2466860580082c620e7819c86
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes, RyanVM
bugs1480953
milestone64.0
Bug 1480953 - Force disabling tab animations in DAMP. r=jdescottes, a=RyanVM We used to have animations during tab opening/closing, but this was introducing intermittents as we were not correctly waiting for animation's end. MozReview-Commit-ID: 2mscsA8Uosd Differential Revision: https://phabricator.services.mozilla.com/D10263
testing/talos/talos/tests/devtools/addon/content/damp.js
testing/talos/talos/tests/devtools/addon/content/tests/netmonitor/complicated.js
--- a/testing/talos/talos/tests/devtools/addon/content/damp.js
+++ b/testing/talos/talos/tests/devtools/addon/content/damp.js
@@ -152,17 +152,20 @@ Damp.prototype = {
         } else if (DEBUG_ALLOCATIONS == "verbose") {
           this.allocationTracker.logAllocationSites();
         }
       },
     };
   },
 
   async addTab(url) {
-    let tab = this._win.gBrowser.selectedTab = this._win.gBrowser.addTrustedTab(url);
+    // Disable opening animation to avoid intermittents and prevent having to wait for
+    // animation's end. (See bug 1480953)
+    let tab = this._win.gBrowser.selectedTab = this._win.gBrowser.addTrustedTab(url,
+      { skipAnimation: true });
     let browser = tab.linkedBrowser;
     await awaitBrowserLoaded(browser);
     return tab;
   },
 
   async waitForPendingPaints(window) {
     let utils = window.windowUtils;
     window.performance.mark("pending paints.start");
@@ -172,21 +175,16 @@ Damp.prototype = {
           window.performance.mark("pending paint");
           done();
         }, { once: true });
       });
     }
     window.performance.measure("pending paints", "pending paints.start");
   },
 
-  closeCurrentTab() {
-    this._win.BrowserCloseTabOrWindow();
-    return this._win.gBrowser.selectedTab;
-  },
-
   reloadPage(onReload) {
     return new Promise(resolve => {
       let browser = gBrowser.selectedBrowser;
       if (typeof(onReload) == "function") {
         onReload().then(resolve);
       } else {
         resolve(awaitBrowserLoaded(browser));
       }
@@ -198,17 +196,19 @@ Damp.prototype = {
     let tab = await this.addTab(url);
     await new Promise(resolve => {
       setTimeout(resolve, 100);
     });
     return tab;
   },
 
   async testTeardown(url) {
-    this.closeCurrentTab();
+    // Disable closing animation to avoid intermittents and prevent having to wait for
+    // animation's end. (See bug 1480953)
+    this._win.gBrowser.removeCurrentTab({ animate: false });
 
     // Force freeing memory now so that it doesn't happen during the next test
     await this.garbageCollect();
 
     let duration = Math.round(performance.now() - this._startTime);
     dump(`${this._currentTest} took ${duration}ms.\n`);
 
     this._runNextTest();
--- a/testing/talos/talos/tests/devtools/addon/content/tests/netmonitor/complicated.js
+++ b/testing/talos/talos/tests/devtools/addon/content/tests/netmonitor/complicated.js
@@ -17,10 +17,11 @@ module.exports = async function() {
   const requestsDone = waitForNetworkRequests("complicated.netmonitor", toolbox,
     EXPECTED_REQUESTS);
   await reloadPageAndLog("complicated.netmonitor", toolbox);
   await requestsDone;
 
   await exportHar("complicated.netmonitor", toolbox);
 
   await closeToolboxAndLog("complicated.netmonitor", toolbox);
+
   await testTeardown();
 };