4a3f9f2663fc0e90df62315107562949d34043bb
[WebKit-https.git] / LayoutTests / media / video-seek-past-end-playing.html
1 <video loop controls></video>
2 <p>Test that seeking video with 'loop' past it's end rewinds to the beginning and continues playback.</p>
3 <script src=video-test.js></script>
4 <script>
5
6     waitForEvent('load', function () { 
7         testExpected("video.paused", true);
8         run("video.play()");
9         testExpected("video.paused", false);
10         setTimeout(timeCheck1, 200);
11     });
12
13     function timeCheck1() 
14     {
15         // make sure time is advancing, seek past end
16         consoleWrite("");
17         testExpected("video.paused", false);
18         testExpected("mediaElement.currentTime", 0, '>');
19         run("video.currentTime = 500");
20         setTimeout(timeCheck2, 200);
21     }
22
23     function timeCheck2() 
24     {
25         consoleWrite("");
26         testExpected("video.paused", false);
27         testExpected("mediaElement.currentTime", 0, '>');
28         consoleWrite("");
29         endTest();
30     }
31
32     run("video.src = 'content/test.mp4'");
33     consoleWrite("");
34 </script>