| 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/audio-testing.js"></script> | 4 <script src="resources/audio-testing.js"></script> |
| 5 <script src="resources/compatibility.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 numberOfFrames = 32; | 19 var numberOfFrames = 32; |
| 19 context = new webkitOfflineAudioContext(1, numberOfFrames, sampleRat
e); | 20 context = new OfflineAudioContext(1, numberOfFrames, sampleRate); |
| 20 source = context.createBufferSource(); | 21 source = context.createBufferSource(); |
| 21 source.buffer = createTestBuffer(context, numberOfFrames); | 22 source.buffer = createTestBuffer(context, numberOfFrames); |
| 22 source.connect(context.destination); | 23 source.connect(context.destination); |
| 23 source.onended = function() | 24 source.onended = function() |
| 24 { | 25 { |
| 25 testPassed("source.onended called."); | 26 testPassed("source.onended called."); |
| 26 if (window.testRunner) | 27 if (window.testRunner) |
| 27 testRunner.notifyDone(); | 28 testRunner.notifyDone(); |
| 28 } | 29 } |
| 29 source.start(0); | 30 source.start(0); |
| 30 context.startRendering(); | 31 context.startRendering(); |
| 31 } | 32 } |
| 32 </script> | 33 </script> |
| 33 | 34 |
| 34 </head> | 35 </head> |
| 35 <body onload="runTest()"> | 36 <body onload="runTest()"> |
| 36 <div>Tests that AudioBufferSourceNode calls its onended EventListener.</div> | 37 <div>Tests that AudioBufferSourceNode calls its onended EventListener.</div> |
| 37 <div id="console"></div> | 38 <div id="console"></div> |
| 38 </body> | 39 </body> |
| OLD | NEW |