[Cocoa] Deactivate the audio session before the WebProcess suspends.
[WebKit-https.git] / LayoutTests / platform / mac / media / audio-session-deactivated-when-suspended.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4         <title>audio-session-deactivated-when-suspended</title>
5         <script src="../../../media/video-test.js"></script>
6         <script src="../../../media/media-file.js"></script>
7         <script>
8         window.addEventListener('load', async event => {
9                 run('internals.settings.setShouldDeactivateAudioSession(true)');
10                 run('video = document.querySelector("video")');
11                 run('video.src = findMediaFile("video", "../../../media/content/test")');
12                 runWithKeyDown('video.play()');
13                 await waitFor(video, 'playing');
14                 testExpected('internals.audioSessionActive()', true);
15                 run('internals.processWillSuspend()');
16                 testExpected('internals.audioSessionActive()', false);
17                 run('internals.processDidResume()');
18                 testExpected('internals.audioSessionActive()', true);
19                 endTest();
20         });
21         </script>
22 </head>
23 <body>
24         <video controls></video>
25 </body>
26 </html>