Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / video-loop-expected.txt
blob2e5fa758000e390c2a127da59b7d005fb2672745
1 Test looping by:
3 Play to end with 'loop' set to true.
4 When 'seeked' event fires, verify that time has jumped back and movie is playing.
5 Set 'loop' to false and play again.
6 Verify that 'ended' event fires.
7 ++ Test setting/removing the attribute.
8 EXPECTED (video.getAttribute('loop') == 'null') OK
9 EXPECTED (video.loop == 'false') OK
10 RUN(video.loop = true)
11 EXPECTED (video.loop == 'true') OK
12 EXPECTED (video.getAttribute('loop') != 'null') OK
13 RUN(video.removeAttribute('loop'))
14 EXPECTED (video.loop == 'false') OK
16 ++ Set 'loop' to true and begin playing.
17 RUN(video.loop = true)
19 EVENT(play)
21 ++ seek to near the end, wait for 'seeked' event to announce loop.
22 EXPECTED (video.paused == 'false') OK
23 RUN(video.pause())
24 RUN(video.currentTime = video.duration - 0.4)
26 EVENT(pause)
27 EVENT(seeked)
29 ++ first seek completed, beginning playback.
30 EXPECTED (video.paused == 'true') OK
31 EXPECTED (video.ended == 'false') OK
32 RUN(video.play())
34 EVENT(play)
35 EVENT(seeked)
37 ++ second seek completed because video looped, toggle 'loop' and seek to near end again.
38 EXPECTED (video.paused == 'false') OK
39 EXPECTED (video.ended == 'false') OK
40 RUN(video.pause())
41 EXPECTED (mediaElement.currentTime >= '0') OK
42 EXPECTED (mediaElement.currentTime < 'mediaElement.duration') OK
43 RUN(video.loop = false)
44 RUN(video.currentTime = video.duration - 0.4)
46 EVENT(pause)
47 EVENT(seeked)
49 ++ third seek completed, beginning playback for the last time.
50 EXPECTED (video.paused == 'true') OK
51 EXPECTED (video.ended == 'false') OK
52 RUN(video.play())
54 EVENT(play)
55 EVENT(pause)
56 EVENT(ended)
58 ++ played to end and stopped.
59 EXPECTED (video.ended == 'true') OK
60 EXPECTED (mediaElement.currentTime == 'mediaElement.duration') OK
62 END OF TEST