blob: ecb9d6e4e28abe8d8b8f35397b4ed8289b882ed6 [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="position: absolute; left: 0; top: 0; width: 640px; height: 360px;" controls autoplay></video>
<script type="text/javascript">
window.jsTestIsAsync = true;
description("Ensure we have the Off text track selected by default.");
const media = document.querySelector("video");
const shadowRoot = window.internals.shadowRoot(media);
media.addEventListener("play", () => {
media.pause();
shouldBecomeDifferent("shadowRoot.querySelector('button.tracks')", "null", () => {
shouldBecomeDifferent("shadowRoot.querySelector('button.tracks').getBoundingClientRect().width", "0", () => {
pressOnElement(shadowRoot.querySelector("button.tracks"));
shouldBecomeDifferent("shadowRoot.querySelector('.tracks-panel')", "null", () => {
shouldBeEqualToString("shadowRoot.querySelectorAll('li.selected')[1].textContent", "Off");
debug("");
media.remove();
finishJSTest();
});
});
});
});
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>