Bug 1131576 - Spin the event loop between calls to showPopup in test_windowminmaxsize.xul. r=enn, a=test-only
authorAndrew Comminos <andrew@comminos.com>
Wed, 27 Jul 2016 14:18:47 -0400
changeset 325581 2e9f0be3cb2c91638cc3c76c8622c1eede2f8911
parent 325580 aa1f8366541eafaa16fbea50bbf2fc35af36ff61
child 325582 babac065acd357ccd1408d13f8401f4eea9f1189
push id9843
push userryanvm@gmail.com
push dateFri, 29 Jul 2016 20:53:22 +0000
treeherdermozilla-aurora@42c3abe40b3b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenn, test-only
bugs1131576
milestone49.0a2
Bug 1131576 - Spin the event loop between calls to showPopup in test_windowminmaxsize.xul. r=enn, a=test-only 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);