Bug 1376822 - Re-enable appmenu reflow tests for sync subview. r=Gijs
authorMike Conley <mconley@mozilla.com>
Thu, 13 Jul 2017 07:59:35 -0700
changeset 422204 c2d1e7ed4349390606179ff79ff880deedad9700
parent 422203 36df21c0cba7b5ce6940d86a8efc7b10ab44be13
child 422205 fbef58ef000f86a911c9aaf5a0bda4ddfe0b1116
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1376822
milestone56.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 1376822 - Re-enable appmenu reflow tests for sync subview. r=Gijs MozReview-Commit-ID: B95VVqaTDja
browser/base/content/test/performance/browser_appmenu_reflows.js
--- a/browser/base/content/test/performance/browser_appmenu_reflows.js
+++ b/browser/base/content/test/performance/browser_appmenu_reflows.js
@@ -78,33 +78,27 @@ const EXPECTED_APPMENU_SUBVIEW_REFLOWS =
   /**
    * The synced tabs view has labels that are multiline. Because of bugs in
    * XUL layout relating to multiline text in scrollable containers, we need
    * to manually read their height in order to ensure container heights are
    * correct. Unfortunately this requires 2 sync reflows.
    *
    * If we add more views where this is necessary, we may need to duplicate
    * these expected reflows further.
-   *
-   * Because the test dirties the frame tree by manipulating margins,
-   * getBoundingClientRect() in the descriptionHeightWorkaround code
-   * seems to sometimes fire multiple times. Bug 1363361 will change how the
-   * test dirties the frametree, after which this (2 hits in that method)
-   * should become deterministic and we can re-enable the subview testing
-   * for the remotetabs subview (this is bug 1376822). In the meantime,
-   * that subview only is excluded from this test.
+   */
   [
     "descriptionHeightWorkaround@resource:///modules/PanelMultiView.jsm",
     "onTransitionEnd@resource:///modules/PanelMultiView.jsm",
   ],
+
   [
     "descriptionHeightWorkaround@resource:///modules/PanelMultiView.jsm",
     "onTransitionEnd@resource:///modules/PanelMultiView.jsm",
   ],
-   */
+
   /**
    * Please don't add anything new!
    */
 ];
 
 add_task(async function() {
   await ensureNoPreloadedBrowser();
 
@@ -130,33 +124,37 @@ add_task(async function() {
     // exhausted, we go back up a level.
     async function openSubViewsRecursively(currentView) {
       let navButtons = Array.from(currentView.querySelectorAll(".subviewbutton-nav"));
       if (!navButtons) {
         return;
       }
 
       for (let button of navButtons) {
-        // We skip the remote tabs subview, see the comments above
-        // in EXPECTED_APPMENU_SUBVIEW_REFLOWS. bug 1376822 tracks
-        // re-enabling this.
-        if (button.id == "appMenu-library-remotetabs-button") {
-          info("Skipping " + button.id);
-          continue;
-        }
         info("Click " + button.id);
         button.click();
         await BrowserTestUtils.waitForEvent(PanelUI.panel, "ViewShown");
+
+        // Workaround until bug 1363756 is fixed, then this can be removed.
+        await BrowserTestUtils.waitForCondition(() => {
+          return !PanelUI.multiView.instance._viewContainer.hasAttribute("width");
+        });
+
         info("Shown " + PanelUI.multiView.instance._currentSubView.id);
         // Unfortunately, I can't find a better accessor to the current
         // subview, so I have to reach the PanelMultiView instance
         // here.
         await openSubViewsRecursively(PanelUI.multiView.instance._currentSubView);
         PanelUI.multiView.goBack();
         await BrowserTestUtils.waitForEvent(PanelUI.panel, "ViewShown");
+
+        // Workaround until bug 1363756 is fixed, then this can be removed.
+        await BrowserTestUtils.waitForCondition(() => {
+          return !PanelUI.multiView.instance._viewContainer.hasAttribute("width");
+        });
       }
     }
 
     await openSubViewsRecursively(PanelUI.mainView);
 
     let hidden = BrowserTestUtils.waitForEvent(PanelUI.panel, "popuphidden");
     PanelUI.hide();
     await hidden;