Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / media / video / test / test_wav_seek3.html
blob0d5458d1848b03bc0d7f848bf605f20da800ecd3
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Wave Media test: seek test 3</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 seeking works if current time is set before audio is
20 // playing.
21 var startPassed = false;
22 var endPassed = false;
23 var completed = false;
25 function startTest() {
26 if (completed)
27 return false;
29 var v = document.getElementById('v');
30 v.currentTime=0.5;
31 v.play();
32 return false;
35 function seekStarted() {
36 if (completed)
37 return false;
39 startPassed = true;
40 return false;
43 function seekEnded() {
44 if (completed)
45 return false;
47 endPassed = true;
48 return false;
51 function playbackEnded() {
52 if (completed)
53 return false
55 completed = true;
56 ok(startPassed, "send seeking event");
57 ok(endPassed, "send seeked event");
58 SimpleTest.finish();
59 return false;
62 SimpleTest.waitForExplicitFinish();
63 </script>
64 </pre>
65 </body>
66 </html>