5 <script src="../fast/js/resources/js-test-pre.js"></script>
6 <script src="resources/audio-testing.js"></script>
7 <script src="resources/delay-testing.js"></script>
12 <div id="description"></div>
13 <div id="console"></div>
16 description("Tests basic functionality of DelayNode with a non-default max delay time.");
19 if (window.testRunner) {
20 testRunner.dumpAsText();
21 testRunner.waitUntilDone();
24 window.jsTestIsAsync = true;
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
30 var bufferSource = context.createBufferSource();
31 bufferSource.buffer = toneBuffer;
33 // Create a delay node with an explicit max delay time (greater than the default of 1 second).
34 var delay = context.createDelayNode(2);
35 // Set the delay time to a value greater than the default max delay so we can verify the delay
36 // is working for this case.
37 delayTimeSeconds = 1.5;
38 delay.delayTime.value = delayTimeSeconds;
40 bufferSource.connect(delay);
41 delay.connect(context.destination);
42 bufferSource.noteOn(0);
44 context.oncomplete = checkDelayedResult(toneBuffer);
45 context.startRendering();
52 <script src="../fast/js/resources/js-test-post.js"></script>