blob: 36a8d5b3f1f51119fdd11a070c5dfc97e6750881 [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>MacOSInlineMediaControls</code> constructor.");
const mediaControls = new MacOSInlineMediaControls;
shouldBeEqualToString("mediaControls.element.localName", "div");
shouldBeEqualToString("mediaControls.element.className", "media-controls mac inline");
shouldBeType("mediaControls.layoutTraits", "MacOSLayoutTraits");
shouldBeFalse("mediaControls.layoutTraits.isFullscreen");
debug("");
debug("Controls bar");
shouldBe("mediaControls.controlsBar.children.length", "4");
shouldBeType("mediaControls.controlsBar.children[1]", "ButtonsContainer");
shouldBeType("mediaControls.controlsBar.children[2]", "ButtonsContainer");
shouldBeType("mediaControls.controlsBar.children[3]", "LayoutNode");
debug("");
debug("Left container");
shouldBe("mediaControls.controlsBar.children[1].buttons", "[mediaControls.playPauseButton, mediaControls.skipBackButton]");
shouldBeEqualToString("mediaControls.controlsBar.children[1].element.className", "buttons-container left");
shouldBe("mediaControls.controlsBar.children[1].leftMargin", "24");
shouldBe("mediaControls.controlsBar.children[1].rightMargin", "24");
shouldBe("mediaControls.controlsBar.children[1].buttonMargin", "24");
debug("");
debug("Right container");
shouldBe("mediaControls.controlsBar.children[2].buttons", "[mediaControls.muteButton, mediaControls.airplayButton, mediaControls.pipButton, mediaControls.tracksButton, mediaControls.fullscreenButton]");
shouldBeEqualToString("mediaControls.controlsBar.children[2].element.className", "buttons-container right");
shouldBe("mediaControls.controlsBar.children[2].leftMargin", "24");
shouldBe("mediaControls.controlsBar.children[2].rightMargin", "24");
shouldBe("mediaControls.controlsBar.children[2].buttonMargin", "24");
debug("");
debug("Volume slider");
shouldBeEqualToString("mediaControls.controlsBar.children[3].element.className", "volume-slider-container");
shouldBe("mediaControls.controlsBar.children[3].children.slice(-1)", "[mediaControls.volumeSlider]");
shouldBeFalse("mediaControls.controlsBar.children[3].visible");
shouldBe("mediaControls.volumeSlider.width", "60");
mediaControls.bottomControlsBar.element.id = "groupping-label";
document.body.appendChild(mediaControls.bottomControlsBar.element);
mediaControls.shouldUseAudioLayout = false;
shouldBeEqualToString("accessibilityController.accessibleElementById('groupping-label').description", "AXDescription: Video Controls");
mediaControls.shouldUseAudioLayout = true;
shouldBeEqualToString("accessibilityController.accessibleElementById('groupping-label').description", "AXDescription: Audio Controls");
debug("");
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>