Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / media / video / test / test_wav_seek7.html
blob91631ab4d4b1b1ecde8a7cb9e76ed4c78990d311
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Wave Media test: seek test 7</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 onseeked='return seekEnded();'>
13 <source type='audio/x-wav' src='r11025_s16_c1.wav'>
14 </audio>
15 <pre id="test">
16 <script class="testbody" type="text/javascript;version=1.7">
17 // Test for bug identified by Chris Pearce in comment 40 on
18 // bug 449159.
19 var v = document.getElementById('v');
20 var seekCount = 0;
21 var completed = false;
22 var interval;
24 function startTest() {
25 if (completed)
26 return false;
28 var seek = function () {
29 var i = 0;
30 for (;;) {
31 i += 0.1;
32 if (i > 1)
33 i = 0;
34 yield i;
36 }();
38 interval = setInterval(function() { v.currentTime=seek.next(); }, 10);
39 return false;
42 function seekEnded() {
43 if (completed)
44 return false;
46 seekCount++;
47 ok(true, "Seek " + seekCount);
48 if (seekCount == 3) {
49 clearInterval(interval);
50 completed = true;
51 SimpleTest.finish();
53 return false;
56 SimpleTest.waitForExplicitFinish();
57 </script>
58 </pre>
59 </body>
60 </html>