Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / video-seek-past-end-playing.html
blob15aac4a71a7cb25fe19705aa289e92e9e464c927
1 <html>
2 <body>
4 <video loop controls></video>
5 <p>Test that seeking video with 'loop' past it's end rewinds to the beginning and continues playback.</p>
6 <script src=media-file.js></script>
7 <script src=video-test.js></script>
8 <script>
9 var timeupdateEventCount = 0;
11 waitForEventOnce('canplaythrough', function () {
12 testExpected("video.paused", true);
13 run("video.play()");
14 testExpected("video.paused", false);
15 });
17 function timeupdate()
19 ++timeupdateEventCount;
21 // wait 2 timeupdate events so we are sure the media engine is
22 // playing the media.
23 if (timeupdateEventCount == 2) {
24 consoleWrite("");
25 testExpected("video.paused", false);
26 // make sure time is advancing and seek past end
27 testExpected("mediaElement.currentTime", 0, '>');
28 run("video.currentTime = 500");
29 } else if (timeupdateEventCount == 10) {
30 // Wait some more timeupdate events so we can check the
31 // media engine performed the seek.
32 consoleWrite("");
33 testExpected("video.paused", false);
34 testExpected("mediaElement.currentTime", 0, '>');
35 consoleWrite("");
36 // reset the counter to prevent infinite loop if the
37 // test is re-executed manually.
38 timeupdateEventCount = 0;
39 endTest();
43 mediaElement.addEventListener("timeupdate", timeupdate);
44 var mediaFile = findMediaFile("video", "content/test");
45 disableFullTestDetailsPrinting();
46 runSilently("video.src = '" + mediaFile + "'");
47 enableFullTestDetailsPrinting();
48 </script>
49 </body>
50 </html>