blob: b9b8ac2ca7600ba2f0edb2f38394357af305e2e6 [file] [log] [blame]
<script src="../../../resources/js-test-pre.js"></script>
<script src="../resources/media-controls-loader.js" type="text/javascript"></script>
<body>
<script type="text/javascript">
description("Testing the <code>MacOSFullscreenMediaControls</code> constructor.");
const mediaControls = new MacOSFullscreenMediaControls;
shouldBeEqualToString("mediaControls.element.localName", "div");
shouldBeEqualToString("mediaControls.element.className", "media-controls mac fullscreen");
shouldBe("mediaControls.layoutTraits", "LayoutTraits.macOS | LayoutTraits.Fullscreen");
debug("");
debug("Controls bar");
shouldBe("mediaControls.bottomControlsBar.children.length", "4");
shouldBeTrue("mediaControls.bottomControlsBar.children[1] instanceof ButtonsContainer");
shouldBeTrue("mediaControls.bottomControlsBar.children[2] instanceof ButtonsContainer");
shouldBeTrue("mediaControls.bottomControlsBar.children[3] instanceof ButtonsContainer");
debug("");
debug("Left container");
shouldBe("mediaControls.bottomControlsBar.children[1].children", "[mediaControls.volumeDownButton, mediaControls.volumeSlider, mediaControls.volumeUpButton]");
shouldBeEqualToString("mediaControls.bottomControlsBar.children[1].element.className", "buttons-container left");
shouldBe("mediaControls.bottomControlsBar.children[1].leftMargin", "12");
shouldBe("mediaControls.bottomControlsBar.children[1].rightMargin", "0");
shouldBe("mediaControls.bottomControlsBar.children[1].buttonMargin", "6");
debug("");
debug("Center container");
shouldBe("mediaControls.bottomControlsBar.children[2].children", "[mediaControls.rewindButton, mediaControls.playPauseButton, mediaControls.forwardButton]");
shouldBeEqualToString("mediaControls.bottomControlsBar.children[2].element.className", "buttons-container center");
shouldBe("mediaControls.bottomControlsBar.children[2].leftMargin", "27");
shouldBe("mediaControls.bottomControlsBar.children[2].rightMargin", "27");
shouldBe("mediaControls.bottomControlsBar.children[2].buttonMargin", "27");
debug("");
debug("Right container");
shouldBe("mediaControls.bottomControlsBar.children[3].children", "[mediaControls.airplayButton, mediaControls.pipButton, mediaControls.tracksButton, mediaControls.fullscreenButton]");
shouldBeEqualToString("mediaControls.bottomControlsBar.children[3].element.className", "buttons-container right");
shouldBe("mediaControls.bottomControlsBar.children[3].leftMargin", "12");
shouldBe("mediaControls.bottomControlsBar.children[3].rightMargin", "12");
shouldBe("mediaControls.bottomControlsBar.children[3].buttonMargin", "16");
debug("");
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>