| |
| Test switching application state when <video> is not allowed to play in background. |
| |
| RUN(internals.setMediaSessionRestrictions('video', 'BackgroundProcessPlaybackRestricted')) |
| |
| EVENT(canplaythrough) |
| EVENT(canplaythrough) |
| |
| RUN(audio.play()) |
| RUN(video.play()) |
| EVENT(playing) |
| EVENT(playing) |
| |
| ** Simulate switch to background, video should pause. |
| RUN(internals.applicationWillEnterBackground()) |
| |
| 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 |
| |