"use strict"; /* global PanelUI */ /** * WHOA THERE: We should never be adding new things to * EXPECTED_APPMENU_OPEN_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_APPMENU_OPEN_REFLOWS = [ { stack: [ "openPopup@chrome://global/content/bindings/popup.xml", "show/ { 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; }, EXPECTED_APPMENU_SUBVIEW_REFLOWS); });