1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/media/webaudio/test/test_scriptProcessorNodeZeroInputOutput.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,39 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<head> 1.7 + <title>Test AudioBufferSourceNode</title> 1.8 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.9 + <script type="text/javascript" src="webaudio.js"></script> 1.10 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.11 +</head> 1.12 +<body> 1.13 +<pre id="test"> 1.14 +<script class="testbody" type="text/javascript"> 1.15 + 1.16 +SimpleTest.waitForExplicitFinish(); 1.17 +addLoadEvent(function() { 1.18 + var context = new AudioContext(); 1.19 + 1.20 + var sp = context.createScriptProcessor(2048, 0, 2); 1.21 + sp.onaudioprocess = function(e) { 1.22 + is(e.inputBuffer.numberOfChannels, 0, "Should have 0 input channels"); 1.23 + is(e.outputBuffer.numberOfChannels, 2, "Should have 2 output channels"); 1.24 + sp.onaudioprocess = null; 1.25 + 1.26 + sp = context.createScriptProcessor(2048, 2, 0); 1.27 + sp.onaudioprocess = function(e) { 1.28 + is(e.inputBuffer.numberOfChannels, 2, "Should have 2 input channels"); 1.29 + is(e.outputBuffer.numberOfChannels, 0, "Should have 0 output channels"); 1.30 + sp.onaudioprocess = null; 1.31 + 1.32 + SimpleTest.finish(); 1.33 + }; 1.34 + sp.connect(context.destination); 1.35 + }; 1.36 + sp.connect(context.destination); 1.37 +}); 1.38 + 1.39 +</script> 1.40 +</pre> 1.41 +</body> 1.42 +</html>