Backed out changeset afc25136f9ae (bug 1363505) for frequently failing own test browser_tabclose_grow_reflows.js and browser_roundedWindow_newWindow.js. r=backout on a CLOSED TREE
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 31 May 2017 23:00:50 +0200
changeset 412111 5e373ab3dab1e6e775ad3776da2d677260783b92
parent 412110 f7561f92cf88b59b2397eb5d6600fd3f9eb04699
child 412112 cd807be171322fd50de8709de13f240121259933
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1363505
milestone55.0a1
backs outafc25136f9ae55a5ffb4853836efda2856c3c8f6
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 afc25136f9ae (bug 1363505) for frequently failing own test browser_tabclose_grow_reflows.js and browser_roundedWindow_newWindow.js. r=backout on a CLOSED TREE
browser/base/content/test/performance/browser.ini
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/head.js
--- a/browser/base/content/test/performance/browser.ini
+++ b/browser/base/content/test/performance/browser.ini
@@ -1,8 +1,7 @@
 [DEFAULT]
 support-files =
   head.js
 [browser_tabclose_reflows.js]
 [browser_tabopen_reflows.js]
-[browser_tabopen_squeeze_reflows.js]
 [browser_toolbariconcolor_restyles.js]
 [browser_windowopen_reflows.js]
--- 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,70 +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",
-  ],
-
-  [
-    "adjustTabstrip@chrome://browser/content/tabbrowser.xml",
-    "_handleNewTab@chrome://browser/content/tabbrowser.xml",
-    "onxbltransitionend@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();
-});
--- a/browser/base/content/test/performance/head.js
+++ b/browser/base/content/test/performance/head.js
@@ -148,87 +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 tabStripRect = gBrowser.tabContainer.mTabstrip.getBoundingClientRect();
-  let tabStripWidth = tabStripRect.width;
-  let tabMinWidth =
-    parseInt(getComputedStyle(gBrowser.selectedTab, null).minWidth, 10);
-
-  let maxTabCount = Math.floor(tabStripWidth / 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();
-}