blob: fce3e054ca41858bd525fd0d910b3a879090c250 [file] [log] [blame]
<script src="../../../resources/js-test-pre.js"></script>
<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/scheduler.js" type="text/javascript"></script>
<script src="../../../../Source/WebCore/Modules/modern-media-controls/controls/layout-node.js" type="text/javascript"></script>
<script src="../resources/media-controls-utils.js" type="text/javascript"></script>
<script type="text/javascript">
description("Testing the <code>LayoutNode.width</code> property.");
window.jsTestIsAsync = true;
const node = new LayoutNode;
debug("Checking default value");
shouldBe("node.width", "0");
shouldBeEqualToString("node.element.style.width", "");
debug("");
debug("node.width = 10");
node.width = 10;
shouldBe("node.width", "10");
shouldBeEqualToString("node.element.style.width", "");
// Set the value to another one so we can check it's the one committed to the DOM.
debug("");
debug("node.width = 20");
node.width = 20;
scheduler.frameDidFire = function()
{
debug("");
debug("Layout was performed");
shouldBe("node.width", "20");
shouldBeEqualToString("node.element.style.width", "20px");
debug("");
debug("node.width = 20");
node.width = 20;
shouldBeFalse("scheduler.hasScheduledLayoutCallbacks");
debug("");
finishMediaControlsTest();
};
</script>
<script src="../../../resources/js-test-post.js"></script>