RESOLVED FIXED 147413
Media Session: test Play/Pause media control events delivered to Content media sessions
https://bugs.webkit.org/show_bug.cgi?id=147413
Summary Media Session: test Play/Pause media control events delivered to Content medi...
Matt Rajca
Reported 2015-07-29 12:02:21 PDT
Add tests that ensure that: - Play/Pause media control events delivered to active Content media sessions play/pause participating media elements. - Play/Pause media control events delivered to idle Content media sessions don't affect playback in media elements.
Attachments
Patch (4.86 KB, patch)
2015-07-29 14:22 PDT, Matt Rajca
eric.carlson: review+
Matt Rajca
Comment 1 2015-07-29 14:22:55 PDT
Radar WebKit Bug Importer
Comment 2 2015-07-29 14:23:23 PDT
Eric Carlson
Comment 3 2015-07-30 07:41:51 PDT
Comment on attachment 257767 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=257767&action=review > LayoutTests/media/session/play-pause-media-events-in-content-sessions-expected.txt:18 > +EVENT(canplaythrough) > +EXPECTED (internals.mediaSessionCurrentState(session) == 'idle') OK > +Idle Media Sessions should not respond to Play/Pause events. > +EXPECTED (video.paused == 'true') OK > +Sending Play/Pause media event. > +RUN(internals.sendMediaControlEvent("play-pause")) > +EXPECTED (video.paused == 'true') OK > +Playing media. > +Media began playing. > +EXPECTED (video.paused == 'false') OK > +EXPECTED (internals.mediaSessionCurrentState(session) == 'active') OK > +Sending Play/Pause media event. > +RUN(internals.sendMediaControlEvent("play-pause")) > +EXPECTED (video.paused == 'true') OK > +END OF TEST Nit: I think it will be much easier to understand these results if you put a blank line between logical tests. > LayoutTests/media/session/play-pause-media-events-in-content-sessions.html:44 > + function beganPlaying(event) > + { > + video.onplaying = null; > + > + consoleWrite("Media began playing."); > + testExpected('video.paused', false); Ditto my comments in previous patches about manually adding logging if you use "video.on<event type>".
Matt Rajca
Comment 4 2015-07-30 14:50:53 PDT
(In reply to comment #3) > Comment on attachment 257767 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=257767&action=review > > > LayoutTests/media/session/play-pause-media-events-in-content-sessions-expected.txt:18 > > +EVENT(canplaythrough) > > +EXPECTED (internals.mediaSessionCurrentState(session) == 'idle') OK > > +Idle Media Sessions should not respond to Play/Pause events. > > +EXPECTED (video.paused == 'true') OK > > +Sending Play/Pause media event. > > +RUN(internals.sendMediaControlEvent("play-pause")) > > +EXPECTED (video.paused == 'true') OK > > +Playing media. > > +Media began playing. > > +EXPECTED (video.paused == 'false') OK > > +EXPECTED (internals.mediaSessionCurrentState(session) == 'active') OK > > +Sending Play/Pause media event. > > +RUN(internals.sendMediaControlEvent("play-pause")) > > +EXPECTED (video.paused == 'true') OK > > +END OF TEST > > Nit: I think it will be much easier to understand these results if you put a > blank line between logical tests. Fixed. > > > LayoutTests/media/session/play-pause-media-events-in-content-sessions.html:44 > > + function beganPlaying(event) > > + { > > + video.onplaying = null; > > + > > + consoleWrite("Media began playing."); > > + testExpected('video.paused', false); > > Ditto my comments in previous patches about manually adding logging if you > use "video.on<event type>". I switched to `waitForEvent`.
Matt Rajca
Comment 5 2015-07-30 14:58:50 PDT
Note You need to log in before you can comment on or make changes to this bug.