Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / webaudio / scriptprocessornode-detached-no-crash.html
blob84a4da8ffd5158d8eada437894682aed59a96405
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="resources/compatibility.js"></script>
5 <script src="resources/audio-testing.js"></script>
6 <script src="../resources/js-test.js"></script>
7 </head>
8 <body>
9 <script>
10 description("Tests document-detached use of AudioContext, pass if no crash.");
12 window.jsTestIsAsync = true;
14 var sampleRate = 44100.0;
15 var renderLengthInFrames = 512;
16 var bufferSize = 512;
17 var context;
18 var node;
19 function runTest()
21 try {
22 node = context.createScriptProcessor(bufferSize, 0, 1);
23 var source = context.createBufferSource();
24 source.buffer = createImpulseBuffer(context, bufferSize);
25 node.onaudioprocess = function(e) { };
26 source.connect(node);
27 node.connect(context.destination);
28 source.start(0);
30 context.startRendering();
31 } catch (e) {
32 // The context has been stopped and detached; nothing to test.
33 return;
37 var w;
38 function processMessage(event) {
39 if (event.data == "opened") {
40 context = new w.OfflineAudioContext(1, renderLengthInFrames, sampleRate);
41 w.close();
42 } else if (event.data == "closed") {
43 runTest();
44 finishJSTest();
48 if (window.testRunner) {
49 testRunner.dumpAsText();
50 testRunner.waitUntilDone();
51 testRunner.setCanOpenWindows();
54 w = window.open('../resources/window-postmessage-open-close.html');
55 window.addEventListener("message", processMessage, false);
56 </script>
57 </body>
58 </html>