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