blob: ef423356f0e774014b30de18a640293c6ed5858f [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