| <!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> |