blob: 5d0123571b977b0e6862d8a794b9ffb3402ef37a [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.visible</code> property.");
window.jsTestIsAsync = true;
const node = new LayoutNode;
debug("Checking default value");
shouldBe("node.visible", "true");
shouldBeEqualToString("node.element.style.display", "");
debug("");
debug("node.visible = false");
node.visible = false;
shouldBe("node.visible", "false");
shouldBeEqualToString("node.element.style.display", "");
let numberOfFrames = 0;
scheduler.frameDidFire = function()
{
debug("");
debug("Layout was performed");
switch (++numberOfFrames) {
case 1:
shouldBe("node.visible", "false");
shouldBeEqualToString("node.element.style.display", "none");
debug("");
debug("node.visible = true");
node.visible = true;
break;
case 2:
shouldBe("node.visible", "true");
shouldBeEqualToString("node.element.style.display", "");
debug("");
debug("node.visible = true");
node.visible = true;
shouldBeFalse("scheduler.hasScheduledLayoutCallbacks");
debug("");
finishMediaControlsTest();
break;
}
};
</script>
<script src="../../../resources/js-test-post.js"></script>