Git init
[framework/web/webkit-efl.git] / LayoutTests / media / video-seek-past-end-paused.html
1
2 <video controls></video>
3 <p>Test that seeking paused video past it's duration time sets currentTime to duration and leaves video paused.</p>
4 <script src=media-file.js></script>
5 <script src=video-test.js></script>
6 <script>
7
8     waitForEvent('canplaythrough', function () { 
9         testExpected("video.paused", true);
10         testExpected("video.ended", false);
11         run("video.play()");
12         setTimeout(timeCheck1, 200);
13     });
14
15     function timeCheck1() 
16     {
17         consoleWrite("");
18
19         // make sure time is advancing, seek past end
20         testExpected("video.paused", false);
21         testExpected("mediaElement.currentTime", 0, '>');
22         video.currentTime = 500;
23         setTimeout(timeCheck2, 200);
24     }
25
26     function timeCheck2() 
27     {
28         consoleWrite("");
29
30         // don't use "testExpected()" so we won't log the actual duration to the
31         //  results file, as the floating point result may differ with different engines
32         reportExpected(mediaElement.currentTime == mediaElement.duration, "mediaElement.currentTime", "==", "mediaElement.duration", mediaElement.currentTime);
33
34         testExpected("video.ended", true);
35         consoleWrite("");
36         endTest();
37     }
38
39     var mediaFile = findMediaFile("video", "content/test");
40     disableFullTestDetailsPrinting();
41     runSilently("video.src = '" + mediaFile + "'");
42     enableFullTestDetailsPrinting();
43     run("video.load()");
44     consoleWrite("");
45 </script>