3 <script src=../../media-resources/media-file.js
></script>
4 <script src=../../media-resources/video-test.js
></script>
10 waitForEvent('durationchange');
11 waitForEvent('loadedmetadata');
12 waitForEventOnce('loadeddata', function ()
14 waitForEvent('seeking', function ()
16 testExpected('video.seeking', true, '==');
17 testExpected('video.ended', true, '==');
18 testExpected('video.currentTime == video.duration', true, '==');
19 testExpected('video.paused', false, '==');
21 waitForEventOnce('timeupdate', function()
23 testExpected('video.seeking', false, '==');
24 testExpected('video.ended', true, '==');
25 testExpected('video.currentTime == video.duration', true, '==');
29 waitForEvent('seeked', function ()
31 testExpected('video.seeking', false, '==');
32 testExpected('video.ended', true, '==');
33 testExpected('video.currentTime == video.duration', true, '==');
37 waitForEvent('pause', function()
39 testExpected('video.paused', true, '==');
40 testExpected('video.seeking', false, '==');
41 testExpected('video.ended', true, '==');
42 testExpected('video.currentTime == video.duration', true, '==');
45 waitForEvent('ended', function ()
47 testExpected('video.seeking', false, '==');
48 testExpected('video.ended', true, '==');
49 testExpected('video.paused', true, '==');
50 testExpected('video.currentTime == video.duration', true, '==');
54 // Seek to the duration of the media
55 testExpected('video.currentTime < video.duration', true, '==');
56 testExpected('video.ended', false, '==');
57 testExpected('video.paused', false, '==');
58 consoleWrite('Starting seek to duration by setting video.currentTime to video.duration');
59 video
.currentTime
= video
.duration
;
60 testExpected('video.currentTime == video.duration', true, '==');
61 testExpected('video.seeking', true, '==');
62 testExpected('video.ended', true, '==');
65 var mediaFile
= findMediaFile('video', 'resources/test');
66 video
.src
= '/' + mediaFile
;
71 <body onload=
"start()">
73 <p>Test event dispatches and attribute changes for seek to duration
</p>