blob: 7396bbca1aa384bb012f8bf3cdb82510e0c9aeb9 [file] [log] [blame]
<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/button.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-button.css" type="text/css" media="screen">
<script src="../../../resources/js-test-pre.js"></script>
<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/scheduler.js" type="text/javascript"></script>
<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/layout-node.js" type="text/javascript"></script>
<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/layout-item.js" type="text/javascript"></script>
<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/button.js" type="text/javascript"></script>
<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-service.js" type="text/javascript"></script>
<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/icon-button.js" type="text/javascript"></script>
<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/mute-button.js" type="text/javascript"></script>
<body>
<script type="text/javascript">
window.jsTestIsAsync = true;
description("Testing the <code>MuteButton</code> class.");
iconService.directoryPath = "../../../../Source/WebCore/Modules/modern-media-controls/images";
const muteButton = new MuteButton({ layoutTraits: LayoutTraits.macOS });
shouldBeEqualToString("muteButton.element.localName", "button");
shouldBeTrue('muteButton.element.classList.contains("icon")');
shouldBeTrue('muteButton.element.classList.contains("mute")');
shouldBeEqualToString("muteButton.iconName", `${Icons.Volume}`);
shouldBeFalse("muteButton.muted");
const mutedButton = new MuteButton({ layoutTraits: LayoutTraits.macOS });
mutedButton.muted = true;
shouldBeTrue("mutedButton.muted");
shouldBeEqualToString("mutedButton.iconName", `${Icons.VolumeMuted}`);
scheduler.frameDidFire = function()
{
if ([muteButton, mutedButton].some(button => button.width == 0))
return;
shouldBeTrue('muteButton.element.style.webkitMaskImage.includes("macOS/volume@")');
shouldBeTrue('mutedButton.element.style.webkitMaskImage.includes("macOS/volume-mute@")');
finishJSTest();
};
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>