a4c712f4de8064ace6c5cf38ff5db4b6ea9994c3
[WebKit-https.git] / LayoutTests / webaudio / delaynode-max-default-delay.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 DelayNode with delay set to default maximum delay.");
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     delayTimeSeconds = 1;
30     delay.delayTime.value = delayTimeSeconds;
31
32     bufferSource.connect(delay);
33     delay.connect(context.destination);
34     bufferSource.start(0);
35     
36     context.oncomplete = checkDelayedResult(toneBuffer);
37     context.startRendering();
38 }
39
40 runTest();
41
42 </script>
43 </body>
44 </html>