[Modern Media Controls] Turn media/modern-media-controls/ios-inline-media-controls...
[WebKit-https.git] / LayoutTests / media / video-currentTime-set.html
1 <html>
2 <body>
3
4     <video controls></video>
5     
6     <p>Test that setting currentTime changes the time, and that 'ended' event is fired in a reasonable amount of time</p>
7     
8     <script src=media-file.js></script>
9     <script src=video-test.js></script>
10     <script>
11     waitForEvent('canplaythrough',  
12     function () { 
13         waitForEventAndEnd('ended');
14     
15         testExpected("video.currentTime", 0);
16         run("video.currentTime = video.duration - 0.2"); 
17     });
18
19     waitForEvent('seeked',
20     function () {
21         testExpected("video.currentTime.toFixed(2)", (video.duration - 0.2).toFixed(2));
22         run("video.play()"); 
23         consoleWrite("");
24     });
25
26     video.src = findMediaFile("video", "content/test");
27     </script>
28
29 </body>
30 </html>