OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 | 2 |
3 <html> | 3 <html> |
4 <head> | 4 <head> |
5 <script src="../resources/js-test.js"></script> | 5 <script src="../resources/js-test.js"></script> |
| 6 <script src="resources/compatibility.js"></script> |
6 <script src="resources/audio-testing.js"></script> | 7 <script src="resources/audio-testing.js"></script> |
7 <script src="resources/delay-testing.js"></script> | 8 <script src="resources/delay-testing.js"></script> |
8 </head> | 9 </head> |
9 | 10 |
10 <body> | 11 <body> |
11 | 12 |
12 <div id="description"></div> | 13 <div id="description"></div> |
13 <div id="console"></div> | 14 <div id="console"></div> |
14 | 15 |
15 <script> | 16 <script> |
16 description("Tests attribute and maximum allowed delay of DelayNode."); | 17 description("Tests attribute and maximum allowed delay of DelayNode."); |
17 | 18 |
18 function runTest() { | 19 function runTest() { |
19 if (window.testRunner) { | 20 if (window.testRunner) { |
20 testRunner.dumpAsText(); | 21 testRunner.dumpAsText(); |
21 testRunner.waitUntilDone(); | 22 testRunner.waitUntilDone(); |
22 } | 23 } |
23 | 24 |
24 window.jsTestIsAsync = true; | 25 window.jsTestIsAsync = true; |
25 | 26 |
26 // Create offline audio context. | 27 // Create offline audio context. |
27 var context = new webkitOfflineAudioContext(1, sampleRate * renderLengthSeco
nds, sampleRate); | 28 var context = new OfflineAudioContext(1, sampleRate * renderLengthSeconds, s
ampleRate); |
28 var toneBuffer = createToneBuffer(context, 20, 20 * toneLengthSeconds, sampl
eRate); // 20Hz tone | 29 var toneBuffer = createToneBuffer(context, 20, 20 * toneLengthSeconds, sampl
eRate); // 20Hz tone |
29 | 30 |
30 var bufferSource = context.createBufferSource(); | 31 var bufferSource = context.createBufferSource(); |
31 bufferSource.buffer = toneBuffer; | 32 bufferSource.buffer = toneBuffer; |
32 | 33 |
33 window.context = context; | 34 window.context = context; |
34 shouldThrow("context.createDelay(180)"); | 35 shouldThrow("context.createDelay(180)"); |
35 shouldThrow("context.createDelay(0)"); | 36 shouldThrow("context.createDelay(0)"); |
36 shouldThrow("context.createDelay(-1)"); | 37 shouldThrow("context.createDelay(-1)"); |
37 shouldThrow("context.createDelay(NaN)"); | 38 shouldThrow("context.createDelay(NaN)"); |
(...skipping 10 matching lines...) Expand all Loading... |
48 context.oncomplete = checkDelayedResult(toneBuffer); | 49 context.oncomplete = checkDelayedResult(toneBuffer); |
49 context.startRendering(); | 50 context.startRendering(); |
50 } | 51 } |
51 | 52 |
52 runTest(); | 53 runTest(); |
53 | 54 |
54 </script> | 55 </script> |
55 | 56 |
56 </body> | 57 </body> |
57 </html> | 58 </html> |
OLD | NEW |