WebProcessCache should keep track of processes being added
[WebKit-https.git] / LayoutTests / webaudio / oscillator-ended.html
1 <!DOCTYPE html>
2 <head>
3     <script src="../resources/js-test.js"></script>
4     <script src="resources/audio-testing.js"></script>
5     <script src="resources/audiobuffersource-testing.js"></script>
6     <script>
7         var context;
8         var source;
9
10         function runTest()
11         {
12             jsTestIsAsync = true;
13
14             var sampleRate = 44100.0;
15             var lengthInSeconds = 0.1;
16             context = new webkitOfflineAudioContext(1, sampleRate * lengthInSeconds, sampleRate);
17             osc = context.createOscillator();
18             osc.type = "sine"; 
19             osc.connect(context.destination);
20             osc.onended = function() 
21             {
22                 testPassed("osc.onended called.");
23                 finishJSTest();
24             }
25             osc.start(0);
26             osc.stop(0.1);
27             context.startRendering();
28         }
29     </script>
30 </head>
31 <body onload="runTest()">
32     <div>Tests that OscillatorNode calls its onended EventListener.</div>
33     <div id="console"></div>
34 </body>