blob: 7467b37b584cb57b0577846315a2bb88dd0f99b6 [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>
<script type="text/javascript">
window.jsTestIsAsync = true;
description("Testing the <code>AirplayButton</code> class.");
const airplayButton = new AirplayButton({ layoutTraits: LayoutTraits.macOS });
airplayButton.on = true;
document.body.appendChild(airplayButton.element);
const airplayColor = window.navigator.platform === "MacIntel" ? "rgb(27, 173, 248)" : "rgb(0, 122, 255)";
shouldBecomeEqual('airplayButton.element.classList.contains("on")', "true", () => {
shouldBecomeEqualToString("window.getComputedStyle(airplayButton.element).backgroundColor", "rgba(0, 0, 0, 0)", () => {
shouldBecomeEqual("window.getComputedStyle(airplayButton.image.element).backgroundColor", "airplayColor", () => {
airplayButton.element.remove();
finishMediaControlsTest();
});
});
});
setTimeout(() => {
debug(window.getComputedStyle(airplayButton.image.element).backgroundColor);
finishMediaControlsTest();
}, 4000);
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>