Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / webaudio / oscillator-ended.html
blob66f80b95dc0e328f6d5aa535b9057e5d069072a7
1 <!DOCTYPE html>
2 <head>
3 <script src="../resources/js-test.js"></script>
4 <script src="resources/compatibility.js"></script>
5 <script src="resources/audio-testing.js"></script>
6 <script src="resources/audiobuffersource-testing.js"></script>
7 <script>
8 var context;
9 var source;
11 function runTest()
13 if (window.testRunner) {
14 testRunner.dumpAsText();
15 testRunner.waitUntilDone();
18 var sampleRate = 44100.0;
19 var lengthInSeconds = 0.1;
20 context = new OfflineAudioContext(1, sampleRate * lengthInSeconds, sampleRate);
21 osc = context.createOscillator();
22 osc.type = "sine";
23 osc.connect(context.destination);
24 osc.onended = function()
26 testPassed("osc.onended called.");
27 finishJSTest();
28 if (window.testRunner)
29 testRunner.notifyDone();
32 osc.start(0);
33 osc.stop(0.1);
34 context.startRendering();
36 </script>
37 </head>
38 <body onload="runTest()">
39 <div>Tests that OscillatorNode calls its onended EventListener.</div>
40 <div id="console"></div>
41 </body>