Bug 1343550 - Mochitest. r?baku draft
authorPaul Adenot <paul@paul.cx>
Thu, 09 Mar 2017 14:09:48 +0100
changeset 551671 2d45fa52f4f82a81e9356acb866a8fbf0d4143c7
parent 551669 73a90954cc3a0a8aeedb996a7de49c3026fe8b5d
child 621610 0d7b2634b93a4fd02e7f8488edf8455b72266b51
push id51128
push userpaul@paul.cx
push dateMon, 27 Mar 2017 08:20:54 +0000
reviewersbaku
bugs1343550
milestone55.0a1
Bug 1343550 - Mochitest. r?baku MozReview-Commit-ID: 72V86HrbVCl
dom/media/webaudio/test/mochitest.ini
dom/media/webaudio/test/test_nodeCreationDocumentGone.html
--- a/dom/media/webaudio/test/mochitest.ini
+++ b/dom/media/webaudio/test/mochitest.ini
@@ -169,16 +169,17 @@ tags=capturestream
 [test_mediaStreamAudioSourceNodeResampling.html]
 tags=capturestream
 [test_mixingRules.html]
 skip-if = toolkit == 'android' # bug 1091965
 [test_mozaudiochannel.html]
 # Android: bug 1061675; OSX 10.6: bug 1097721
 skip-if = (toolkit == 'android') || (os == 'mac' && os_version == '10.6')
 [test_nodeToParamConnection.html]
+[test_nodeCreationDocumentGone.html]
 [test_OfflineAudioContext.html]
 [test_offlineDestinationChannelCountLess.html]
 [test_offlineDestinationChannelCountMore.html]
 [test_oscillatorNode.html]
 [test_oscillatorNode2.html]
 [test_oscillatorNodeNegativeFrequency.html]
 [test_oscillatorNodePassThrough.html]
 [test_oscillatorNodeStart.html]
new file mode 100644
--- /dev/null
+++ b/dom/media/webaudio/test/test_nodeCreationDocumentGone.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <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.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);
+    };
+  };
+});
+
+
+</script>
+</pre>
+</body>
+</html>