Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / media / video / test / test_seek4.html
blobbe5711e9f5f9c77cefc62351be6165aac3583ede
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Media test: seek test 4</title>
5 <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
6 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
8 </head>
9 <body>
10 <video id='v'
11 src='seek.ogg'
12 onloadedmetadata='return startTest();'
13 onseeking='return seekStarted();'
14 onseeked='return seekEnded();'></video>
15 <pre id="test">
16 <script class="testbody" type="text/javascript">
17 // Test seeking works if current time is set but video is not played.
18 var startPassed = false;
19 var completed = false;
21 function startTest() {
22 if (completed)
23 return false;
25 var v = document.getElementById('v');
26 v.currentTime=2;
27 return false;
30 function seekStarted() {
31 if (completed)
32 return false;
34 startPassed = true;
35 return false;
38 function seekEnded() {
39 if (completed)
40 return false;
42 var t = document.getElementById('v').currentTime;
43 ok(t >= 2 && t<= 3, "Video currentTime should be around 2: " + t);
44 completed = true;
45 SimpleTest.finish();
46 return false;
49 SimpleTest.waitForExplicitFinish();
50 </script>
51 </pre>
52 </body>
53 </html>