1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <link rel="stylesheet" href="../fast/js/resources/js-test-style.css"/>
5 <script src="resources/audio-testing.js"></script>
6 <script src="../fast/js/resources/js-test-pre.js"></script>
10 <div id="description"></div>
11 <div id="console"></div>
14 description("Tests that JavaScriptAudioNode accepts 0 input channels.");
16 var sampleRate = 44100.0;
17 var renderLengthInFrames = 512;
20 function checkResult(e)
22 testPassed("JavaScriptAudioNode accepts 0 input channels.");
29 if (window.testRunner) {
30 testRunner.dumpAsText();
31 testRunner.waitUntilDone();
34 window.jsTestIsAsync = true;
36 var context = new webkitOfflineAudioContext(1, renderLengthInFrames, sampleRate);
41 node = context.createJavaScriptNode(bufferSize, 0, 1);
42 testPassed("Successfully created JavaScriptAudioNode.");
44 testFailed("Failed to create JavaScriptAudioNode.");
47 var source = context.createBufferSource();
48 source.buffer = createImpulseBuffer(context, bufferSize);
50 // The onaudioprocess function doesn't need to do anything. We just need the process to start
51 // to test that implementation accepts 0 input channels.
53 // FIXME: check the .inputBuffer attribute of the AudioProcessingEvent.
54 node.onaudioprocess = function(e) { };
56 node.connect(context.destination);
59 context.oncomplete = checkResult;
60 context.startRendering();
64 successfullyParsed = true;
67 <script src="../fast/js/resources/js-test-post.js"></script>