b1053f9041aa65c7a55ee63be299e1773d952223
[WebKit-https.git] / LayoutTests / media / video-isplayingtoautomotiveheadunit.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <title>video-isplayingtoautomotiveheadunit</title>
5     <script src="video-test.js"></script>
6     <script src="media-file.js"></script>
7     <script>
8     window.addEventListener('load', async event => {
9         findMediaElement();
10
11         run('video.src = findMediaFile("video", "content/test")');
12         await waitFor(video, 'canplaythrough');
13
14         runWithKeyDown('video.play()');
15         await waitFor(video, 'playing');
16
17         run('internals.setMediaSessionRestrictions("videoaudio", "suspendedunderlockplaybackrestricted")')
18         run('internals.applicationDidEnterBackground(true)');
19         await waitFor(video, 'pause');
20
21         run('internals.applicationWillEnterForeground(true)');
22         await waitFor(video, 'playing');
23
24         run('internals.setIsPlayingToAutomotiveHeadUnit(true)');
25         run('internals.applicationDidEnterBackground(true)');
26         testExpected('video.paused', false);
27         endTest();
28     });
29     </script>
30 </head>
31 <body>
32     <video controls></video>
33 </body>
34 </html>