gecko/content/media/test/test_timeupdate3.html

56 lines
1.3 KiB
HTML
Raw Normal View History

<!DOCTYPE HTML>
<html>
<head>
<title>Media test: timeupdate and size</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 if the media size during the first timeupdate is correct.
var completed = false;
var seeking = false;
function startTest() {
if (completed)
return false;
var v = document.getElementById('v');
v.currentTime=2.0;
return false;
}
function startSeek() {
if (completed)
return false;
seeking = true;
return false;
}
function timeUpdated() {
if (completed || !seeking)
return false;
var v = document.getElementById('v');
ok(v.currentTime >= 1.8 && v.currentTime <= 2.2,
"Check currentTime of " + v.currentTime + " is within range in timeupdate after seek");
completed = true;
v.pause();
SimpleTest.finish();
return false;
}
SimpleTest.waitForExplicitFinish();
</script>
</pre>
<video id='v'
src='seek.ogv'
onloadedmetadata='return startTest();'
onseeking='return startSeek();'
ontimeupdate='return timeUpdated();'></video>
</body>
</html>