blob: f1b7b696406eb56f9c7f4abe7e796c5873fc2cce [file] [log] [blame]
<!DOCTYPE html>
<script src="../../../resources/js-test-pre.js"></script>
<body>
<video src="../../content/CC+Subtitles.mov" style="position: absolute; left: 0; top: 0; width: 320px; height: 240px;" controls autoplay data-auto-hide-delay="1000"></video>
<script type="text/javascript">
window.jsTestIsAsync = true;
description("Testing the controls bar reappears when the mouse enters the media.");
const media = document.querySelector("video");
const shadowRoot = window.internals.shadowRoot(media);
media.addEventListener("play", (event) => {
shouldBecomeEqual("!!shadowRoot.querySelector('.media-controls')", "true", () => {
debug("");
debug("Video started playing, controls bar should become visible by default.");
shouldBecomeEqual("shadowRoot.querySelector('.media-controls').classList.contains('faded')", "false", () => {
debug("");
debug("Controls bar should fade when the auto-hide timer has elapsed.");
shouldBecomeEqual("shadowRoot.querySelector('.media-controls').classList.contains('faded')", "true", () => {
eventSender.mouseMoveTo(100, 100);
debug("");
debug("Mouse moved over the media, controls bar should become visible.");
shouldBecomeEqual("shadowRoot.querySelector('.media-controls').classList.contains('faded')", "false", () => {
debug("");
debug("Controls bar should fade when the auto-hide timer has elapsed.");
shouldBecomeEqual("shadowRoot.querySelector('.media-controls').classList.contains('faded')", "true", () => {
debug("");
media.remove();
finishJSTest();
});
});
});
});
});
});
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>