Bug 1369140 - Part 2: Test that tab closing no longer incurs a reflow; r=mconley
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 31 May 2017 21:09:14 -0400
changeset 361854 87c1327b918d380df584858e28c23d7340c65994
parent 361853 d44994c678733c604990ecaca9dadbc9693c6625
child 361855 e398680c483332f16c829adbddb29528c566c180
push id31946
push userryanvm@gmail.com
push dateThu, 01 Jun 2017 20:43:38 +0000
treeherdermozilla-central@b138d2f271fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1369140
milestone55.0a1
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
Bug 1369140 - Part 2: Test that tab closing no longer incurs a reflow; r=mconley
browser/base/content/test/performance/browser_tabclose_reflows.js
--- a/browser/base/content/test/performance/browser_tabclose_reflows.js
+++ b/browser/base/content/test/performance/browser_tabclose_reflows.js
@@ -5,29 +5,21 @@
  * is a whitelist that should slowly go away as we improve the performance of
  * the front-end. Instead of adding more reflows to the whitelist, you should
  * be modifying your code to avoid the reflow.
  *
  * See https://developer.mozilla.org/en-US/Firefox/Performance_best_practices_for_Firefox_fe_engineers
  * for tips on how to do that.
  */
 const EXPECTED_REFLOWS = [
-  [
-    "_adjustFocusAfterTabSwitch@chrome://browser/content/tabbrowser.xml",
-  ],
+  /**
+   * Nothing here! Please don't add anything new!
+   */
 ];
 
-if (gMultiProcessBrowser) {
-  EXPECTED_REFLOWS.push(
-    [
-      "_adjustFocusAfterTabSwitch@chrome://browser/content/tabbrowser.xml",
-    ],
-  );
-}
-
 /*
  * This test ensures that there are no unexpected
  * uninterruptible reflows when closing new tabs.
  */
 add_task(async function() {
   // If we've got a preloaded browser, get rid of it so that it
   // doesn't interfere with the test if it's loading. We have to
   // do this before we disable preloading or changing the new tab
@@ -63,9 +55,10 @@ add_task(async function() {
   // Add a reflow observer and open a new tab.
   await withReflowObserver(async function() {
     let switchDone = BrowserTestUtils.waitForEvent(window, "TabSwitchDone");
     gBrowser.removeTab(tab, { animate: true });
     await BrowserTestUtils.waitForEvent(tab, "transitionend",
         false, e => e.propertyName === "max-width");
     await switchDone;
   }, EXPECTED_REFLOWS, window, origTab);
+  is(EXPECTED_REFLOWS.length, 0, "No reflows are expected when closing a tab");
 });