093aa5a45516e14275480ce7a8b6707c61067f25
[WebKit-https.git] / LayoutTests / webaudio / delaynode-max-default-delay.html
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5 <script src="../resources/js-test-pre.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 DelayNode with delay set to default maximum delay.");
17
18 function runTest() {
19     if (window.testRunner) {
20         testRunner.dumpAsText();
21         testRunner.waitUntilDone();
22     }
23     
24     window.jsTestIsAsync = true;
25         
26     // Create offline audio context.
27     var context = new webkitOfflineAudioContext(1, sampleRate * renderLengthSeconds, sampleRate);
28     var toneBuffer = createToneBuffer(context, 20, 20 * toneLengthSeconds, sampleRate); // 20Hz tone
29     
30     var bufferSource = context.createBufferSource();
31     bufferSource.buffer = toneBuffer;
32
33     var delay = context.createDelay();
34     delayTimeSeconds = 1;
35     delay.delayTime.value = delayTimeSeconds;
36
37     bufferSource.connect(delay);
38     delay.connect(context.destination);
39     bufferSource.start(0);
40     
41     context.oncomplete = checkDelayedResult(toneBuffer);
42     context.startRendering();
43 }
44
45 runTest();
46
47 </script>
48
49 <script src="../resources/js-test-post.js"></script>
50 </body>
51 </html>