WebCore:
[WebKit-https.git] / LayoutTests / media / video-dom-loopstart.html
index 2d21195..44265cc 100644 (file)
@@ -1,9 +1,21 @@
-<video src=content/test.mp4 loopcount=2 autoplay></video>
+<video playcount=2></video>
+<p>Test that playing video rewinds to time specified by the loopStart DOM attribute when it loops.</p>
 <script src=video-test.js></script>
 <script>
 video.loopStart = 1.0;
 test("video.loopStart==1.0");
 test("video.getAttribute('loopstart') == '1s'");
-waitForEvent('play', function () { video.currentTime = 500; });
-waitForEventTestAndEnd('timeupdate', "video.currentTime.toFixed(1) && video.currentLoop==1");
+waitForEvent('load', function () {
+    waitForEvent('timeupdate', function () {
+        failTestIn(1000);
+        if (video.currentLoop == 1) {
+            test("video.currentLoop == 1");
+            test("video.currentTime.toFixed(1) == 1.0");
+            endTest();
+        }
+    });
+    video.currentTime = video.duration - 0.2;
+});
+video.src = "content/test.mp4";
+run("video.play()");
 </script>