Bug 1056032 - Test that we can decode an mp3 using decodeAudioData. r=ehsan
authorPaul Adenot <paul@paul.cx>
Wed, 20 Aug 2014 17:23:24 -0400
changeset 200760 232e907a893fd0f93824407ea88d12138b5ff8cd
parent 200759 2423b6217200526c227496ac8a2c4cf5f8625c3b
child 200761 6ded38cc54e3f82cd75fc6387cf0e8ff278a2cf5
push id47999
push userpaul@paul.cx
push dateThu, 21 Aug 2014 11:46:24 +0000
treeherdermozilla-inbound@232e907a893f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1056032
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1056032 - Test that we can decode an mp3 using decodeAudioData. r=ehsan
content/media/test/mochitest.ini
content/media/webaudio/test/mochitest.ini
content/media/webaudio/test/small-shot.mp3
content/media/webaudio/test/test_bug1056032.html
--- a/content/media/test/mochitest.ini
+++ b/content/media/test/mochitest.ini
@@ -305,16 +305,17 @@ skip-if = buildapp == 'mulet' || os == '
 [test_bug726904.html]
 [test_bug874897.html]
 [test_bug883173.html]
 [test_bug895091.html]
 [test_bug895305.html]
 [test_bug919265.html]
 [test_bug957847.html]
 [test_bug1018933.html]
+skip-if = toolkit == 'android' # bug 1056706
 [test_can_play_type.html]
 [test_can_play_type_mpeg.html]
 skip-if = buildapp == 'b2g' # bug 1021675
 [test_can_play_type_no_ogg.html]
 [test_can_play_type_ogg.html]
 skip-if = buildapp == 'b2g' || e10s # b2g(bug 1021675)
 [test_chaining.html]
 [test_clone_media_element.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>