blob: 517966d7372b8ae1bab38fb079305024ccd8bb0b [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="../../content/counting-subtitled.m4v" style="width: 320px; height: 240px;" preload="preload" controls></video>
<div id="shadow"></div>
<script type="text/javascript">
window.jsTestIsAsync = true;
description("Testing the <code>TracksSupport</code> behavior with text tracks.");
const shadowRoot = document.querySelector("div#shadow").attachShadow({ mode: "open" });
const media = document.querySelector("video");
const mediaController = createControls(shadowRoot, media, null);
debug("The tracks button should be disabled initially as we wait for metadata and text tracks to be added.");
shouldBeFalse("mediaController.controls.tracksButton.enabled");
debug("");
debug("Eventually the text tracks will be added and the tracks button will be enabled.");
shouldBecomeEqual("mediaController.controls.tracksButton.enabled", "true", () => {
debug("");
shadowRoot.host.remove();
media.remove();
finishJSTest();
});
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>