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" />
12 onloadedmetadata='return startTest();'
13 onended='return playbackEnded();'
></video>
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() {
29 function playbackEnded() {
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");
41 SimpleTest.waitForExplicitFinish();