Fix API test after r241728
[WebKit-https.git] / Tools / TestWebKitAPI / Tests / WebKitCocoa / audio-with-web-audio.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <script>
5         window.addEventListener('load', async event => {
6             let context = new webkitAudioContext();
7             let node = context.createBufferSource();
8             node.connect(context.destination);
9
10             let audio = new Audio();
11             audio.src = "video-with-audio.mp4";
12             
13             Promise.all([context.resume(), audio.play()]).then(() => {
14                 window.webkit.messageHandlers.testHandler.postMessage('playing');
15             }, () => {
16                 window.webkit.messageHandlers.testHandler.postMessage('not playing');
17             });
18         });
19     </script>
20 </head>
21 </html>