Bug 1351456 - Don't assume that window.load will be called after the pref has been flipped. r?pehrsons draft
authorPaul Adenot <paul@paul.cx>
Mon, 03 Apr 2017 13:20:33 +0200
changeset 555727 d77398abffcc1fc468d3dec4a282006436bf04f3
parent 555726 8865bf28ee917c8474b440e016da3649f08375d9
child 622675 ace91a7d31ea114772bcb71c17bc4fa4d7dd1bca
push id52311
push userpaul@paul.cx
push dateTue, 04 Apr 2017 18:39:27 +0000
reviewerspehrsons
bugs1351456
milestone55.0a1
Bug 1351456 - Don't assume that window.load will be called after the pref has been flipped. r?pehrsons MozReview-Commit-ID: 2r6d6a5vIa
dom/media/webaudio/test/test_nodeCreationDocumentGone.html
--- a/dom/media/webaudio/test/test_nodeCreationDocumentGone.html
+++ b/dom/media/webaudio/test/test_nodeCreationDocumentGone.html
@@ -7,47 +7,32 @@
 </head>
 <body>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 SimpleTest.requestCompleteLog();
 SimpleTest.waitForExplicitFinish();
 
-
-SpecialPowers.pushPrefEnv({
-  set: [
-    [ "dom.disable_open_during_load", false ]
-  ]
-}).then(function() {
-  info("after pref");
-  var sub = encodeURI("data:text/html,<!DOCTYPE html>\n"+
-                      "<html><script>"+
-                      "var context = new AudioContext();"+
-                      "setTimeout(function(){window.close();},1000);\x3C/script></html>");
-  window.onload = function(){
-    info("after onload");
-    var a = window.open(sub);
-    info("after open: " + a);
-    a.onbeforeunload = function(){
-      setTimeout(function(){
-        try {
-          info("before sp");
-          a.context.createScriptProcessor(512, 1, 1);
-          info("after sp");
-        } catch(e) {
-          ok (true,"got exception");
-        }
-        setTimeout(function() {
-          info("finish");
-          ok (true,"no crash");
-          SimpleTest.finish();
-        }, 0);
-      }, 0);
-    };
-  };
-});
+var sub = encodeURI("data:text/html,<!DOCTYPE html>\n"+
+                    "<html><script>"+
+                    "var context = new AudioContext();"+
+                    "setTimeout(function(){window.close();},1000);\x3C/script></html>");
+var a = window.open(sub);
+a.onbeforeunload = function() {
+  setTimeout(function(){
+    try {
+      a.context.createScriptProcessor(512, 1, 1);
+    } catch(e) {
+      ok (true,"got exception");
+    }
+    setTimeout(function() {
+      ok (true,"no crash");
+      SimpleTest.finish();
+    }, 0);
+  }, 0);
+}
 
 
 </script>
 </pre>
 </body>
 </html>