test_bug1056032.html (940B)
1 <!DOCTYPE HTML> 2 <html> 3 <meta charset=utf-8> 4 <head> 5 <title>Test that we can decode an mp3 (bug 1056032)</title> 6 <script src="/tests/SimpleTest/SimpleTest.js"></script> 7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 8 </head> 9 <body> 10 <pre id="test"> 11 <script class="testbody" type="text/javascript"> 12 var filename = "small-shot.mp3"; 13 14 SimpleTest.waitForExplicitFinish(); 15 16 addLoadEvent(function() { 17 var xhr = new XMLHttpRequest(); 18 xhr.open("GET", filename); 19 xhr.responseType = "arraybuffer"; 20 xhr.onload = function() { 21 var context = new AudioContext(); 22 context.decodeAudioData(xhr.response, function() { 23 ok(true, "We can decode an mp3 using decodeAudioData"); 24 SimpleTest.finish(); 25 }, function() { 26 ok(false, "We should be able to decode an mp3 using decodeAudioData but couldn't"); 27 SimpleTest.finish(); 28 }); 29 }; 30 xhr.send(null); 31 }); 32 </script> 33 </pre> 34 </body> 35 </html>