blob: cb0609e535f1d1fcc9425b2a61daa9a8cc44b41d [file] [log] [blame]
RUN(video.src = findMediaFile("video", "../content/test"))
EVENT(loadeddata)
Test that default media element action will be run when no media session handlers exist for that action.
EXPECTED (video.paused == 'true') OK
RUN(internals.sendMediaSessionAction(navigator.mediaSession, {action: "play"}))
EXPECTED (video.paused == 'false') OK
RUN(internals.sendMediaSessionAction(navigator.mediaSession, {action: "pause"}))
EXPECTED (video.paused == 'true') OK
RUN(video.currentTime = 0)
EXPECTED (video.currentTime == '0') OK
RUN(internals.sendMediaSessionAction(navigator.mediaSession, {action: "seekto", seekTime: 1}))
EXPECTED (video.currentTime == '1') OK
RUN(internals.sendMediaSessionAction(navigator.mediaSession, {action: "seekforward", seekOffset: 5}))
EXPECTED (video.currentTime == '6') OK
RUN(internals.sendMediaSessionAction(navigator.mediaSession, {action: "seekbackward", seekOffset: 5}))
EXPECTED (video.currentTime == '1') OK
RUN(internals.sendMediaSessionAction(navigator.mediaSession, {action: "play"}))
ACTION: play
EXPECTED (video.paused == 'true') OK
RUN(internals.sendMediaSessionAction(navigator.mediaSession, {action: "play"}))
EXPECTED (video.paused == 'false') OK
RUN(internals.sendMediaSessionAction(navigator.mediaSession, {action: "pause"}))
ACTION: pause
EXPECTED (video.paused == 'false') OK
RUN(internals.sendMediaSessionAction(navigator.mediaSession, {action: "pause"}))
EXPECTED (video.paused == 'true') OK
END OF TEST