1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
4 <script src=
"resources/compatibility.js"></script>
5 <script src=
"resources/audio-testing.js"></script>
6 <script src=
"../resources/js-test.js"></script>
10 <div id=
"description"></div>
11 <div id=
"console"></div>
14 description("Tests that ScriptProcessorNode accepts 0 input channels.");
16 var sampleRate
= 44100.0;
17 var renderLengthInFrames
= 512;
20 function checkResult(e
)
22 testPassed("ScriptProcessorNode accepts 0 input channels.");
29 if (window
.testRunner
) {
30 testRunner
.dumpAsText();
31 testRunner
.waitUntilDone();
34 window
.jsTestIsAsync
= true;
36 var context
= new OfflineAudioContext(1, renderLengthInFrames
, sampleRate
);
41 node
= context
.createScriptProcessor(bufferSize
, 0, 1);
42 testPassed("Successfully created ScriptProcessorNode.");
44 testFailed("Failed to create ScriptProcessorNode.");
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;