Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / media / video / test / test_wav_seek6.html
blobdd2484f9381277a9fc47bc20d7dd2e4a88bba2c0
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Wave Media test: seek test 6</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 onseeking='return seekStarted();'
14 onseeked='return seekEnded();'>
15 <source type='audio/x-wav' src='r11025_s16_c1.wav'>
16 </audio>
17 <pre id="test">
18 <script class="testbody" type="text/javascript">
19 // Test for a seek, followed by a play before the seek completes, ensure we play at the end of the seek.
20 var startPassed = false;
21 var endPassed = false;
22 var completed = false;
23 var seekCount = 0;
25 function startTest() {
26 if (completed)
27 return false;
29 var v = document.getElementById('v');
30 v.currentTime=0.5;
31 return false;
34 function seekStarted() {
35 if (completed)
36 return false;
37 startPassed = true;
38 var v = document.getElementById('v');
39 v.play();
40 return false;
43 function seekEnded() {
44 if (completed)
45 return false;
46 endPassed = true;
47 return false;
50 function playbackEnded() {
51 if (completed)
52 return false;
53 ok(startPassed, "Got seeking event");
54 ok(endPassed, "Got seeked event");
55 completed = true;
56 SimpleTest.finish();
57 return false;
60 SimpleTest.waitForExplicitFinish();
61 </script>
62 </pre>
63 </body>
64 </html>