blob: 5d7e92095b067fef94bde4b585f0e6b76580a7bd [file] [log] [blame]
<!DOCTYPE html>
<script src="../../../resources/js-test-pre.js"></script>
<script src="../resources/media-controls-loader.js" type="text/javascript"></script>
<script src="../resources/media-controls-utils.js" type="text/javascript"></script>
<script src="../../content/test.mp4.js"></script>
<body>
<video style="position: absolute; left: 0; top: 0; width: 320px; height: 240px;" controls autoplay></video>
<div id="host"></div>
<script type="text/javascript">
window.jsTestIsAsync = true;
description("Testing the controls bar fades out as expected after the auto-hide delay expires upon first play.");
const media = document.querySelector("video");
media.src = base64MP4URL();
const shadowRoot = window.internals.shadowRoot(media);
const container = document.querySelector("div#host");
const mediaController = createControls(container, media, null);
mediaController.controls.autoHideController.autoHideDelay = 100;
media.addEventListener("play", (event) => {
shouldBecomeEqual("!!shadowRoot.querySelector('.media-controls')", "true", () => {
shouldBecomeEqual("shadowRoot.querySelector('.media-controls').classList.contains('faded')", "false", () => {
shouldBecomeEqual("shadowRoot.querySelector('.media-controls').classList.contains('faded')", "true", () => {
debug("");
media.remove();
finishJSTest();
});
});
});
});
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>