blob: 58a03acd8f2f6874a794c96dc43e9a88ceb74e19 [file] [log] [blame]
<script src="../../../resources/js-test-pre.js"></script>
<script src="../resources/media-controls-loader.js" type="text/javascript"></script>
<body>
<video src="404.mp4" style="width: 320px; height: 240px;" controls></video>
<div id="shadow"></div>
<script type="text/javascript">
window.jsTestIsAsync = true;
description("Testing the <code>PlacardSupport</code> behavior when we recover from an error.");
const shadowRoot = document.querySelector("div#shadow").attachShadow({ mode: "open" });
const media = document.querySelector("video");
const mediaController = createControls(shadowRoot, media, null);
media.addEventListener("error", () => {
shouldBe("mediaController.controls.placard", "mediaController.controls.invalidPlacard");
shouldBeTrue("mediaController.controls.children.includes(mediaController.controls.invalidPlacard)");
media.addEventListener("loadstart", () => {
shouldBeNull("mediaController.controls.placard");
shouldBeFalse("mediaController.controls.children.includes(mediaController.controls.invalidPlacard)");
debug("");
shadowRoot.host.remove();
media.remove();
finishJSTest();
});
media.src = "../../content/test.mp4";
});
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>