blob: f47461257c68afedeff134a0be0f19a6e91e282f [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>MediaControls</code> constructor.");
const mediaControls = new MediaControls({ layoutTraits: LayoutTraits.macOS });
shouldBeEqualToString("mediaControls.element.localName", "div");
shouldBeEqualToString("mediaControls.element.className", "media-controls");
debug("");
shouldBe("mediaControls.width", "300");
shouldBe("mediaControls.height", "150");
shouldBe("mediaControls.layoutTraits", "LayoutTraits.macOS");
debug("");
shouldBeTrue("mediaControls.playPauseButton instanceof PlayPauseButton");
shouldBeTrue("mediaControls.airplayButton instanceof AirplayButton");
shouldBeTrue("mediaControls.pipButton instanceof PiPButton");
shouldBeTrue("mediaControls.fullscreenButton instanceof FullscreenButton");
shouldBeTrue("mediaControls.statusLabel instanceof StatusLabel");
shouldBeTrue("mediaControls.timeControl instanceof TimeControl");
shouldBeTrue("mediaControls.airplayPlacard instanceof AirplayPlacard");
shouldBeTrue("mediaControls.invalidPlacard instanceof InvalidPlacard");
shouldBeTrue("mediaControls.pipPlacard instanceof PiPPlacard");
debug("");
shouldBeTrue("mediaControls.bottomControlsBar instanceof ControlsBar");
shouldBeEqualToString("mediaControls.bottomControlsBar.element.localName", "div");
shouldBeTrue("mediaControls.bottomControlsBar.element.classList.contains('controls-bar')");
shouldBeTrue("mediaControls.bottomControlsBar.element.classList.contains('bottom')");
debug("");
const mediaControlsWithArguments = new MediaControls({ width: 600, height: 300, layoutTraits: LayoutTraits.macOS });
shouldBe("mediaControlsWithArguments.width", "600");
shouldBe("mediaControlsWithArguments.height", "300");
debug("");
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>