<!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 follow the mouse drag.");

const media = document.querySelector("video");
const shadowRoot = window.internals.shadowRoot(media);
let mediaControls = shadowRoot.lastChild;

media.addEventListener("webkitbeginfullscreen", () => {
    debug("webkitbeginfullscreen");
});

media.addEventListener("webkitfullscreenchange", () => {
    shouldBecomeEqual("media.webkitDisplayingFullscreen", "true", () => {
        mediaControls = shadowRoot.lastChild;
        shouldBecomeEqual("!!mediaControls.querySelector('.buttons-container.left')", "true", () => {
            shouldBecomeEqualToString("mediaControls.querySelector('.buttons-container.left').style.width", "100px", () => {
                const bounds = mediaControls.querySelector(".controls-bar").getBoundingClientRect();
                eventSender.mouseMoveTo(bounds.left + 210, bounds.top + 25);
                eventSender.mouseDown();
                eventSender.mouseMoveTo(bounds.left + 160, bounds.top - 75);
                eventSender.mouseUp();

                window.requestAnimationFrame(() => {
                    shouldBeEqualToString("mediaControls.querySelector('.controls-bar').style.transform", "translate(-50px, -100px)");
                    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>
