blob: 065c92c81ddd1fd85eb0b45c979feeb05a4e81e3 [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">
description("Testing the <code>MacOSInlineMediaControls</code> layout.");
window.jsTestIsAsync = true;
const mediaControls = new MacOSInlineMediaControls({ width: 680, height: 400 });
const iconButtons = [
mediaControls.playPauseButton,
mediaControls.skipBackButton,
mediaControls.airplayButton,
mediaControls.pipButton,
mediaControls.tracksButton,
mediaControls.muteButton,
mediaControls.fullscreenButton
];
scheduler.frameDidFire = function()
{
if (iconButtons.some(button => button.width == 0))
return;
shouldBe("mediaControls.children.length", "2");
shouldBe("mediaControls.children[0]", "mediaControls.topLeftControlsBar");
shouldBe("mediaControls.children[1]", "mediaControls.bottomControlsBar");
shouldBe("mediaControls.topLeftControlsBar.children.length", "2");
shouldBeTrue("mediaControls.topLeftControlsBar.children[0] instanceof BackgroundTint");
shouldBeTrue("mediaControls.topLeftControlsBar.children[1] instanceof ButtonsContainer");
shouldBe("mediaControls.topLeftControlsBar.children[1].children.length", "2");
shouldBe("mediaControls.topLeftControlsBar.children[1].children[0]", "mediaControls.pipButton");
shouldBe("mediaControls.topLeftControlsBar.children[1].children[1]", "mediaControls.fullscreenButton");
shouldBe("mediaControls.bottomControlsBar.children.length", "4");
shouldBeTrue("mediaControls.bottomControlsBar.children[0] instanceof BackgroundTint");
shouldBe("mediaControls.bottomControlsBar.children[1]", "mediaControls.leftContainer");
shouldBe("mediaControls.bottomControlsBar.children[2]", "mediaControls.timeControl");
shouldBe("mediaControls.bottomControlsBar.children[3]", "mediaControls.rightContainer");
shouldBe("mediaControls.leftContainer.children.length", "3");
shouldBe("mediaControls.leftContainer.children[0]", "mediaControls.skipBackButton");
shouldBe("mediaControls.leftContainer.children[1]", "mediaControls.playPauseButton");
shouldBe("mediaControls.leftContainer.children[2]", "mediaControls.skipForwardButton");
shouldBe("mediaControls.timeControl.children.length", "3");
shouldBe("mediaControls.timeControl.children[0]", "mediaControls.timeControl.elapsedTimeLabel");
shouldBe("mediaControls.timeControl.children[1]", "mediaControls.timeControl.scrubber");
shouldBe("mediaControls.timeControl.children[2]", "mediaControls.timeControl.remainingTimeLabel");
shouldBe("mediaControls.rightContainer.children.length", "3");
shouldBe("mediaControls.rightContainer.children[0]", "mediaControls.muteButton");
shouldBe("mediaControls.rightContainer.children[1]", "mediaControls.airplayButton");
shouldBe("mediaControls.rightContainer.children[2]", "mediaControls.tracksButton");
finishMediaControlsTest();
};
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>