blob: 81b0c715aa6dde83fc2e974a297bca907cbccaf5 [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/test.mp4" style="width: 320px; height: 240px;" controls></video>
<div id="shadow"></div>
<script type="text/javascript">
window.jsTestIsAsync = true;
description("Testing the forward button in fullscreen.");
const media = document.querySelector("video");
const button = document.body.appendChild(document.createElement("button"));
button.addEventListener("click", () => media.webkitEnterFullscreen());
media.addEventListener("loadedmetadata", () => {
pressOnElement(button);
shouldBecomeEqual('!!window.internals.shadowRoot(media).lastChild.querySelector("button.forward")', "true", () => {
shouldBeTrue("media.webkitDisplayingFullscreen");
debug("");
debug("Setting media.currentTime to 2s");
media.currentTime = 2;
shouldBe("media.currentTime", "2");
shouldBeTrue("media.paused");
debug("");
debug("Starting to press on the skip forward button");
const forwardButtonElement = window.internals.shadowRoot(media).lastChild.querySelector("button.forward");
forwardButtonElement.dispatchEvent(new MouseEvent("mousedown"));
shouldBecomeEqual("media.currentTime > 2.5", "true", () => {
forwardButtonElement.dispatchEvent(new MouseEvent("mouseup"));
shouldBeTrue("media.paused");
debug("");
media.remove();
button.remove();
finishJSTest();
});
});
});
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>