blob: 2f8d8287f373139b736c4d6d649aa6247a8e8b35 [file] [log] [blame]
<script src="../../../resources/js-test-pre.js"></script>
<script src="../resources/media-controls-loader.js" type="text/javascript"></script>
<script src="../resources/media-controls-utils.js" type="text/javascript"></script>
<body>
<video src="../../content/test.mp4" style="width: 320px; height: 240px;"></video>
<div id="shadow"></div>
<script type="text/javascript">
window.jsTestIsAsync = true;
description("Testing the <code>StartSupport</code> behavior with no source.");
const shadowRoot = document.querySelector("div#shadow").attachShadow({ mode: "open" });
const media = document.querySelector("video");
const mediaController = createControls(shadowRoot, media, null);
const button = document.body.appendChild(document.createElement("button"));
button.textContent = "Enter Fullscreen";
button.addEventListener("click", event => {
try {
media.webkitEnterFullscreen();
} catch(e) {
debug("Calling media.webkitEnterFullscreen() failed");
finishJSTest();
}
});
media.addEventListener("webkitfullscreenchange", () => {
debug("Media entered fullscreen");
shouldBeFalse("mediaController.controls.showsStartButton");
debug("");
shadowRoot.host.remove();
media.remove();
button.remove();
finishJSTest();
}, { once: true });
media.addEventListener("loadedmetadata", () => pressOnElement(button), { once: true });
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>