blob: 60331e473ae8d671df7997553bf8b743ed5799d8 [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>FullscreenButton</code> class.");
const enterFullscreenButton = new FullscreenButton({ layoutTraits: LayoutTraits.macOS });
shouldBeEqualToString("enterFullscreenButton.element.localName", "button");
shouldBeTrue('enterFullscreenButton.element.classList.contains("fullscreen")');
shouldBe("enterFullscreenButton.iconName", "Icons.EnterFullscreen");
const iOSEnterFullscreenButton = new FullscreenButton({ layoutTraits: LayoutTraits.iOS });
const exitFullscreenButton = new FullscreenButton({ layoutTraits: LayoutTraits.macOS | LayoutTraits.Fullscreen });
shouldBe("exitFullscreenButton.iconName", "Icons.ExitFullscreen");
scheduler.frameDidFire = function()
{
if ([enterFullscreenButton, iOSEnterFullscreenButton, exitFullscreenButton].some(button => button.width == 0))
return;
shouldBeTrue('enterFullscreenButton.image.element.style.webkitMaskImage.includes("macOS/EnterFullscreen.svg")');
shouldBeTrue('iOSEnterFullscreenButton.image.element.style.webkitMaskImage.includes("iOS/EnterFullscreen.svg")');
shouldBeTrue('exitFullscreenButton.image.element.style.webkitMaskImage.includes("macOS/ExitFullscreen.svg")');
finishMediaControlsTest();
};
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>