blob: b81bc0664d5b78f57d70019bbcc4c7aef8b4dcd3 [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>ButtonsContainer</code> constructor.");
const layoutDelegate = { layoutTraits: new MacOSLayoutTraits(LayoutTraits.Mode.Inline) };
const defaultContainer = new ButtonsContainer;
shouldBeEqualToString("defaultContainer.element.localName", "div");
shouldBeEqualToString("defaultContainer.element.className.trim()", "buttons-container");
shouldBe("defaultContainer.buttonMargin", "16");
shouldBe("defaultContainer.leftMargin", "16");
shouldBe("defaultContainer.rightMargin", "16");
shouldBe("defaultContainer.children", "[]");
const buttons = [
new Button({ layoutDelegate }),
new Button({ layoutDelegate }),
];
const containerWithParameters = new ButtonsContainer({
buttonMargin: 10,
leftMargin: 20,
rightMargin: 20,
children: buttons,
cssClassName: "foo"
});
shouldBeEqualToString("containerWithParameters.element.localName", "div");
shouldBeTrue("containerWithParameters.element.classList.contains('buttons-container')");
shouldBeTrue("containerWithParameters.element.classList.contains('foo')");
shouldBe("containerWithParameters.buttonMargin", "10");
shouldBe("containerWithParameters.leftMargin", "20");
shouldBe("containerWithParameters.rightMargin", "20");
shouldBe("containerWithParameters.children", "buttons");
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>