Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / media / video / test / test_wav_ended1.html
blobf110ac6d238b762a7cad4b1aaa111dae60d76aa2
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Wave 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 <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.play();
27 return false;
30 function playbackEnded() {
31 if (completed)
32 return false
34 completed = true;
35 ok(v.currentTime >= 0.9 && v.currentTime <= 1.1,
36 "Checking currentTime at end: " + v.currentTime);
37 ok(v.ended, "Checking playback has ended");
38 SimpleTest.finish();
39 return false;
42 SimpleTest.waitForExplicitFinish();
43 </script>
44 </pre>
45 </body>
46 </html>