blob: ca7afdbbb6568099a842be3e930d83624e17c645 [file] [log] [blame]
<!DOCTYPE html>
<script src="../../../resources/js-test-pre.js"></script>
<body>
<video src="../../content/test.mp4" style="width: 320px; height: 240px;" controls autoplay></video>
<script type="text/javascript">
window.jsTestIsAsync = true;
description("This test pauses the video, presses the fullscreen button, and drags the controls when the mouse is over a button. It should not move.");
const media = document.querySelector("video");
const shadowRoot = window.internals.shadowRoot(media);
let mediaControls = shadowRoot.lastChild;
media.addEventListener("webkitbeginfullscreen", () => {
debug("webkitbeginfullscreen");
});
media.addEventListener("webkitfullscreenchange", () => {
if (media.webkitDisplayingFullscreen) {
mediaControls = shadowRoot.lastChild;
shouldBecomeEqual("!!mediaControls.querySelector('.buttons-container.left')", "true", () => {
shouldBecomeEqualToString("mediaControls.querySelector('.buttons-container.left').style.width", "118px", () => {
const bounds = mediaControls.querySelector(".controls-bar").getBoundingClientRect();
eventSender.mouseMoveTo(bounds.left + 68, bounds.top + 20);
eventSender.mouseDown();
eventSender.mouseMoveTo(bounds.left + 18, bounds.top - 80);
eventSender.mouseUp();
window.requestAnimationFrame(() => {
shouldBeEqualToString("mediaControls.querySelector('.controls-bar').style.transform", "");
finishJSTest();
});
});
});
}
});
media.addEventListener("play", () => {
media.pause();
window.requestAnimationFrame(() => {
const bounds = mediaControls.querySelector("button.fullscreen").getBoundingClientRect();
eventSender.mouseMoveTo(bounds.left + 1, bounds.top + 1);
eventSender.mouseDown();
eventSender.mouseUp();
});
});
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>