Backed out changeset 385dd315c9ca (bug 1385818) for failures in test_popup_blocker_chrome.xul a=backout
authorWes Kocher <wkocher@mozilla.com>
Tue, 01 Aug 2017 16:39:59 -0700
changeset 423352 fec8d72590053c3ad72cd3492d389213dfabc2ff
parent 423351 b4ecd488495e695b3e3329e889f64b9c9e00d4b4
child 423353 320642944e42a889db13c6c55b404e32319d4de6
child 424270 c2fd26b5cd658a8e7c72e0d23fbfd892ed6250a5
child 424373 e8c9f74b2a771b3cf59e528fbd9293116df84b1f
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)
reviewersbackout
bugs1385818
milestone56.0a1
backs out385dd315c9cafec09cb62d690f7a2a76fcba73f7
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
Backed out changeset 385dd315c9ca (bug 1385818) for failures in test_popup_blocker_chrome.xul a=backout MozReview-Commit-ID: 8voTYwwVoIm
dom/tests/mochitest/chrome/chrome.ini
dom/tests/mochitest/chrome/file_popup_blocker_chrome.html
dom/tests/mochitest/chrome/test_popup_blocker_chrome.xul
--- a/dom/tests/mochitest/chrome/chrome.ini
+++ b/dom/tests/mochitest/chrome/chrome.ini
@@ -11,17 +11,16 @@ support-files =
   file_MozDomFullscreen.html
   file_bug799299.xul
   file_bug800817.xul
   file_bug830858.xul
   file_bug1224790-1_modal.xul
   file_bug1224790-1_nonmodal.xul
   file_bug1224790-2_modal.xul
   file_bug1224790-2_nonmodal.xul
-  file_popup_blocker_chrome.html
   file_subscript_bindings.js
   focus_frameset.html
   focus_window2.xul
   fullscreen.xul
   queryCaretRectUnix.html
   queryCaretRectWin.html
   selectAtPoint.html
   selectAtPoint-innerframe.html
deleted file mode 100644
--- a/dom/tests/mochitest/chrome/file_popup_blocker_chrome.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<html>
-<body onfocus="window.opener.next()">
-foobar
-</script>
-</body>
-</html>
--- a/dom/tests/mochitest/chrome/test_popup_blocker_chrome.xul
+++ b/dom/tests/mochitest/chrome/test_popup_blocker_chrome.xul
@@ -15,52 +15,40 @@ https://bugzilla.mozilla.org/show_bug.cg
   </body>
 
   <!-- test code goes here -->
   <script type="application/javascript">
   <![CDATA[
 
   /** Test for Bug 662519 **/
 
-  let w = null;
-
-  let steps = [
-    function() {
-      w = window.open("file_popup_blocker_chrome.html", "", "width=200,height=200");
-      ok(w, "The window object shouldn't be null");    
-      // next() is called within file_popup_blocker_chrome.html
-    },
-    function() {
-      w.close();
-      ok(true, "The popup appeared");
-      next();
-    },
-    function() {
-      w = window.open("file_popup_blocker_chrome.html", "_blank", "width=200,height=200");
-      ok(w, "The window object shouldn't be null");
-      // next() is called within file_popup_blocker_chrome.html
-    },
-    function() {
-      w.close();
-      ok(true, "The popup appeared");
-      next();
-    },
-  ];
-
-  function next() {
-    if (!steps.length) {
-      SimpleTest.finish();
-      return;
-    }
-    let step = steps.shift();
-    step();
-  }
-
   SimpleTest.waitForExplicitFinish();
 
   // We have to enable dom.disable_open_during_load which is disabled
   // by the test harness.
-  SpecialPowers.pushPrefEnv({'set': [["dom.disable_open_during_load", true]] }, function() {
-    next();
-  });
+  let prefs = Components.classes["@mozilla.org/preferences-service;1"]
+                .getService(Components.interfaces.nsIPrefBranch);
+  var gLastDomLoadValue = prefs.getBoolPref("dom.disable_open_during_load");
+  prefs.setBoolPref("dom.disable_open_during_load", true);
+
+  let w = window.open("data:text/html,foobar", "", "width=200,height=200");
+  ok(w, "The window object shouldn't be null");
+
+  SimpleTest.waitForFocus(function() {
+    w.close();
+    ok(true, "The popup appeared");
+
+    SimpleTest.waitForFocus(function() {
+      let w = window.open("data:text/html,foobar", "", "width=200,height=200");
+      ok(w, "The window object shouldn't be null");
+
+      SimpleTest.waitForFocus(function() {
+        w.close();
+
+        ok(true, "The popup appeared");
+        prefs.setBoolPref("dom.disable_open_during_load", gLastDomLoadValue);
+        SimpleTest.finish();
+      }, w, false);
+    });
+  }, w, false);
   ]]>
   </script>
 </window>