Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / media / video / test / test_ended1.html
blob38bd33f5c62926861b9577b510846aebc8512c56
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Media test: ended</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();'></video>
14 <pre id="test">
15 <script class="testbody" type="text/javascript">
16 // Test if the ended event works correctly.
17 var v = document.getElementById('v');
18 var endPassed = false;
19 var completed = false;
21 function startTest() {
22 if (completed)
23 return false;
25 v.play();
26 return false;
29 function playbackEnded() {
30 if (completed)
31 return false
33 completed = true;
34 ok(v.currentTime >= 3.9 && v.currentTime <= 4.0,
35 "Checking currentTime at end: " + v.currentTime);
36 ok(v.ended, "Checking playback has ended");
37 SimpleTest.finish();
38 return false;
41 SimpleTest.waitForExplicitFinish();
42 </script>
43 </pre>
44 </body>
45 </html>