Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / webaudio / delaynode-maxdelay.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 basic functionality of DelayNode with a non-default max delay 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     // Create a delay node with an explicit max delay time (greater than the default of 1 second).
29     var delay = context.createDelay(2);
30     // Set the delay time to a value greater than the default max delay so we can verify the delay
31     // is working for this case.
32     delayTimeSeconds = 1.5;
33     delay.delayTime.value = delayTimeSeconds;
34
35     bufferSource.connect(delay);
36     delay.connect(context.destination);
37     bufferSource.start(0);
38     
39     context.oncomplete = checkDelayedResult(toneBuffer);
40     context.startRendering();
41 }
42
43 runTest();
44
45 </script>
46 </body>
47 </html>