[MediaStream] Add "has capture device" bit to media state flags
[WebKit-https.git] / LayoutTests / media / muted-video-is-playing-audio.html
1 <!DOCTYPE html>
2 <html>
3     <head>
4         <script src="../resources/js-test-pre.js"></script>
5     </head>
6     <body>
7         <video src="content/audio-tracks.mp4" controls autoplay loop></video>
8         <script src="media-file.js"></script>
9         <script src="video-test.js"></script>
10         <script>
11             description("Testing that muting a video element should result in page's audio playing state to become false");
12
13             jsTestIsAsync = true;
14
15             function testUnmutingVideo()
16             {
17                 run("video.muted = false");
18                 shouldBecomeEqual("window.internals.pageMediaState().includes('IsPlayingAudio')", "true", finishJSTest);
19             }
20
21             function testMutingVideo()
22             {
23                 run("video.muted = true");
24                 shouldBecomeEqual("window.internals.pageMediaState().includes('IsPlayingAudio')", "false", testUnmutingVideo);
25             }
26
27             shouldBecomeEqual("window.internals.pageMediaState().includes('IsPlayingAudio')", "true", testMutingVideo);
28         </script>
29         <script src="../resources/js-test-post.js"></script>
30     </body>
31 </html>