mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
dd26dee475
--HG-- extra : rebase_source : b9ee2200c86a0c3fa06cdb163a39a183aa313380
71 lines
1.5 KiB
HTML
71 lines
1.5 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>Media test: seek test 5</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>
|
|
<video id='v'
|
|
src='seek.ogv'
|
|
onloadedmetadata='return startTest();'
|
|
onseeking='return seekStarted();'
|
|
onseeked='return seekEnded();'></video>
|
|
<pre id="test">
|
|
<script class="testbody" type="text/javascript">
|
|
// Test for a seek, followed by another seek before the first is complete.
|
|
var startPassed = false;
|
|
var seek1Passed = false;
|
|
var seek2Passed = false;
|
|
var seekCount = 0;
|
|
var completed = false;
|
|
|
|
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.currentTime=1;
|
|
return false;
|
|
}
|
|
|
|
function seekEnded() {
|
|
if (completed)
|
|
return false;
|
|
var v = document.getElementById('v');
|
|
seekCount++;
|
|
if(seekCount == 1) {
|
|
if (v.currentTime >= 2 && v.currentTime <= 2.2)
|
|
seek1Passed = true;
|
|
}
|
|
|
|
if(seekCount == 2) {
|
|
if (v.currentTime >= 1 && v.currentTime <= 1.2)
|
|
seek2Passed = true;
|
|
|
|
ok(seek1Passed, "First seek");
|
|
ok(seek2Passed, "Second seek");
|
|
completed = true;
|
|
SimpleTest.finish();
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
</script>
|
|
</pre>
|
|
</body>
|
|
</html>
|