Bug 1343550 - Mochitest. r?baku
MozReview-Commit-ID: 72V86HrbVCl
--- 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>