blob: 72b1a9e4f259d51b25792d33a25425cd1823a572 [file] [log] [blame]
<!DOCTYPE html>
<script src="../../../resources/js-test-pre.js"></script>
<body>
<video src="../../content/test.mp4" style="position: absolute; left: 0; top: 0; width: 320px; height: 240px;" controls autoplay data-auto-hide-delay="250"></video>
<script type="text/javascript">
window.jsTestIsAsync = true;
description("Testing the controls bar remains visible when the media is paused.");
let mediaControls;
document.querySelector("video").addEventListener("play", event => {
window.requestAnimationFrame(() => {
const media = event.target;
mediaControls = window.internals.shadowRoot(media).querySelector(".media-controls");
debug("Video started playing, controls bar is visible by default.");
shouldBeFalse("mediaControls.classList.contains('faded')");
media.pause();
media.addEventListener("pause", event => {
setTimeout(() => {
debug("");
debug("Auto-hide timer would have elapsed, but media was paused so controls bar should remain visible.");
shouldBeFalse("mediaControls.classList.contains('faded')");
debug("");
media.remove();
finishJSTest();
}, 300);
});
});
});
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>