gecko/content/media/test/test_seek.html
Chris Pearce c7317b404d Bug 564720 - Refactor media tests to be backend independent were possible. r=roc
--HG--
rename : content/media/test/test_play.html => content/media/test/test_play_events.html
rename : content/media/test/test_progress2.html => content/media/test/test_progress.html
rename : content/media/test/test_onloadedmetadata.html => content/media/test/test_replay_metadata.html
rename : content/media/test/test_wav_trunc_seek.html => content/media/test/test_seek_out_of_range.html
rename : content/media/test/test_bug495319.html => content/media/test/test_timeupdate_small_files.html
rename : content/media/test/test_bug486646.html => content/media/test/test_video_to_canvas.html
2010-05-31 10:02:06 +12:00

77 lines
2.2 KiB
HTML

<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek tests</title>
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<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>
<script type="text/javascript" src="seek1.js"></script>
<script type="text/javascript" src="seek2.js"></script>
<script type="text/javascript" src="seek3.js"></script>
<script type="text/javascript" src="seek4.js"></script>
<script type="text/javascript" src="seek5.js"></script>
<script type="text/javascript" src="seek6.js"></script>
<script type="text/javascript" src="seek7.js"></script>
<script type="text/javascript" src="seek8.js"></script>
<script type="text/javascript" src="seek9.js"></script>
<script type="text/javascript" src="seek10.js"></script>
<script type="text/javascript" src="seek11.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
var testNum = 0;
var testsWaiting = 0;
var videos = [];
var tmpVid = document.createElement("video");
function doNextFile() {
if (testNum >= gSeekTests.length) {
SimpleTest.finish();
return;
}
var test = gSeekTests[testNum];
++testNum;
if (!tmpVid.canPlayType(test.type)) {
doNextFile();
return;
}
for (var i = 1; i <= 11; ++i) {
var v = document.createElement('video');
v.src = test.name;
document.body.appendChild(v);
var name = test.name + " seek test " + i;
var localIs = function(name) { return function(a, b, msg) {
is(a, b, name + ": " + msg);
}}(name);
var localOk = function(name) { return function(a, msg) {
ok(a, name + ": " + msg);
}}(name);
var localFinish = function() {
--testsWaiting;
if (testsWaiting == 0) {
for (var j = 0; j < videos.length; ++j) {
document.body.removeChild(videos[j]);
}
videos = [];
doNextFile();
}
};
dump("Seek test: " + i + "\n");
window['test_seek' + i](v, test.duration/2, localIs, localOk, localFinish);
++testsWaiting;
}
}
doNextFile();
SimpleTest.waitForExplicitFinish();
</script>
</pre>
</body>
</html>