Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / webaudio / delaynode-maxdelaylimit.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 attribute and maximum allowed delay of DelayNode.");
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     window.context = context;
29     shouldThrow("context.createDelay(180)");
30     shouldThrow("context.createDelay(0)");
31     shouldThrow("context.createDelay(-1)");
32
33     var delay = context.createDelay(179);
34     delay.delayTime.value = delayTimeSeconds;
35     window.delay = delay;
36     shouldBeTrue("delay.delayTime.value === 0.5");
37
38     bufferSource.connect(delay);
39     delay.connect(context.destination);
40     bufferSource.start(0);
41     
42     context.oncomplete = checkDelayedResult(toneBuffer);
43     context.startRendering();
44 }
45
46 runTest();
47
48 </script>
49 </body>
50 </html>