Bug 1056032 - Test that we can decode an mp3 using decodeAudioData. r=ehsan
☠☠ backed out by 83688052844e ☠ ☠
authorPaul Adenot <paul@paul.cx>
Wed, 20 Aug 2014 17:23:24 -0400
changeset 200704 18b0e0c795d4da1dbc413a4cd05d359c469ba271
parent 200703 15caaf563783b5523bb4000e9e4960d24c06e5b8
child 200705 b3752aaa0900f77d2428e8b21ed6f4c1c1b6deee
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersehsan
bugs1056032
milestone34.0a1
Bug 1056032 - Test that we can decode an mp3 using decodeAudioData. r=ehsan
content/media/webaudio/test/mochitest.ini
content/media/webaudio/test/small-shot.mp3
content/media/webaudio/test/test_bug1056032.html
--- a/content/media/webaudio/test/mochitest.ini
+++ b/content/media/webaudio/test/mochitest.ini
@@ -8,16 +8,17 @@ support-files =
   audio.ogv
   audioBufferSourceNodeNeutered_worker.js
   invalid.txt
   layouttest-glue.js
   noaudio.webm
   small-shot-expected.wav
   small-shot-mono-expected.wav
   small-shot.ogg
+  small-shot.mp3
   ting-44.1k-1ch.ogg
   ting-44.1k-2ch.ogg
   ting-48k-1ch.ogg
   ting-48k-2ch.ogg
   ting-44.1k-1ch.wav
   ting-44.1k-2ch.wav
   ting-48k-1ch.wav
   ting-48k-2ch.wav
@@ -66,16 +67,17 @@ skip-if = (toolkit == 'gonk' && !debug) 
 [test_bug867174.html]
 [test_bug867203.html]
 [test_bug875221.html]
 [test_bug875402.html]
 [test_bug894150.html]
 [test_bug956489.html]
 [test_bug964376.html]
 [test_bug972678.html]
+[test_bug1056032.html]
 [test_channelMergerNode.html]
 [test_channelMergerNodeWithVolume.html]
 [test_channelSplitterNode.html]
 [test_channelSplitterNodeWithVolume.html]
 [test_convolverNode.html]
 [test_convolverNode_mono_mono.html]
 [test_convolverNodeChannelCount.html]
 [test_convolverNodePassThrough.html]
copy from content/media/test/small-shot.mp3
copy to content/media/webaudio/test/small-shot.mp3
new file mode 100644
--- /dev/null
+++ b/content/media/webaudio/test/test_bug1056032.html
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML>
+<html>
+<meta charset=utf-8>
+<head>
+  <title>Test that we can decode an mp3 (bug 1056032)</title>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+var filename = "small-shot.mp3";
+
+SimpleTest.waitForExplicitFinish();
+
+addLoadEvent(function() {
+  var xhr = new XMLHttpRequest();
+  xhr.open("GET", filename);
+  xhr.responseType = "arraybuffer";
+  xhr.onload = function() {
+    var context = new AudioContext();
+    context.decodeAudioData(xhr.response, function(b) {
+      ok(true, "We can decode an mp3 using decodeAudioData");
+      SimpleTest.finish();
+    }, function() {
+      ok(false, "We should be able to decode an mp3 using decodeAudioData but couldn't");
+      SimpleTest.finish();
+    });
+  };
+  xhr.send(null);
+});
+</script>
+</pre>
+</body>
+</html>