Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / media / video / test / test_wav_seek_past_end.html
blob69551ecc83f133d3111916e03ba4d7afd2ff2207
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Wave Media test: seek after file end</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 <audio id='v'
11 onloadedmetadata='return startTest();'
12 onended='return playbackEnded();'>
13 <source type='audio/x-wav' src='r11025_s16_c1.wav'>
14 </audio>
15 <pre id="test">
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() {
23 if (completed)
24 return false;
26 v.currentTime = v.duration + 0.5;
27 v.play();
28 return false;
31 function playbackEnded() {
32 if (completed)
33 return false
35 completed = true;
36 ok(v.currentTime >= 0.9 && v.currentTime <= 1.1,
37 "Checking currentTime at end: " + v.currentTime);
38 ok(v.ended, "Checking playback has ended");
39 SimpleTest.finish();
40 return false;
43 SimpleTest.waitForExplicitFinish();
44 </script>
45 </pre>
46 </body>
47 </html>