Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / media / video / test / test_seek3.html
blobfa59096b1c349fea584c0dcddf1b83e1fcaee629
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Media test: seek test 3</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 onended='return playbackEnded();'
14 onseeking='return seekStarted();'
15 onseeked='return seekEnded();'></video>
16 <pre id="test">
17 <script class="testbody" type="text/javascript">
18 // Test seeking works if current time is set before video is
19 // playing.
20 var startPassed = false;
21 var endPassed = false;
22 var completed = false;
24 function startTest() {
25 if (completed)
26 return false;
28 var v = document.getElementById('v');
29 v.currentTime=2;
30 v.play();
31 return false;
34 function seekStarted() {
35 if (completed)
36 return false;
38 startPassed = true;
39 return false;
42 function seekEnded() {
43 if (completed)
44 return false;
46 endPassed = true;
47 return false;
50 function playbackEnded() {
51 if (completed)
52 return false
54 completed = true;
55 ok(startPassed, "send seeking event");
56 ok(endPassed, "send seeked event");
57 SimpleTest.finish();
58 return false;
61 SimpleTest.waitForExplicitFinish();
62 </script>
63 </pre>
64 </body>
65 </html>