blob: 4856419c29bc329be99cb9622cd92a4359381f20 [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 that double-clicking the tracks button when the tracks panel makes the panel appear again.");
const media = document.querySelector("video");
const shadowRoot = window.internals.shadowRoot(media);
media.addEventListener("play", () => {
media.pause();
debug("Media started playing");
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", () => {
pressOnElement(shadowRoot.querySelector("button.tracks"));
requestAnimationFrame(() => {
pressOnElement(shadowRoot.querySelector("button.tracks"));
// Give the transitionend event time to fire if it were to happen, which it should not.
setTimeout(() => {
shouldNotBe("shadowRoot.querySelector('.tracks-panel')", "null");
debug("");
media.remove();
finishJSTest();
}, 500);
});
});
});
});
});
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>