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>
9 var timeupdateEventCount
= 0;
11 waitForEventOnce('canplaythrough', function () {
12 testExpected("video.paused", true);
14 testExpected("video.paused", false);
19 ++timeupdateEventCount
;
21 // wait 2 timeupdate events so we are sure the media engine is
23 if (timeupdateEventCount
== 2) {
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.
33 testExpected("video.paused", false);
34 testExpected("mediaElement.currentTime", 0, '>');
36 // reset the counter to prevent infinite loop if the
37 // test is re-executed manually.
38 timeupdateEventCount
= 0;
43 mediaElement
.addEventListener("timeupdate", timeupdate
);
44 var mediaFile
= findMediaFile("video", "content/test");
45 disableFullTestDetailsPrinting();
46 runSilently("video.src = '" + mediaFile
+ "'");
47 enableFullTestDetailsPrinting();