| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
| <html> | |
| <head> | |
| <link rel="stylesheet" href="../fast/js/resources/js-test-style.css"/> | |
| <script src="resources/audio-testing.js"></script> | |
| <script src="../fast/js/resources/js-test-pre.js"></script> | |
| </head> | |
| <body> | |
| <div id="description"></div> | |
| <div id="console"></div> | |
| <script> | |
| description("Tests that JavaScriptAudioNode accepts 0 input channels."); | |
| var sampleRate = 44100.0; | |
| var renderLengthInFrames = 512; | |
| var bufferSize = 512; | |
| function checkResult(e) | |
| { | |
| testPassed("JavaScriptAudioNode accepts 0 input channels."); | |
| finishJSTest(); | |
| } | |
| function runTest() | |
| { | |
| if (window.testRunner) { | |
| testRunner.dumpAsText(); | |
| testRunner.waitUntilDone(); | |
| } | |
| window.jsTestIsAsync = true; | |
| var context = new webkitAudioContext(1, renderLengthInFrames, sampleRate); | |
| var node; | |
| try { | |
| node = context.createJavaScriptNode(bufferSize, 0, 1); | |
| testPassed("Successfully created JavaScriptAudioNode."); | |
| } catch (e) { | |
| testFailed("Failed to create JavaScriptAudioNode."); | |
| } | |
| var source = context.createBufferSource(); | |
| source.buffer = createImpulseBuffer(context, bufferSize); | |
| // The onaudioprocess function doesn't need to do anything. We just need the process to start | |
| // to test that implementation accepts 0 input channels. | |
| // | |
| // FIXME: check the .inputBuffer attribute of the AudioProcessingEvent. | |
| node.onaudioprocess = function(e) { }; | |
| source.connect(node); | |
| node.connect(context.destination); | |
| source.noteOn(0); | |
| context.oncomplete = checkResult; | |
| context.startRendering(); | |
| } | |
| runTest(); | |
| successfullyParsed = true; | |
| </script> | |
| <script src="../fast/js/resources/js-test-post.js"></script> | |
| </body> | |
| </html> |