blob: d80208720082bc2e2526dedb2adac91e732b75ec [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.x</code> property.");
window.jsTestIsAsync = true;
const node = new LayoutNode;
debug("Checking default value");
shouldBe("node.x", "0");
shouldBeEqualToString("node.element.style.left", "");
debug("");
debug("node.x = 10");
node.x = 10;
shouldBe("node.x", "10");
shouldBeEqualToString("node.element.style.left", "");
// Set the value to another one so we can check it's the one committed to the DOM.
debug("");
debug("node.x = 20");
node.x = 20;
scheduler.frameDidFire = function()
{
debug("");
debug("Layout was performed");
shouldBe("node.x", "20");
shouldBeEqualToString("node.element.style.left", "20px");
debug("");
debug("node.x = 20");
node.x = 20;
shouldBeFalse("scheduler.hasScheduledLayoutCallbacks");
debug("");
finishMediaControlsTest();
};
</script>
<script src="../../../resources/js-test-post.js"></script>