Bug 1056032 - Test that we can decode an mp3 using decodeAudioData. r=ehsan, a=lmandel
authorPaul Adenot <paul@paul.cx>
Wed, 20 Aug 2014 17:23:24 -0400
changeset 209484 d6b8c53504b34b4d53d85b781754174981877539
parent 209483 5eee74e004875860b397b8bfc467a26749d2d561
child 209485 f830a26234295a680901f5caec348bbee82553bb
push id6685
push userryanvm@gmail.com
push dateThu, 21 Aug 2014 19:12:01 +0000
treeherdermozilla-aurora@947dd9a0f12b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, lmandel
bugs1056032
milestone33.0a2
Bug 1056032 - Test that we can decode an mp3 using decodeAudioData. r=ehsan, a=lmandel
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
@@ -62,16 +63,18 @@ skip-if = (toolkit == 'gonk') || (toolki
 [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]
+skip-if = toolkit == 'android' # bug 1056706
 [test_channelMergerNode.html]
 [test_channelMergerNodeWithVolume.html]
 [test_channelSplitterNode.html]
 [test_channelSplitterNodeWithVolume.html]
 [test_convolverNode.html]
 [test_convolverNode_mono_mono.html]
 [test_convolverNodeChannelCount.html]
 [test_convolverNodeWithGain.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>