[GStreamer] Stopping playback of html5 media when receiving a higher priority audio...
[WebKit-https.git] / LayoutTests / media / media-higher-prio-audio-stream.html
1 <!DOCTYPE html>
2 <html>
3     <head>
4         <script src=media-file.js></script>
5         <script src=video-test.js></script>
6
7         <script>
8             var mediaElement;
9
10             function start()
11             {
12                 mediaElement = new Audio();
13
14                 waitForEvent('error');
15                 waitForEvent('playing', playing);
16
17                 mediaElement.src = findMediaFile('audio', 'content/test');
18                 mediaElement.play();
19             }
20
21             function playing()
22             {
23                 testExpected("mediaElement.paused", false);
24                 waitForEvent('pause', paused);
25                 internals.simulateAudioInterruption(mediaElement);
26             }
27
28             function paused()
29             {
30                 testExpected("mediaElement.paused", true);
31                 testExpected("mediaElement.ended", false);
32                 consoleWrite("");
33                 endTest();
34             }
35         </script>
36     </head>
37     <body onload="start()">
38         <p><b>Test paused by:</b>
39         <ol>
40             <li>Getting a higher priority audio stream.</li>
41             <li>This test does not work in the launchers, only with
42             the test runners.</li>
43         </ol>
44         </p>
45     </body>
46 </html>