Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / webaudio / delaynode-scheduling.html
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5 <script src="../resources/js-test.js"></script>
6 <script src="resources/audio-testing.js"></script>
7 <script src="resources/delay-testing.js"></script>
8 </head>
9
10 <body>
11
12 <div id="description"></div>
13 <div id="console"></div>
14
15 <script>
16 description("Tests that DelayNode delayTime parameter can be scheduled at a given time.");
17
18 function runTest() {
19     window.jsTestIsAsync = true;
20         
21     // Create offline audio context.
22     var context = new webkitOfflineAudioContext(1, sampleRate * renderLengthSeconds, sampleRate);
23     var toneBuffer = createToneBuffer(context, 20, 20 * toneLengthSeconds, sampleRate); // 20Hz tone
24     
25     var bufferSource = context.createBufferSource();
26     bufferSource.buffer = toneBuffer;
27
28     var delay = context.createDelay();
29     
30     // Schedule delay time at time zero.
31     delay.delayTime.setValueAtTime(delayTimeSeconds, 0);
32
33     bufferSource.connect(delay);
34     delay.connect(context.destination);
35     bufferSource.start(0);
36     
37     context.oncomplete = checkDelayedResult(toneBuffer);
38     context.startRendering();
39 }
40
41 runTest();
42
43 </script>
44 </body>
45 </html>