Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / media / video / test / test_timeupdate3.html
bloba2dee8fb3d239a4f3c00b0113d7ef573f58a920c
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Media test: timeupdate and size</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 <video id='v'
11 src='seek.ogg'
12 onloadedmetadata='return startTest();'
13 onseeking='return startSeek();'
14 ontimeupdate='return timeUpdated();'></video>
15 <pre id="test">
16 <script class="testbody" type="text/javascript">
17 // Test if the media size during the first timeupdate is correct.
18 var completed = false;
19 var seeking = false;
21 function startTest() {
22 if (completed)
23 return false;
25 var v = document.getElementById('v');
26 v.currentTime=2.0;
27 return false;
30 function startSeek() {
31 if (completed)
32 return false;
34 seeking = true;
35 return false;
38 function timeUpdated() {
39 if (completed || !seeking)
40 return false;
42 var v = document.getElementById('v');
43 ok(v.currentTime >= 1.8 && v.currentTime <= 2.2,
44 "Check currentTime of " + v.currentTime + " is within range in timeupdate after seek");
45 completed = true;
46 v.pause();
47 SimpleTest.finish();
48 return false;
51 SimpleTest.waitForExplicitFinish();
52 </script>
53 </pre>
54 </body>
55 </html>