4 <script src=media-file.js
></script>
5 <script src=video-test.js
></script>
7 var timeupdateEventCount
= 0;
12 waitForEvent('canplaythrough', canPlayThrough
);
13 video
.src
= findMediaFile('video', 'content/test');
15 window
.addEventListener('load', doSetup
, false);
17 function canPlayThrough()
19 testExpected("video.paused", true);
20 testExpected("video.ended", false);
21 video
.addEventListener('timeupdate', timeUpdate
);
27 ++timeupdateEventCount
;
29 // Wait 2 timeupdate events so we are sure the media engine is
31 if (timeupdateEventCount
== 2) {
33 video
.removeEventListener('timeupdate', timeUpdate
);
34 // Make sure time is advancing.
35 testExpected("video.paused", false);
36 testExpected("mediaElement.currentTime", 0, '>');
37 video
.addEventListener('pause', paused
);
44 testExpected("video.paused", true);
45 video
.addEventListener('seeked', seeked
);
47 video
.currentTime
= 500;
54 testExpected("video.paused", true);
55 // Don't use "testExpected()" so we won't log the actual duration to the
56 // results file, as the floating point result may differ with different engines.
57 reportExpected(mediaElement
.currentTime
== mediaElement
.duration
, "mediaElement.currentTime", "==", "mediaElement.duration", mediaElement
.currentTime
);
59 testExpected("video.ended", true);
61 timeupdateEventCount
= 0;
67 <video controls
></video>
68 <p>Test that seeking a paused video past its end sets currentTime to duration and leaves the video paused.
</p>