blob: 75e17c20945bdc53eba8b15766498e2d7ddb63ef [file] [log] [blame]
<!DOCTYPE html> <!-- webkit-test-runner [ HighlightAPIEnabled=true ] -->
<html>
<body>
<script src="../resources/js-test.js"></script>
<script>
description("Tests the interfaces of the highlight API, which include Highlight, HighlightRegister, and extensions to the CSS namespace.");
debug("Testing Highlight:");
shouldBeTrue("Highlight instanceof Function");
shouldBeEqualToString("typeof Highlight", "function");
shouldBeTrue("new Highlight(new StaticRange({startContainer: document.body, startOffset: 1, endContainer: document.body, endOffset: 2})) instanceof Highlight");
shouldBeTrue("HighlightRegister instanceof Function");
shouldBeEqualToString("typeof HighlightRegister", "function");
shouldBeTrue("new HighlightRegister() instanceof HighlightRegister");
shouldBeDefined('new HighlightRegister().set("foo-styling",new Highlight(new StaticRange({startContainer: document.body, startOffset: 1, endContainer: document.body, endOffset: 2})))');
shouldBeDefined('CSS.highlights');
shouldBe('CSS.highlights.set("foo-styling",new Highlight(new StaticRange({startContainer: document.body, startOffset: 1, endContainer: document.body, endOffset: 2})))', 'CSS.highlights');
</script>
</body>
</html>