Bug 1131576 - Spin the event loop between calls to showPopup in test_windowminmaxsize.xul. r?enn draft
authorAndrew Comminos <andrew@comminos.com>
Wed, 27 Jul 2016 14:18:47 -0400
changeset 393366 8218f3beb0e443009430dfec90475c020f0ff2c7
parent 393304 fef429fba4c64c5b9c0c823a6ab713edbbcd4220
child 526578 e8980b5cf1c58326ab513fd22b1450ce7b56379d
push id24305
push userbmo:andrew@comminos.com
push dateWed, 27 Jul 2016 20:34:23 +0000
reviewersenn
bugs1131576
milestone50.0a1
Bug 1131576 - Spin the event loop between calls to showPopup in test_windowminmaxsize.xul. r?enn MozReview-Commit-ID: CoZBzJQRHGx
layout/xul/test/test_windowminmaxsize.xul
--- 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);