blob: 0aeda985171ad41cb6f64f84d838487b7d8284f1 [file] [log] [blame]
<!DOCTYPE html>
<script src="../../../resources/js-test-pre.js"></script>
<script src="../resources/media-controls-utils.js" type="text/javascript"></script>
<body>
<video src="../../content/CC+Subtitles.mov" style="width: 320px; height: 240px;" controls autoplay></video>
<script type="text/javascript">
window.jsTestIsAsync = true;
description("Testing the display of a tracks panel after dragging the controls bar in fullscreen.");
const media = document.querySelector("video");
const shadowRoot = window.internals.shadowRoot(media);
media.addEventListener("webkitbeginfullscreen", () => {
debug("webkitbeginfullscreen");
});
media.addEventListener("webkitfullscreenchange", () => {
if (!media.webkitDisplayingFullscreen)
return;
window.requestAnimationFrame(() => {
const bounds = shadowRoot.querySelector(".controls-bar").getBoundingClientRect();
eventSender.mouseMoveTo(bounds.left + 118, bounds.top + 10);
eventSender.mouseDown();
eventSender.mouseMoveTo(bounds.left + 68, bounds.top - 40);
eventSender.mouseUp();
requestAnimationFrame(() => {
clickOnButton("tracks", () => {
requestAnimationFrame(() => {
shouldBe("shadowRoot.querySelector('button.tracks').getBoundingClientRect().right", "shadowRoot.querySelector('.tracks-panel').getBoundingClientRect().right")
shouldBeEqualToString("shadowRoot.querySelector('.tracks-panel').style.bottom", "151px");
debug("");
media.remove();
finishJSTest();
});
});
});
});
});
media.addEventListener("play", () => {
media.pause();
window.requestAnimationFrame(() => clickOnButton("fullscreen"));
});
function clickOnButton(name, continuation)
{
shouldBecomeDifferent(`shadowRoot.querySelector('button.${name}').getBoundingClientRect()`, "0", () => {
pressOnElement(shadowRoot.querySelector(`button.${name}`), continuation);
});
}
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>