blob: 3c08179833c26b66edb068bedfd528f0c0304640 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<video src="content/audio-tracks.mp4" controls autoplay loop></video>
<script src="media-file.js"></script>
<script src="video-test.js"></script>
<script>
description("Testing that muting a video element should result in page's audio playing state to become false");
jsTestIsAsync = true;
function testUnmutingVideo()
{
run("video.muted = false");
shouldBecomeEqual("window.internals.isPagePlayingAudio()", "true", finishJSTest);
}
function testMutingVideo()
{
run("video.muted = true");
shouldBecomeEqual("window.internals.isPagePlayingAudio()", "false", testUnmutingVideo);
}
shouldBecomeEqual("window.internals.isPagePlayingAudio()", "true", testMutingVideo);
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>