Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Test AudioBufferSourceNode</title>
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
6 <script type="text/javascript" src="webaudio.js"></script>
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
8 </head>
9 <body>
10 <pre id="test">
11 <script class="testbody" type="text/javascript">
13 SimpleTest.waitForExplicitFinish();
14 addLoadEvent(function() {
15 var context = new AudioContext();
17 var sp = context.createScriptProcessor(2048, 0, 2);
18 sp.onaudioprocess = function(e) {
19 is(e.inputBuffer.numberOfChannels, 0, "Should have 0 input channels");
20 is(e.outputBuffer.numberOfChannels, 2, "Should have 2 output channels");
21 sp.onaudioprocess = null;
23 sp = context.createScriptProcessor(2048, 2, 0);
24 sp.onaudioprocess = function(e) {
25 is(e.inputBuffer.numberOfChannels, 2, "Should have 2 input channels");
26 is(e.outputBuffer.numberOfChannels, 0, "Should have 0 output channels");
27 sp.onaudioprocess = null;
29 SimpleTest.finish();
30 };
31 sp.connect(context.destination);
32 };
33 sp.connect(context.destination);
34 });
36 </script>
37 </pre>
38 </body>
39 </html>