Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / media / video / test / test_wav_seek5.html
blob3d897cf9ed4f1007e81b56d459a016b1478ad55d
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Wave Media test: seek test 5</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 onseeking='return seekStarted();'
13 onseeked='return seekEnded();'>
14 <source type='audio/x-wav' src='r11025_s16_c1.wav'>
15 </audio>
16 <pre id="test">
17 <script class="testbody" type="text/javascript">
18 // Test for a seek, followed by another seek before the first is complete.
19 var startPassed = false;
20 var seek1Passed = false;
21 var seek2Passed = false;
22 var seekCount = 0;
23 var completed = false;
25 function startTest() {
26 if (completed)
27 return false;
29 var v = document.getElementById('v');
30 v.currentTime=0.8;
31 return false;
34 function seekStarted() {
35 if (completed)
36 return false;
38 startPassed = true;
39 var v = document.getElementById('v');
40 v.currentTime=0.5;
41 return false;
44 function seekEnded() {
45 if (completed)
46 return false;
47 var v = document.getElementById('v');
48 seekCount++;
49 if(seekCount == 1) {
50 if (v.currentTime >= 0.7 && v.currentTime <= 0.9)
51 seek1Passed = true;
54 if(seekCount == 2) {
55 if (v.currentTime >= 0.4 && v.currentTime <= 0.6)
56 seek2Passed = true;
58 ok(seek1Passed, "First seek");
59 ok(seek2Passed, "Second seek");
60 completed = true;
61 SimpleTest.finish();
64 return false;
67 SimpleTest.waitForExplicitFinish();
68 </script>
69 </pre>
70 </body>
71 </html>