blob: d72ba10ed8eebb59808c875a7fc462580bbd7614 [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 type="text/javascript">
description("Testing the <code>LayoutNode</code> various constructor parameters.");
debug("No parameter");
const nodeWithNoParameter = new LayoutNode;
shouldBeEqualToString("nodeWithNoParameter.element.localName", "div");
debug("");
debug("Element parameter");
const element = document.createElement("h1");
const nodeWithElementParameter = new LayoutNode(element);
shouldBeTrue("nodeWithElementParameter.element === element");
debug("");
debug("HTML string parameter");
const nodeWithStringParameter = new LayoutNode(`<span>hello <strong>world</strong></span>`);
shouldBeEqualToString("nodeWithStringParameter.element.localName", "span");
shouldBeEqualToString("nodeWithStringParameter.element.textContent", "hello world");
shouldBeEqualToString("nodeWithStringParameter.element.firstElementChild.localName", "strong");
</script>
<script src="../../../resources/js-test-post.js"></script>