| <!DOCTYPE html> |
| <head> |
| <script src="../resources/js-test.js"></script> |
| <script src="resources/audio-testing.js"></script> |
| <script src="resources/audiobuffersource-testing.js"></script> |
| <script> |
| var context; |
| var source; |
| |
| function runTest() |
| { |
| jsTestIsAsync = true; |
| |
| var sampleRate = 44100.0; |
| var lengthInSeconds = 0.1; |
| context = new webkitOfflineAudioContext(1, sampleRate * lengthInSeconds, sampleRate); |
| osc = context.createOscillator(); |
| osc.type = "sine"; |
| osc.connect(context.destination); |
| osc.onended = function() |
| { |
| testPassed("osc.onended called."); |
| finishJSTest(); |
| } |
| osc.start(0); |
| osc.stop(0.1); |
| context.startRendering(); |
| } |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <div>Tests that OscillatorNode calls its onended EventListener.</div> |
| <div id="console"></div> |
| </body> |