gecko/content/media/test/test_duration1.html

40 lines
1018 B
HTML

<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek test 1</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" />
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
// Test that getting the duration from a file works
var completed = false;
var timeout;
function startTest() {
if (completed)
return false;
var v = document.getElementById('v');
is(Math.round(v.duration*1000), 3999, "Check duration of video: " + v.duration);
completed = true;
clearTimeout(timeout);
SimpleTest.finish();
return false;
}
timeout = setTimeout(function () {
ok(false, "Test timed out");
SimpleTest.finish();
}, 60000);
SimpleTest.waitForExplicitFinish();
</script>
</pre>
<video id='v'
src='seek.ogv'
onloadedmetadata='return startTest();'></video>
</body>
</html>