Bug 1056032 - Test that we can decode an mp3 using decodeAudioData. r=ehsan

--HG--
rename : content/media/test/small-shot.mp3 => content/media/webaudio/test/small-shot.mp3
This commit is contained in:
Paul Adenot 2014-08-20 17:23:24 -04:00
parent 3177326fa1
commit af6bd3a2c3
4 changed files with 38 additions and 0 deletions

View File

@ -310,6 +310,7 @@ skip-if = buildapp == 'mulet' || os == 'win' # bug 894922
[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

View File

@ -13,6 +13,7 @@ support-files =
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
@ -71,6 +72,7 @@ skip-if = (toolkit == 'gonk' && !debug) || (toolkit == 'android') #bug 906752
[test_bug956489.html]
[test_bug964376.html]
[test_bug972678.html]
[test_bug1056032.html]
[test_channelMergerNode.html]
[test_channelMergerNodeWithVolume.html]
[test_channelSplitterNode.html]

Binary file not shown.

View File

@ -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>