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 208367 53d300e03f5b
parent 208366 f17ade17a846
child 208368 11a5306111d0
push id3843
push userryanvm@gmail.com
push date2014-08-21 19:12 +0000
treeherdermozilla-beta@53d300e03f5b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, lmandel
bugs1056032
milestone32.0
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>