2009-07-09 20:08:34 -07:00
|
|
|
<!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>
|
2009-10-20 20:24:21 -07:00
|
|
|
<script type="text/javascript" src="seek10.js"></script>
|
2009-07-09 20:08:34 -07:00
|
|
|
</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;
|
|
|
|
|
2009-07-14 07:04:56 -07:00
|
|
|
if (!tmpVid.canPlayType(test.type)) {
|
2009-07-09 20:08:34 -07:00
|
|
|
doNextFile();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-10-20 20:24:21 -07:00
|
|
|
for (var i = 1; i <= 10; ++i) {
|
2009-07-09 20:08:34 -07:00
|
|
|
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);
|
2009-10-19 19:48:03 -07:00
|
|
|
}}(name);
|
2009-07-09 20:08:34 -07:00
|
|
|
var localOk = function(name) { return function(a, msg) {
|
|
|
|
ok(a, name + ": " + msg);
|
2009-10-19 19:48:03 -07:00
|
|
|
}}(name);
|
2009-07-09 20:08:34 -07:00
|
|
|
var localFinish = function() {
|
|
|
|
--testsWaiting;
|
|
|
|
if (testsWaiting == 0) {
|
|
|
|
for (var j = 0; j < videos.length; ++j) {
|
|
|
|
document.body.removeChild(videos[j]);
|
|
|
|
}
|
|
|
|
videos = [];
|
|
|
|
doNextFile();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
window['test_seek' + i](v, test.duration/2, localIs, localOk, localFinish);
|
|
|
|
++testsWaiting;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
doNextFile();
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|