OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <head> | |
3 <script src="../resources/js-test.js"></script> | |
4 <script src="resources/audit-util.js"></script> | |
5 <script src="resources/audio-testing.js"></script> | |
6 <script src="resources/compatibility.js"></script> | |
7 <script src="resources/audiobuffersource-testing.js"></script> | |
8 <script> | |
9 var context; | |
10 var source; | |
11 | |
12 function runTest() | |
13 { | |
14 if (window.testRunner) { | |
15 testRunner.dumpAsText(); | |
16 testRunner.waitUntilDone(); | |
17 } | |
18 | |
19 var sampleRate = 44100.0; | |
20 var numberOfFrames = 32; | |
21 context = new OfflineAudioContext(1, numberOfFrames, sampleRate); | |
22 source = context.createBufferSource(); | |
23 source.buffer = createTestBuffer(context, numberOfFrames); | |
24 source.connect(context.destination); | |
25 source.onended = function() | |
26 { | |
27 testPassed("source.onended called."); | |
28 if (window.testRunner) | |
29 testRunner.notifyDone(); | |
30 } | |
31 source.start(0); | |
32 context.startRendering(); | |
33 } | |
34 </script> | |
35 | |
36 </head> | |
37 <body onload="runTest()"> | |
38 <div>Tests that AudioBufferSourceNode calls its onended EventListener.</div> | |
39 <div id="console"></div> | |
40 </body> | |
OLD | NEW |