Bug 1458793 - Update flicker conditions to account for bug 1183135. r?mconley draft
authorDão Gottwald <dao@mozilla.com>
Thu, 17 May 2018 13:10:11 +0200
changeset 796243 dcf36042de2858306901e4dae4bbf5cbb635eda8
parent 796087 1800b8895c08bc0c60302775dc0a4b5ea4deb310
push id110194
push userdgottwald@mozilla.com
push dateThu, 17 May 2018 11:14:46 +0000
reviewersmconley
bugs1458793, 1183135
milestone62.0a1
Bug 1458793 - Update flicker conditions to account for bug 1183135. r?mconley MozReview-Commit-ID: 5xgXzdf68wg
browser/base/content/test/performance/browser.ini
browser/base/content/test/performance/browser_tabclose.js
--- a/browser/base/content/test/performance/browser.ini
+++ b/browser/base/content/test/performance/browser.ini
@@ -18,17 +18,16 @@ skip-if = asan || debug || (os == 'win' 
 skip-if = !debug
 [browser_startup.js]
 [browser_startup_content.js]
 skip-if = !e10s
 [browser_startup_flicker.js]
 run-if = debug || devedition || nightly_build # Requires startupRecorder.js, which isn't shipped everywhere by default
 [browser_tabclose_grow.js]
 [browser_tabclose.js]
-skip-if = os == 'linux' # bug 1448497
 [browser_tabopen.js]
 [browser_tabopen_squeeze.js]
 [browser_tabstrip_overflow_underflow.js]
 [browser_tabswitch.js]
 [browser_toolbariconcolor_restyles.js]
 [browser_urlbar_keyed_search.js]
 skip-if = (os == 'linux') || (os == 'win' && debug) # Disabled on Linux and Windows debug due to perma failures. Bug 1392320.
 [browser_urlbar_search.js]
--- a/browser/base/content/test/performance/browser_tabclose.js
+++ b/browser/base/content/test/performance/browser_tabclose.js
@@ -17,26 +17,25 @@ const EXPECTED_REFLOWS = [
 
 /*
  * This test ensures that there are no unexpected
  * uninterruptible reflows when closing new tabs.
  */
 add_task(async function() {
   await ensureNoPreloadedBrowser();
 
-  let firstTabRect = gBrowser.selectedTab.getBoundingClientRect();
-
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
   await BrowserTestUtils.waitForCondition(() => tab._fullyOpen);
 
   let tabStripRect = gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
   let newTabButtonRect =
     document.getAnonymousElementByAttribute(gBrowser.tabContainer,
                                             "anonid", "tabs-newtab-button")
             .getBoundingClientRect();
+  let inRange = (val, min, max) => min <= val && val <= max;
 
   // Add a reflow observer and open a new tab.
   await withPerfObserver(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;
@@ -61,26 +60,18 @@ add_task(async function() {
         ))),
         exceptions: [
           {name: "bug 1444886 - the next tab should be selected at the same time" +
                  " as the closed one disappears",
            condition: r =>
              // In tab strip
              r.y1 >= tabStripRect.top && r.y2 <= tabStripRect.bottom &&
              r.x1 >= tabStripRect.left && r.x2 <= tabStripRect.right &&
-             // Width of one tab.
-             r.w == gBrowser.selectedTab.clientWidth
-          },
-          {name: "bug 1446454 - the border between tabs should be painted at" +
-                 " the same time as the tab switch",
-           condition: r =>
-             // In tab strip
-             r.y1 >= tabStripRect.top && r.y2 <= tabStripRect.bottom &&
-             // 1px border, 1px before the end of the first tab.
-             r.w == 1 && r.x1 == firstTabRect.right - 1
+             // Width of one tab plus tab separator(s)
+             inRange(gBrowser.selectedTab.clientWidth - r.w, 0, 2)
           },
           {name: "bug 1446449 - spurious tab switch spinner",
            condition: r =>
              AppConstants.DEBUG &&
              // In the content area
              r.y1 >= document.getElementById("appcontent").getBoundingClientRect().top
           },
         ]