Backed out 4 changesets (bug 1363505) to avoid conflicts with bug 1369140 on inbound.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 01 Jun 2017 11:12:04 -0400
changeset 361834 e603b83ca39530ab7eccb6f2e999905ecb209e1a
parent 361833 21e673ba5a1669277b4d2752d20b8d220260e1ff
child 361835 1d250422890a24fd71f473e457009a2257726da8
push id31945
push userryanvm@gmail.com
push dateThu, 01 Jun 2017 20:42:17 +0000
treeherdermozilla-central@15e32469eb04 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1363505, 1369140
milestone55.0a1
backs outc6b6bc96e99c2b78a97a812cdac687802decb4c3
494590d4307a1a06e5388c66ba23119f33a25b64
6f6b73f4f305a649c503ff9bba3d1d1ca0b1aedd
0c50bc93a3dc0c78eae2c3599912b86c03509aea
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 4 changesets (bug 1363505) to avoid conflicts with bug 1369140 on inbound. Backed out changeset c6b6bc96e99c (bug 1363505) Backed out changeset 494590d4307a (bug 1363505) Backed out changeset 6f6b73f4f305 (bug 1363505) Backed out changeset 0c50bc93a3dc (bug 1363505)
browser/base/content/test/performance/browser.ini
browser/base/content/test/performance/browser_tabclose_grow_reflows.js
browser/base/content/test/performance/browser_tabclose_reflows.js
browser/base/content/test/performance/browser_tabopen_reflows.js
browser/base/content/test/performance/browser_tabopen_squeeze_reflows.js
browser/base/content/test/performance/browser_tabswitch_reflows.js
browser/base/content/test/performance/browser_windowclose_reflows.js
browser/base/content/test/performance/head.js
--- a/browser/base/content/test/performance/browser.ini
+++ b/browser/base/content/test/performance/browser.ini
@@ -1,12 +1,8 @@
 [DEFAULT]
 support-files =
   head.js
 [browser_startup.js]
-[browser_tabclose_grow_reflows.js]
 [browser_tabclose_reflows.js]
 [browser_tabopen_reflows.js]
-[browser_tabopen_squeeze_reflows.js]
-[browser_tabswitch_reflows.js]
 [browser_toolbariconcolor_restyles.js]
-[browser_windowclose_reflows.js]
 [browser_windowopen_reflows.js]
deleted file mode 100644
--- a/browser/base/content/test/performance/browser_tabclose_grow_reflows.js
+++ /dev/null
@@ -1,60 +0,0 @@
-"use strict";
-
-/**
- * WHOA THERE: We should never be adding new things to EXPECTED_REFLOWS. This
- * 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",
-  ],
-];
-
-if (gMultiProcessBrowser) {
-  EXPECTED_REFLOWS.push(
-    [
-      "_adjustFocusAfterTabSwitch@chrome://browser/content/tabbrowser.xml",
-    ],
-  );
-}
-
-/*
- * This test ensures that there are no unexpected
- * uninterruptible reflows when closing a tab that will
- * cause the existing tabs to grow bigger.
- */
-add_task(async function() {
-  await ensureNoPreloadedBrowser();
-
-  // Compute the number of tabs we can put into the strip without
-  // overflowing. If we remove one of the tabs, we know that the
-  // remaining tabs will grow to fill the remaining space in the
-  // tabstrip.
-  const TAB_COUNT_FOR_GROWTH = computeMaxTabCount();
-  await createTabs(TAB_COUNT_FOR_GROWTH);
-
-  // Because the tab strip is a scrollable frame, we can't use the
-  // default dirtying function from withReflowObserver and reliably
-  // get reflows for the strip. Instead, we provide a node that's
-  // already in the scrollable frame to dirty - in this case, the
-  // original tab.
-  let origTab = gBrowser.selectedTab;
-  let lastTab = gBrowser.tabs[gBrowser.tabs.length - 1];
-  await BrowserTestUtils.switchTab(gBrowser, lastTab);
-
-  await withReflowObserver(async function() {
-    let switchDone = BrowserTestUtils.waitForEvent(window, "TabSwitchDone");
-    let tab = gBrowser.tabs[gBrowser.tabs.length - 1];
-    gBrowser.removeTab(tab, { animate: true });
-    await BrowserTestUtils.waitForEvent(tab, "transitionend",
-      false, e => e.propertyName === "max-width");
-    await switchDone;
-  }, EXPECTED_REFLOWS, window, origTab);
-
-  await removeAllButFirstTab();
-});
--- a/browser/base/content/test/performance/browser_tabclose_reflows.js
+++ b/browser/base/content/test/performance/browser_tabclose_reflows.js
@@ -23,17 +23,37 @@ if (gMultiProcessBrowser) {
   );
 }
 
 /*
  * This test ensures that there are no unexpected
  * uninterruptible reflows when closing new tabs.
  */
 add_task(async function() {
-  await ensureNoPreloadedBrowser();
+  // 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
+  // URL, otherwise _getPreloadedBrowser will return null, despite
+  // the preloaded browser existing.
+  let preloaded = gBrowser._getPreloadedBrowser();
+  if (preloaded) {
+    preloaded.remove();
+  }
+
+  await SpecialPowers.pushPrefEnv({
+    set: [["browser.newtab.preload", false]],
+  });
+
+  let aboutNewTabService = Cc["@mozilla.org/browser/aboutnewtab-service;1"]
+                             .getService(Ci.nsIAboutNewTabService);
+  aboutNewTabService.newTabURL = "about:blank";
+
+  registerCleanupFunction(() => {
+    aboutNewTabService.resetNewTabURL();
+  });
 
   // Because the tab strip is a scrollable frame, we can't use the
   // default dirtying function from withReflowObserver and reliably
   // get reflows for the strip. Instead, we provide a node that's
   // already in the scrollable frame to dirty - in this case, the
   // original tab.
   let origTab = gBrowser.selectedTab;
 
--- a/browser/base/content/test/performance/browser_tabopen_reflows.js
+++ b/browser/base/content/test/performance/browser_tabopen_reflows.js
@@ -36,17 +36,37 @@ const EXPECTED_REFLOWS = [
   ],
 ];
 
 /*
  * This test ensures that there are no unexpected
  * uninterruptible reflows when opening new tabs.
  */
 add_task(async function() {
-  await ensureNoPreloadedBrowser();
+  // 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
+  // URL, otherwise _getPreloadedBrowser will return null, despite
+  // the preloaded browser existing.
+  let preloaded = gBrowser._getPreloadedBrowser();
+  if (preloaded) {
+    preloaded.remove();
+  }
+
+  await SpecialPowers.pushPrefEnv({
+    set: [["browser.newtab.preload", false]],
+  });
+
+  let aboutNewTabService = Cc["@mozilla.org/browser/aboutnewtab-service;1"]
+                             .getService(Ci.nsIAboutNewTabService);
+  aboutNewTabService.newTabURL = "about:blank";
+
+  registerCleanupFunction(() => {
+    aboutNewTabService.resetNewTabURL();
+  });
 
   // Because the tab strip is a scrollable frame, we can't use the
   // default dirtying function from withReflowObserver and reliably
   // get reflows for the strip. Instead, we provide a node that's
   // already in the scrollable frame to dirty - in this case, the
   // original tab.
   let origTab = gBrowser.selectedTab;
 
@@ -58,8 +78,9 @@ add_task(async function() {
         false, e => e.propertyName === "max-width");
     await switchDone;
   }, EXPECTED_REFLOWS, window, origTab);
 
   let switchDone = BrowserTestUtils.waitForEvent(window, "TabSwitchDone");
   await BrowserTestUtils.removeTab(gBrowser.selectedTab);
   await switchDone;
 });
+
deleted file mode 100644
--- a/browser/base/content/test/performance/browser_tabopen_squeeze_reflows.js
+++ /dev/null
@@ -1,64 +0,0 @@
-"use strict";
-
-/**
- * WHOA THERE: We should never be adding new things to EXPECTED_REFLOWS. This
- * 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 = [
-  [
-    "select@chrome://global/content/bindings/textbox.xml",
-    "focusAndSelectUrlBar@chrome://browser/content/browser.js",
-    "_adjustFocusAfterTabSwitch@chrome://browser/content/tabbrowser.xml",
-  ],
-
-  [
-    "select@chrome://global/content/bindings/textbox.xml",
-    "focusAndSelectUrlBar@chrome://browser/content/browser.js",
-    "_adjustFocusAfterTabSwitch@chrome://browser/content/tabbrowser.xml",
-  ],
-
-  [
-    "select@chrome://global/content/bindings/textbox.xml",
-    "focusAndSelectUrlBar@chrome://browser/content/browser.js",
-    "_adjustFocusAfterTabSwitch@chrome://browser/content/tabbrowser.xml",
-  ],
-];
-
-/*
- * This test ensures that there are no unexpected
- * uninterruptible reflows when opening a new tab that will
- * cause the existing tabs to squeeze smaller.
- */
-add_task(async function() {
-  await ensureNoPreloadedBrowser();
-
-  // Compute the number of tabs we can put into the strip without
-  // overflowing, and remove one, so that we can create
-  // TAB_COUNT_FOR_SQUEEE tabs, and then one more, which should
-  // cause the tab to squeeze to a smaller size rather than overflow.
-  const TAB_COUNT_FOR_SQUEEZE = computeMaxTabCount() - 1;
-
-  await createTabs(TAB_COUNT_FOR_SQUEEZE);
-
-  // Because the tab strip is a scrollable frame, we can't use the
-  // default dirtying function from withReflowObserver and reliably
-  // get reflows for the strip. Instead, we provide a node that's
-  // already in the scrollable frame to dirty - in this case, the
-  // original tab.
-  let origTab = gBrowser.selectedTab;
-
-  await withReflowObserver(async function() {
-    let switchDone = BrowserTestUtils.waitForEvent(window, "TabSwitchDone");
-    BrowserOpenTab();
-    await BrowserTestUtils.waitForEvent(gBrowser.selectedTab, "transitionend",
-      false, e => e.propertyName === "max-width");
-    await switchDone;
-  }, EXPECTED_REFLOWS, window, origTab);
-
-  await removeAllButFirstTab();
-});
deleted file mode 100644
--- a/browser/base/content/test/performance/browser_tabswitch_reflows.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-/**
- * WHOA THERE: We should never be adding new things to EXPECTED_REFLOWS. This
- * 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",
-  ],
-];
-
-if (gMultiProcessBrowser) {
-  EXPECTED_REFLOWS.push(
-    [
-      "_adjustFocusAfterTabSwitch@chrome://browser/content/tabbrowser.xml",
-    ]
-  );
-}
-
-/*
- * This test ensures that there are no unexpected
- * uninterruptible reflows when switching between two
- * tabs that are both fully visible.
- */
-add_task(async function() {
-  await ensureNoPreloadedBrowser();
-
-  // Because the tab strip is a scrollable frame, we can't use the
-  // default dirtying function from withReflowObserver and reliably
-  // get reflows for the strip. Instead, we provide a node that's
-  // already in the scrollable frame to dirty - in this case, the
-  // original tab.
-  let origTab = gBrowser.selectedTab;
-
-  let firstSwitchDone = BrowserTestUtils.waitForEvent(window, "TabSwitchDone");
-  let otherTab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
-  await firstSwitchDone;
-
-  await withReflowObserver(async function() {
-    let switchDone = BrowserTestUtils.waitForEvent(window, "TabSwitchDone");
-    gBrowser.selectedTab = origTab;
-    await switchDone;
-  }, EXPECTED_REFLOWS, window, origTab);
-
-  await BrowserTestUtils.removeTab(otherTab);
-});
deleted file mode 100644
--- a/browser/base/content/test/performance/browser_windowclose_reflows.js
+++ /dev/null
@@ -1,50 +0,0 @@
-"use strict";
-
-/**
- * WHOA THERE: We should never be adding new things to EXPECTED_REFLOWS. This
- * 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 = [
-  /**
-   * Nothing here! Please don't add anything new!
-   */
-];
-
-/**
- * This test ensures that there are no unexpected
- * uninterruptible reflows when closing windows. When the
- * window is closed, the test waits until the original window
- * has activated.
- */
-add_task(function*() {
-  // Ensure that this browser window starts focused. This seems to be
-  // necessary to avoid intermittent failures when running this test
-  // on repeat.
-  yield new Promise(resolve => {
-    waitForFocus(resolve, window);
-  });
-
-  let win = yield BrowserTestUtils.openNewBrowserWindow();
-  yield new Promise(resolve => {
-    waitForFocus(resolve, win);
-  });
-
-  // At the time of writing, there are no reflows on window closing.
-  // Mochitest will fail if we have no assertions, so we add one here
-  // to make sure nobody adds any new ones.
-  Assert.equal(EXPECTED_REFLOWS.length, 0,
-    "We shouldn't have added any new expected reflows for window close.");
-
-  yield withReflowObserver(async function() {
-    let promiseOrigBrowserFocused = BrowserTestUtils.waitForCondition(() => {
-      return Services.focus.activeWindow == window;
-    });
-    await BrowserTestUtils.closeWindow(win);
-    await promiseOrigBrowserFocused;
-  }, EXPECTED_REFLOWS, win);
-});
--- a/browser/base/content/test/performance/head.js
+++ b/browser/base/content/test/performance/head.js
@@ -148,92 +148,8 @@ async function withReflowObserver(testFn
 
     els.removeListenerForAllEvents(win, dirtyFrameFn, true);
     docShell.removeWeakReflowObserver(observer);
 
     elemToDirty.style.margin = "";
   }
 }
 
-async function ensureNoPreloadedBrowser() {
-  // 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
-  // URL, otherwise _getPreloadedBrowser will return null, despite
-  // the preloaded browser existing.
-  let preloaded = gBrowser._getPreloadedBrowser();
-  if (preloaded) {
-    preloaded.remove();
-  }
-
-  await SpecialPowers.pushPrefEnv({
-    set: [["browser.newtab.preload", false]],
-  });
-
-  let aboutNewTabService = Cc["@mozilla.org/browser/aboutnewtab-service;1"]
-                             .getService(Ci.nsIAboutNewTabService);
-  aboutNewTabService.newTabURL = "about:blank";
-
-  registerCleanupFunction(() => {
-    aboutNewTabService.resetNewTabURL();
-  });
-}
-
-/**
- * Calculate and return how many additional tabs can be fit into the
- * tabstrip without causing it to overflow.
- *
- * @return int
- *         The maximum additional tabs that can be fit into the
- *         tabstrip without causing it to overflow.
- */
-function computeMaxTabCount() {
-  let currentTabCount = gBrowser.tabs.length;
-  let newTabButton =
-    document.getAnonymousElementByAttribute(gBrowser.tabContainer,
-                                            "class", "tabs-newtab-button");
-  let newTabRect = newTabButton.getBoundingClientRect();
-  let tabStripRect = gBrowser.tabContainer.mTabstrip.getBoundingClientRect();
-  let availableTabStripWidth = tabStripRect.width - newTabRect.width;
-
-  let tabMinWidth =
-    parseInt(getComputedStyle(gBrowser.selectedTab, null).minWidth, 10);
-
-  let maxTabCount = Math.floor(availableTabStripWidth / tabMinWidth) - currentTabCount;
-  Assert.ok(maxTabCount > 0,
-            "Tabstrip needs to be wide enough to accomodate at least 1 more tab " +
-            "without overflowing.");
-  return maxTabCount;
-}
-
-/**
- * Helper function that opens up some number of about:blank tabs, and wait
- * until they're all fully open.
- *
- * @param howMany (int)
- *        How many about:blank tabs to open.
- */
-async function createTabs(howMany) {
-  let uris = [];
-  while (howMany--) {
-    uris.push("about:blank");
-  }
-
-  gBrowser.loadTabs(uris, true, false);
-
-  await BrowserTestUtils.waitForCondition(() => {
-    return Array.from(gBrowser.tabs).every(tab => tab._fullyOpen);
-  });
-}
-
-/**
- * Removes all of the tabs except the originally selected
- * tab, and waits until all of the DOM nodes have been
- * completely removed from the tab strip.
- */
-async function removeAllButFirstTab() {
-  await SpecialPowers.pushPrefEnv({
-    set: [["browser.tabs.warnOnCloseOtherTabs", false]],
-  });
-  gBrowser.removeAllTabsBut(gBrowser.tabs[0]);
-  await BrowserTestUtils.waitForCondition(() => gBrowser.tabs.length == 1);
-  await SpecialPowers.popPrefEnv();
-}