blob: b2d5dad208b133750423fcb79e7e767441d918c2 [file] [log] [blame]
<script src="../../../resources/js-test-pre.js"></script>
<script src="../resources/media-controls-loader.js" type="text/javascript"></script>
<body>
<audio src="../../content/test.mp4" style="width: 320px; height: 240px;"></audio>
<div id="shadow"></div>
<script type="text/javascript">
window.jsTestIsAsync = true;
description("Testing the <code>ControlsVisibilitySupport</code> behavior for audio without controls.");
const shadowRoot = document.querySelector("div#shadow").attachShadow({ mode: "open" });
const media = document.querySelector("audio");
const mediaController = createControls(shadowRoot, media, null);
debug("Media has not begun loading yet");
shouldBeFalse("mediaController.controls.visible");
media.addEventListener("loadedmetadata", function() {
debug("");
debug("Media has loaded metadata");
shouldBeFalse("mediaController.controls.visible");
debug("");
shadowRoot.host.remove();
media.remove();
finishJSTest();
});
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>