Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / media / video / test / test_timeupdate1.html
bloba1f854cf7fa24683d5dbbde7ab353d81bdb96875
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Media test: timeupdate during playback</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 onended='return playbackEnded();'
14 ontimeupdate='return timeUpdated();'></video>
15 <pre id="test">
16 <script class="testbody" type="text/javascript">
17 // Test if timeupdate is dispatched and the current time during the
18 // update is increasing.
19 var lastTime = 0.0;
20 var completed = false;
22 function startTest() {
23 if (completed)
24 return false;
26 var v = document.getElementById('v');
27 v.play();
28 return false;
31 function timeUpdated() {
32 if (completed)
33 return false;
35 var v = document.getElementById('v');
36 ok(v.currentTime > lastTime,
37 "Check currentTime of " +
38 v.currentTime +
39 " is greater than last time of " +
40 lastTime);
41 lastTime = v.currentTime;
42 return false;
45 function playbackEnded() {
46 if (completed)
47 return false
49 completed = true;
50 SimpleTest.finish();
51 return false;
54 SimpleTest.waitForExplicitFinish();
55 </script>
56 </pre>
57 </body>
58 </html>