blob: 0e181a0fc7bfff152396a90044fad21ba5d1ec92 [file] [log] [blame]
<script src="../../../resources/js-test-pre.js"></script>
<script src="../resources/media-controls-loader.js" type="text/javascript"></script>
<body>
<script type="text/javascript">
description("Testing the <code>TimeControl</code> class.");
const timeControl = new TimeControl;
shouldBeEqualToString("timeControl.element.localName", "div");
shouldBeEqualToString("timeControl.element.className", "time-control");
debug("");
shouldBeTrue("timeControl.elapsedTimeLabel instanceof TimeLabel");
shouldBeTrue("timeControl.scrubber instanceof Slider");
shouldBeTrue("timeControl.remainingTimeLabel instanceof TimeLabel");
debug("");
debug("timeControl.width = 500;");
timeControl.width = 500;
shouldBe("timeControl.children.length", "3");
shouldBe("timeControl.children[0]", "timeControl.elapsedTimeLabel");
shouldBe("timeControl.children[1]", "timeControl.scrubber");
shouldBe("timeControl.children[2]", "timeControl.remainingTimeLabel");
shouldBe("timeControl.elapsedTimeLabel.x", "0");
shouldBe("timeControl.scrubber.x", "32");
shouldBe("timeControl.scrubber.width", "430");
shouldBe("timeControl.remainingTimeLabel.x", "467");
debug("");
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>