blob: fe4fb70209f2426d7bc1d292b76be1dacb7730ae [file] [log] [blame]
<script src="../../../resources/js-test-pre.js"></script>
<script src="../resources/media-controls-utils.js" type="text/javascript"></script>
<script src="../resources/media-controls-loader.js" type="text/javascript"></script>
<body>
<script type="text/javascript">
window.jsTestIsAsync = true;
description("Testing the <code>StatusText</code> class.");
const statusLabel = new StatusLabel({
set needsLayout(flag)
{
debug("layoutDelegate.needsLayout set to " + flag);
}
});
debug("Constructor");
shouldBeEqualToString("statusLabel.element.localName", "div");
shouldBeEqualToString("statusLabel.element.className", "status-label");
shouldBeEqualToString("statusLabel.text", "");
debug("");
debug("Setting the `text` property");
statusLabel.text = "Hello World!";
shouldBeEqualToString("statusLabel.text", "Hello World!");
let style;
scheduler.frameDidFire = function()
{
document.body.appendChild(statusLabel.element);
shouldBeEqualToString("statusLabel.element.textContent", "Hello World!");
debug("");
debug("Computed style");
style = window.getComputedStyle(statusLabel.element);
shouldBeEqualToString("style.position", "absolute");
shouldBeEqualToString("style.textOverflow", "ellipsis");
shouldBeEqualToString("style.whiteSpace", "nowrap");
shouldBeEqualToString("style.overflow", "hidden");
shouldBeEqualToString("style.fontSize", "12px");
statusLabel.element.remove();
debug("");
finishMediaControlsTest();
}
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>