Bug 1131576 - Spin the event loop between calls to showPopup in test_windowminmaxsize.xul. r?enn
MozReview-Commit-ID: CoZBzJQRHGx
--- a/layout/xul/test/test_windowminmaxsize.xul
+++ b/layout/xul/test/test_windowminmaxsize.xul
@@ -194,17 +194,22 @@ function nextPopupTest(panel)
setattr("maxwidth");
setattr("maxheight");
// Remove the flexibility as it causes the resizer to not shrink down
// when resizing.
if ("last" in popupTests[gTestId])
document.getElementById("popupresizer").removeAttribute("flex");
- panel.openPopup();
+ // Prevent event loop starvation as a result of popup events being
+ // synchronous. See bug 1131576.
+ SimpleTest.executeSoon(() => {
+ // Non-chrome shells require focus to open a popup.
+ SimpleTest.waitForFocus(() => { panel.openPopup() });
+ });
}
}
function titledPanelWindowOpened(panelwindow)
{
var panel = panelwindow.document.documentElement.firstChild;
panel.openPopup();
panel.addEventListener("popupshown", () => doTitledPanelTest(panel), false);