| <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> |
| <style type="text/css" media="screen"> |
| |
| video, #host { |
| position: absolute; |
| top: 0; |
| left: 0; |
| width: 800px; |
| height: 240px; |
| } |
| |
| </style> |
| <video src="../../content/test.mp4" style="width: 320px; height: 240px;" controls autoplay></video> |
| <div id="host"></div> |
| <script type="text/javascript"> |
| |
| window.jsTestIsAsync = true; |
| |
| description("Testing for an accessibility text on the scrubber that correctly reflects the changes in media.currentTime."); |
| |
| const media = document.querySelector("video"); |
| let input; |
| |
| media.addEventListener("play", () => { |
| input = internals.shadowRoot(media).querySelector(".time-control > .slider > input"); |
| |
| media.pause(); |
| |
| shouldBeEqualToString("input.getAttribute('aria-valuetext')", "0 seconds"); |
| media.currentTime = 2; |
| shouldBe("media.currentTime", "2"); |
| shouldBecomeEqual("input.getAttribute('aria-valuetext') === '2 seconds'", "true", finishJSTest); |
| }); |
| |
| </script> |
| <script src="../../../resources/js-test-post.js"></script> |
| </body> |