blob: 785d43d57633e9bd03f046e1689872d0f9e57496 [file] [log] [blame]
Test switching application state when <video> is not allowed to play in background.
RUN(internals.setMediaSessionRestrictions('videoaudio', 'BackgroundProcessPlaybackRestricted'))
EVENT(canplaythrough)
EVENT(canplaythrough)
RUN(audio.play())
RUN(video.play())
EVENT(playing)
EVENT(playing)
** Simulate switch to background, video should pause.
RUN(internals.applicationDidEnterBackground())
EVENT(pause)
** 100ms timer fired...
EXPECTED (video.paused == 'true') OK
EXPECTED (audio.paused == 'false') OK
** Simulate switch back to foreground, video should resume.
RUN(internals.applicationWillEnterForeground())
EVENT(playing)
** 100ms timer fired...
EXPECTED (video.paused == 'false') OK
EXPECTED (audio.paused == 'false') OK
END OF TEST