| <!DOCTYPE html> | |
| <head> | |
| <script src="../resources/js-test.js"></script> | |
| <script src="resources/compatibility.js"></script> | |
| <script src="resources/audio-testing.js"></script> | |
| <script src="resources/audiobuffersource-testing.js"></script> | |
| <script> | |
| var context; | |
| var source; | |
| function runTest() | |
| { | |
| if (window.testRunner) { | |
| testRunner.dumpAsText(); | |
| testRunner.waitUntilDone(); | |
| } | |
| var sampleRate = 44100.0; | |
| var lengthInSeconds = 0.1; | |
| context = new OfflineAudioContext(1, sampleRate * lengthInSeconds, sampleRate); | |
| osc = context.createOscillator(); | |
| osc.type = "sine"; | |
| osc.connect(context.destination); | |
| osc.onended = function() | |
| { | |
| testPassed("osc.onended called."); | |
| finishJSTest(); | |
| if (window.testRunner) | |
| testRunner.notifyDone(); | |
| } | |
| 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> |