Make Remote Control commands testable
[WebKit-https.git] / LayoutTests / media / video-remote-control-playpause-expected.txt
1   
2 Test play and pause with "remote control" interface.
3
4 EVENT(canplaythrough)
5 EVENT(canplaythrough)
6
7 ** Play both videos, the last one started (video[1]) should get focus...
8 RUN(videos[0].play())
9 RUN(videos[1].play())
10
11 EVENT(playing)
12 EVENT(playing)
13
14 ** Send a pause command, it should go to video[1].
15 RUN(internals.postRemoteControlCommand('pause'))
16
17 EVENT(pause)
18 EXPECTED (event.target.id == 'two') OK
19 EXPECTED (videos[0].paused == 'false') OK
20 EXPECTED (videos[1].paused == 'true') OK
21
22 ** Pause video[0], so they both stop playing...
23 RUN(videos[0].pause())
24
25 EVENT(pause)
26 EXPECTED (event.target.id == 'one') OK
27 EXPECTED (videos[0].paused == 'true') OK
28 EXPECTED (videos[1].paused == 'true') OK
29
30 ** Seek so video[1] will pause automatically when playback ends.
31 RUN(videos[0].currentTime = 0)
32 RUN(videos[1].currentTime = 5.5)
33
34 EVENT(seeked)
35 EVENT(seeked)
36
37 ** Send a play command, it should go to videos[0] because it was playing most recently.
38 RUN(internals.postRemoteControlCommand('play'))
39
40 EVENT(playing)
41 EXPECTED (event.target.id == 'one') OK
42
43 ** Start videos[1], wait for it to pause at duration.
44 RUN(videos[1].play())
45
46 EVENT(playing)
47 EXPECTED (event.target.id == 'two') OK
48
49 EVENT(pause)
50 EXPECTED (event.target.id == 'two') OK
51 EXPECTED (videos[0].paused == 'false') OK
52 EXPECTED (videos[1].paused == 'true') OK
53
54 ** Send a pause command, videos[0] is still playing so it should get the command.
55 RUN(internals.postRemoteControlCommand('pause'))
56
57 EVENT(pause)
58 EXPECTED (event.target.id == 'one') OK
59 EXPECTED (videos[0].paused == 'true') OK
60 EXPECTED (videos[1].paused == 'true') OK
61
62 END OF TEST
63