blob: 1ab620b4e86f0f450a73ea352cf97f15aef94962 [file] [log] [blame]
<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" controls autoplay></video>
<div id="host"></div>
<script type="text/javascript">
window.jsTestIsAsync = true;
description("Testing the <code>ScrubberSupport</code> behavior when clicking the scrubber.");
const container = document.querySelector("div#host");
const media = document.querySelector("video");
const mediaController = createControls(container, media, null);
const scrubber = mediaController.controls.timeControl.scrubber.children[1].element;
mediaController.controls.showsStartButton = false;
media.addEventListener("play", () => {
media.pause();
shouldBecomeDifferent("scrubber.getBoundingClientRect().width", "0", () => {
media.addEventListener("timeupdate", () => {
shouldBeCloseTo("media.currentTime", 3.1872, 0.2);
container.remove();
media.remove();
finishJSTest();
});
pressOnElement(scrubber);
});
});
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>