| <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); |
| |
| // Obtain the plaform-specific color by creating an element using -apple-wireless-playback-target-active. |
| const airplayColorButton = document.body.appendChild(document.createElement("div")); |
| airplayColorButton.style.color = "-apple-wireless-playback-target-active"; |
| const airplayColor = getComputedStyle(airplayColorButton).color; |
| airplayColorButton.remove(); |
| |
| 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> |