Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / media / video / test / test_seek5.html
blob9acc0d95e419b0d683b410bdd8ed62df49d1bdd3
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Media test: seek test 5</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 for a seek, followed by another seek before the first is complete.
18 var startPassed = false;
19 var seek1Passed = false;
20 var seek2Passed = false;
21 var seekCount = 0;
22 var completed = false;
24 function startTest() {
25 if (completed)
26 return false;
28 var v = document.getElementById('v');
29 v.currentTime=2;
30 return false;
33 function seekStarted() {
34 if (completed)
35 return false;
37 startPassed = true;
38 var v = document.getElementById('v');
39 v.currentTime=1;
40 return false;
43 function seekEnded() {
44 if (completed)
45 return false;
46 var v = document.getElementById('v');
47 seekCount++;
48 if(seekCount == 1) {
49 if (v.currentTime >= 2 && v.currentTime <= 2.2)
50 seek1Passed = true;
53 if(seekCount == 2) {
54 if (v.currentTime >= 1 && v.currentTime <= 1.2)
55 seek2Passed = true;
57 ok(seek1Passed, "First seek");
58 ok(seek2Passed, "Second seek");
59 completed = true;
60 SimpleTest.finish();
63 return false;
66 SimpleTest.waitForExplicitFinish();
67 </script>
68 </pre>
69 </body>
70 </html>