Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / webaudio / audiobuffersource-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 numberOfFrames = 32;
16             context = new webkitOfflineAudioContext(1, numberOfFrames, sampleRate);
17             source = context.createBufferSource();
18             source.buffer = createTestBuffer(context, numberOfFrames);
19             source.connect(context.destination);
20             source.onended = function() 
21             {
22                 testPassed("source.onended called.");
23                 finishJSTest();
24             }
25             source.start(0);
26             context.startRendering();
27         }
28     </script>
29
30 </head>
31 <body onload="runTest()">
32     <div>Tests that AudioBufferSourceNode calls its onended EventListener.</div>
33     <div id="console"></div>
34 </body>