gecko/content/media/video/test/test_seek7.html
Chris Pearce dd26dee475 Bug 463830. Use the video file name as the window title for standalone video objects, for now. r+sr=roc,r+sr=bzbarsky
--HG--
extra : rebase_source : b9ee2200c86a0c3fa06cdb163a39a183aa313380
2009-01-16 22:07:26 +13:00

50 lines
1.1 KiB
HTML

<!DOCTYPE HTML>
<html>
<head>
<title>Media test: seek test 7</title>
<script type="text/javascript" src="/MochiKit/MochiKit.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 bug identified by Chris Pearce in comment 40 on
// bug 449159.
var v;
var seekCount = 0;
var completed = false;
var interval;
function startTest() {
if (completed)
return false;
v = document.getElementById('v');
interval = setInterval(function() { v.currentTime=Math.random()*3; }, 10);
return false;
}
function seekEnded() {
if (completed)
return false;
seekCount++;
ok(true, "Seek " + seekCount);
if (seekCount == 3) {
clearInterval(interval);
completed = true;
SimpleTest.finish();
}
return false;
}
SimpleTest.waitForExplicitFinish();
</script>
</pre>
<video id='v'
src='seek.ogv'
onloadedmetadata='return startTest();'
onseeked='return seekEnded();'></video>
</body>
</html>