Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / webaudio / offlineaudiocontext-detached-no-crash.html
blob378de48ed496fbb1b6bf5fd27234c36a756403b2
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 OfflineAudioContext, pass if no crash.");
12 window.jsTestIsAsync = true;
14 function errorCallback(error)
16 testPassed("OfflineAudioContext.startRendering() on a closed context threw an exception.");
17 finishJSTest();
20 function successCallback()
22 testFailed("OfflineAudioContext.startRendering() on a closed context did not throw an exception.");
23 finishJSTest();
26 var context;
27 function runTest()
29 context.startRendering().then(successCallback, errorCallback);
32 function createOfflineContext()
34 var sampleRate = 44100.0;
35 var renderLengthInFrames = 512;
36 var bufferSize = 512;
38 context = new w.OfflineAudioContext(1, renderLengthInFrames, sampleRate);
39 var node = context.createScriptProcessor(bufferSize, 0, 1);
40 var source = context.createBufferSource();
41 source.buffer = createImpulseBuffer(context, bufferSize);
42 node.onaudioprocess = function(e) { };
43 source.connect(node);
44 node.connect(context.destination);
45 source.start(0);
48 var w;
49 function processMessage(event) {
50 if (event.data == "opened") {
51 createOfflineContext();
52 w.close();
53 } else if (event.data == "closed") {
54 setTimeout(runTest, 100);
58 if (window.testRunner) {
59 testRunner.dumpAsText();
60 testRunner.waitUntilDone();
61 testRunner.setCanOpenWindows();
64 w = window.open('../resources/window-postmessage-open-close.html');
65 window.addEventListener("message", processMessage, false);
66 </script>
67 </body>
68 </html>