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