Bug 1351456 - Don't assume that window.load will be called after the pref has been flipped. r=pehrsons, a=test-only
authorPaul Adenot <paul@paul.cx>
Mon, 03 Apr 2017 13:20:33 +0200
changeset 395694 eb0d361dc73c32867d5fd54dc47733994bd48e7a
parent 395693 4ab26e8674260f8a1e4dc89c1e10efa2ba544c9b
child 395695 b3b878775ada1356980114ab985c5a5fe2e2d914
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspehrsons, test-only
bugs1351456
milestone54.0a2
Bug 1351456 - Don't assume that window.load will be called after the pref has been flipped. r=pehrsons, a=test-only 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
@@ -4,42 +4,35 @@
   <title>Test whether we can create an AudioContext interface</title>
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </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() {
-  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(){
-    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);
-    };
-  };
-});
+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>