Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / media / video / test / test_seek6.html
blob4dfd112fb09992f470f5dbe4463e5a08594b7f3b
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Media test: seek test 6</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 for a seek, followed by a play before the seek completes, ensure we play at the end of the seek.
19 var startPassed = false;
20 var endPassed = false;
21 var completed = false;
22 var seekCount = 0;
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;
36 startPassed = true;
37 var v = document.getElementById('v');
38 v.play();
39 return false;
42 function seekEnded() {
43 if (completed)
44 return false;
45 endPassed = true;
46 return false;
49 function playbackEnded() {
50 if (completed)
51 return false;
52 ok(startPassed, "Got seeking event");
53 ok(endPassed, "Got seeked event");
54 completed = true;
55 SimpleTest.finish();
56 return false;
59 SimpleTest.waitForExplicitFinish();
60 </script>
61 </pre>
62 </body>
63 </html>