| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
| 5 <script src="resources/compatibility.js"></script> | 5 <script src="resources/compatibility.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 <body> | 8 <body> |
| 9 <script> | 9 <script> |
| 10 description("Basic tests for decodeAudioData function."); | 10 description("Basic tests for decodeAudioData function."); |
| 11 | 11 |
| 12 if (window.testRunner) { | 12 if (window.testRunner) { |
| 13 testRunner.dumpAsText(); | 13 testRunner.dumpAsText(); |
| 14 testRunner.waitUntilDone(); | 14 testRunner.waitUntilDone(); |
| 15 } | 15 } |
| 16 | 16 |
| 17 window.jsTestIsAsync = true; | 17 window.jsTestIsAsync = true; |
| 18 | 18 |
| 19 var context = new AudioContext(); | 19 var context = new AudioContext(); |
| 20 | 20 |
| 21 context.decodeAudioData(null, | 21 try { |
| 22 function () { | 22 context.decodeAudioData(null, function(){}, function(){}); |
| 23 testFailed("decodeAudioData(null) did not invoke errorCallback."); | 23 testFailed("decodeAudioData should raise exception when arraybuffer paramete
r is null."); |
| 24 }, | 24 } catch(e) { |
| 25 function (e) { | 25 testPassed("decodeAudioData raises exception correctly when arraybuffer para
meter is null."); |
| 26 testPassed("decodeAudioData(null) invoked errorCallback correctly: " + e); | 26 } |
| 27 }); | |
| 28 | 27 |
| 29 var decodeCaseArray = [{url: "resources/media/24bit-44khz.wav", result: true}, | 28 var decodeCaseArray = [{url: "resources/media/24bit-44khz.wav", result: true}, |
| 30 {url: "resources/media/invalid-audio-file.txt", result: f
alse}]; | 29 {url: "resources/media/invalid-audio-file.txt", result: f
alse}]; |
| 31 | 30 |
| 32 function runDecodeTest(index) { | 31 function runDecodeTest(index) { |
| 33 if (index >= decodeCaseArray.length) { | 32 if (index >= decodeCaseArray.length) { |
| 34 finishJSTest(); | 33 finishJSTest(); |
| 35 return; | 34 return; |
| 36 } | 35 } |
| 37 | 36 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 61 } | 60 } |
| 62 } | 61 } |
| 63 request.send(); | 62 request.send(); |
| 64 } | 63 } |
| 65 | 64 |
| 66 runDecodeTest(0); | 65 runDecodeTest(0); |
| 67 | 66 |
| 68 </script> | 67 </script> |
| 69 </body> | 68 </body> |
| 70 </html> | 69 </html> |
| OLD | NEW |