gecko/content/media/video/test/test_seek6.html

64 lines
1.4 KiB
HTML

<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek test 6</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 for a seek, followed by a play before the seek completes, ensure we play at the end of the seek.
var startPassed = false;
var endPassed = false;
var completed = false;
var seekCount = 0;
function startTest() {
if (completed)
return false;
var v = document.getElementById('v');
v.currentTime=2;
return false;
}
function seekStarted() {
if (completed)
return false;
startPassed = true;
var v = document.getElementById('v');
v.play();
return false;
}
function seekEnded() {
if (completed)
return false;
endPassed = true;
return false;
}
function playbackEnded() {
if (completed)
return false;
ok(startPassed, "Got seeking event");
ok(endPassed, "Got seeked event");
completed = true;
SimpleTest.finish();
return false;
}
SimpleTest.waitForExplicitFinish();
</script>
</pre>
<video id='v'
src='seek.ogv'
onloadedmetadata='return startTest();'
onended='return playbackEnded();'
onseeking='return seekStarted();'
onseeked='return seekEnded();'></video>
</body>
</html>