blob: 5ed365222e5cd62c27db8c685ab4ca71dd5a8279 [file] [log] [blame]
<script src="../../../resources/js-test-pre.js"></script>
<script src="../resources/media-controls-loader.js" type="text/javascript"></script>
<body>
<div id="container"></div>
<style type="text/css" media="screen">
body {
margin: 0;
}
body > * {
position: absolute;
}
#container {
position: relative;
top: 0;
left: 0;
width: 800px;
height: 600px;
}
</style>
<script type="text/javascript">
description("Testing the <code>MacOSFullscreenMediaControls</code> computed styles.");
window.jsTestIsAsync = true;
const mediaControls = new MacOSFullscreenMediaControls;
const centerContainer = mediaControls.bottomControlsBar.children[2];
const rightContainer = mediaControls.bottomControlsBar.children[3];
const buttons = centerContainer.children.concat(rightContainer.children);
document.getElementById("container").appendChild(mediaControls.element);
debug("");
shouldBecomeEqual("centerContainer.element.getBoundingClientRect().width", "178", () => {
shouldBe("centerContainer.element.getBoundingClientRect().left", "311");
shouldBe("centerContainer.element.getBoundingClientRect().top", "503");
shouldBe("centerContainer.element.getBoundingClientRect().height", "44");
debug("");
shouldBecomeEqual("Math.floor(rightContainer.element.getBoundingClientRect().width)", "140", () => {
shouldBeCloseTo("rightContainer.element.getBoundingClientRect().left", 494, 0.5);
shouldBe("rightContainer.element.getBoundingClientRect().top", "500");
shouldBe("rightContainer.element.getBoundingClientRect().height", "44");
debug("");
mediaControls.element.remove();
finishJSTest();
});
});
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>