| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="../video-test.js"></script> |
| <script src="../media-file.js"></script> |
| <script type="text/javascript"> |
| var session; |
| |
| function runTest() |
| { |
| session = new MediaSession("content"); |
| |
| consoleWrite("Waiting for Content media to begin playing.") |
| |
| findMediaElement(); |
| waitForEvent('canplaythrough', beginPlaying); |
| video.src = findMediaFile("video", "../content/counting"); |
| video.session = session; |
| video.onplaying = beganPlaying; |
| } |
| |
| function beginPlaying(event) |
| { |
| video.play(); |
| } |
| |
| function beganPlaying(event) |
| { |
| video.onplaying = null; |
| |
| consoleWrite("Media began playing."); |
| |
| if (window.internals) { |
| testExpected('internals.mediaSessionCurrentState(session)', "active"); |
| testExpected('video.paused', false); |
| |
| consoleWrite("Sending 'Transient Solo' start-of-interruption notification."); |
| run('internals.sendMediaSessionStartOfInterruptionNotification("transient-solo")'); |
| |
| testExpected('internals.mediaSessionCurrentState(session)', "interrupted"); |
| testExpected('video.paused', true); |
| |
| consoleWrite("Sending 'Transient Solo' end-of-interruption notification."); |
| run('internals.sendMediaSessionEndOfInterruptionNotification("transient-solo")'); |
| |
| testExpected('internals.mediaSessionCurrentState(session)', "active"); |
| testExpected('video.paused', false); |
| } |
| |
| endTest(); |
| } |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <p>'Transient Solo' interruption events should pause elements belonging to 'Content' media sessions.</p> |
| <video id="video" /> |
| </body> |
| </html> |