OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 | 2 |
3 <html> | 3 <html> |
4 <head> | 4 <head> |
5 <script src="../fast/js/resources/js-test-pre.js"></script> | 5 <script src="../fast/js/resources/js-test-pre.js"></script> |
6 <script type="text/javascript" src="resources/audio-testing.js"></script> | 6 <script type="text/javascript" src="resources/audio-testing.js"></script> |
7 </head> | 7 </head> |
8 | 8 |
9 <body> | 9 <body> |
10 <div id="description"></div> | 10 <div id="description"></div> |
(...skipping 10 matching lines...) Expand all Loading... |
21 testRunner.dumpAsText(); | 21 testRunner.dumpAsText(); |
22 testRunner.waitUntilDone(); | 22 testRunner.waitUntilDone(); |
23 } | 23 } |
24 | 24 |
25 window.jsTestIsAsync = true; | 25 window.jsTestIsAsync = true; |
26 | 26 |
27 context = new webkitAudioContext(); | 27 context = new webkitAudioContext(); |
28 source = context.createBufferSource(); | 28 source = context.createBufferSource(); |
29 | 29 |
30 // Make sure we can't set to something which isn't an AudioBuffer. | 30 // Make sure we can't set to something which isn't an AudioBuffer. |
31 shouldThrow("source.buffer = 57"); | 31 shouldThrow("source.buffer = 57", "'TypeError: Type error'"); |
| 32 shouldThrow("source.buffer = null", "'TypeError: buffer cannot be null'"); |
32 | 33 |
33 // Check that mono buffer can be set. | 34 // Check that mono buffer can be set. |
34 try { | 35 try { |
35 var monoBuffer = context.createBuffer(1, 1024, context.sampleRate); | 36 var monoBuffer = context.createBuffer(1, 1024, context.sampleRate); |
36 source.buffer = monoBuffer; | 37 source.buffer = monoBuffer; |
37 testPassed("Mono buffer can be set."); | 38 testPassed("Mono buffer can be set."); |
38 } catch(e) { | 39 } catch(e) { |
39 testFailed("Mono buffer can not be set."); | 40 testFailed("Mono buffer can not be set."); |
40 } | 41 } |
41 | 42 |
(...skipping 22 matching lines...) Expand all Loading... |
64 finishJSTest(); | 65 finishJSTest(); |
65 } | 66 } |
66 | 67 |
67 runTest(); | 68 runTest(); |
68 | 69 |
69 </script> | 70 </script> |
70 | 71 |
71 <script src="../fast/js/resources/js-test-post.js"></script> | 72 <script src="../fast/js/resources/js-test-post.js"></script> |
72 </body> | 73 </body> |
73 </html> | 74 </html> |
OLD | NEW |