| <!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 reappears and remains visible when the mouse enters the media over the controls bar."); |
| |
| let controlsBar; |
| |
| document.querySelector("video").addEventListener("play", (event) => { |
| window.requestAnimationFrame(() => { |
| const media = event.target; |
| controlsBar = window.internals.shadowRoot(media).querySelector(".controls-bar"); |
| |
| debug("Video started playing, controls bar is visible by default."); |
| shouldBeFalse("controlsBar.classList.contains('faded')"); |
| |
| setTimeout(() => { |
| debug(""); |
| debug("Auto-hide timer has elapsed, controls bar should be faded."); |
| shouldBeTrue("controlsBar.classList.contains('faded')"); |
| |
| eventSender.mouseMoveTo(100, 220); |
| window.requestAnimationFrame(() => { |
| debug(""); |
| debug("Mouse moved over the media, controls bar should be visible."); |
| shouldBeFalse("controlsBar.classList.contains('faded')"); |
| }); |
| |
| setTimeout(() => { |
| debug(""); |
| debug("Auto-hide timer would have elapsed, but the controls bar remains visible since the mouse is over the controls bar."); |
| shouldBeFalse("controlsBar.classList.contains('faded')"); |
| |
| debug(""); |
| media.remove(); |
| finishJSTest(); |
| }, 300); |
| |
| }, 300); |
| }); |
| }); |
| |
| </script> |
| <script src="../../../resources/js-test-post.js"></script> |
| </body> |