Bug 1211812 - Mochitest for unencrypted gmp decoding. r=jwwang

This commit is contained in:
Chris Pearce 2015-10-08 20:40:46 +13:00
parent cd5ed15a24
commit 5538ed9f57
3 changed files with 45 additions and 0 deletions

View File

@ -487,6 +487,8 @@ support-files =
short-cenc.mp4 short-cenc.mp4
sine.webm sine.webm
sine.webm^headers^ sine.webm^headers^
short.mp4
short.mp4^headers^
short-video.ogv short-video.ogv
short-video.ogv^headers^ short-video.ogv^headers^
small-shot-mp3.mp4 small-shot-mp3.mp4
@ -643,6 +645,8 @@ skip-if = toolkit == 'android' || (os == 'win' && !debug) || (os == 'mac' && !de
[test_fastSeek.html] [test_fastSeek.html]
skip-if = (toolkit == 'android' && processor == 'x86') #x86 only bug 914439 skip-if = (toolkit == 'android' && processor == 'x86') #x86 only bug 914439
[test_fastSeek-forwards.html] [test_fastSeek-forwards.html]
[test_gmp_playback.html]
skip-if = (os != 'win' || os_version == '5.1') # Only gmp-clearkey on Windows Vista and later decodes
[test_imagecapture.html] [test_imagecapture.html]
[test_info_leak.html] [test_info_leak.html]
[test_invalid_reject.html] [test_invalid_reject.html]

View File

@ -0,0 +1 @@
Cache-Control: no-store

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test playback of media files that should play OK</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
</head>
<body>
<div id="log"></div>
<pre id="test">
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
function startTest() {
var v = document.createElement("video");
ok(v.canPlayType('video/mp4; codecs="avc1.64000d,mp4a.40.2"') != "",
"Should be able to play MP4/H.264/AAC via <video> using GMP");
v.src = "short.mp4";
v.addEventListener("ended", function(event) {
ok(true, "Reached end");
SimpleTest.finish();
});
document.body.appendChild(v);
v.play();
}
var testPrefs = [
['media.fragmented-mp4.gmp.aac', 1], // gmp-clearkey
['media.fragmented-mp4.gmp.h264', 1], // gmp-clearkey
['media.fragmented-mp4.gmp.enabled', true]
];
SpecialPowers.pushPrefEnv({'set': testPrefs}, startTest);
</script>
</pre>
</body>
</html>