| <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>MuteButton</code> class."); |
| |
| const muteButton = new MuteButton({ layoutTraits: LayoutTraits.macOS }); |
| |
| shouldBeEqualToString("muteButton.element.localName", "button"); |
| shouldBeTrue('muteButton.element.classList.contains("mute")'); |
| shouldBe("muteButton.iconName", "Icons.Volume"); |
| shouldBeFalse("muteButton.muted"); |
| |
| const mutedButton = new MuteButton({ layoutTraits: LayoutTraits.macOS }); |
| mutedButton.muted = true; |
| shouldBeTrue("mutedButton.muted"); |
| shouldBecomeEqual("mutedButton.iconName", "Icons.VolumeMuted", () => { |
| shouldBecomeEqual('muteButton.image.element.style.webkitMaskImage.includes("macOS/VolumeHi.svg")', "true", () => { |
| shouldBecomeEqual('mutedButton.image.element.style.webkitMaskImage.includes("macOS/Mute.svg")', "true", finishJSTest); |
| }); |
| }); |
| |
| </script> |
| <script src="../../../resources/js-test-post.js"></script> |
| </body> |