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