4 <title>Wave Media test: playback ends when file is truncated
</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" />
11 onloadedmetadata='return startTest();'
12 onended='return playbackEnded();'
>
13 <source type='audio/x-wav' src='r11025_u8_c1_trunc.wav'
>
16 <script class=
"testbody" type=
"text/javascript">
17 // Test if the ended event works correctly.
18 var v = document.getElementById('v');
19 var endPassed = false;
20 var completed = false;
22 function startTest() {
26 ok(v.duration
> 1.7 && v.duration <
1.9,
"Duration should be around 1.8: " + v.duration);
32 function playbackEnded() {
37 ok(v.currentTime
>=
1.7 && v.currentTime <=
1.9,
38 "Checking currentTime at end: " + v.currentTime);
39 ok(v.ended,
"Checking playback has ended");
44 SimpleTest.waitForExplicitFinish();