Chromium Code Reviews| Index: LayoutTests/editing/spelling/markers-input-type-text.html |
| diff --git a/LayoutTests/editing/spelling/markers-input-type-text.html b/LayoutTests/editing/spelling/markers-input-type-text.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..164801c085e3778d487a6219ca739f318795216c |
| --- /dev/null |
| +++ b/LayoutTests/editing/spelling/markers-input-type-text.html |
| @@ -0,0 +1,70 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<style> |
| +.editing { |
| + border: 2px solid red; |
| + padding: 12px; |
| + font-size: 24px; |
| +} |
| +</style> |
| +<script src="../editing.js"></script> |
| +<script src="resources/util.js"></script> |
| +<script src="../../fast/js/resources/js-test-pre.js"></script> |
| +</head> |
| +<body onload="test();"> |
| +<textarea id="testTextArea"></textarea><br/> |
| +<input type="text" id="testInput" /><br/> |
| +<br/> |
| +<textarea id="aux"></textarea> |
| +<script> |
| +description("Markers in text inputs should only be visible if an input is being edited " + |
| +"but removing markers from the input must not touch other markers." + |
| +"When testing manually type something misspelled in the first textarea, " + |
| +"focus the text input and type something with misspellings there too." + |
| +"Then focus the second text area. Mispelling marks should be removed from the input" + |
| +"but not for the first textarea. Focus the input again - misspelling marks should be restored."); |
| +function test() |
| +{ |
| + |
|
tony
2013/07/31 22:31:45
Nit: Remove blank line.
|
| + var testTextArea = document.getElementById("testTextArea"); |
| + var testInput = document.getElementById("testInput"); |
| + |
| + if (!window.internals) { |
| + alert("Test manually. See the description for steps"); |
| + return; |
| + } |
| + |
| + internals.settings.setUnifiedTextCheckerEnabled(true); |
| + |
| + if (window.testRunner) |
| + testRunner.dumpAsText(); |
| + |
| + typeText(testTextArea, 'zz. '); |
| + if (window.internals) { |
|
tony
2013/07/31 22:31:45
You don't need to test for window.internals again
|
| + shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spelling")', '1'); |
| + } |
| + |
| + typeText(testInput, 'zz zz zz zz. '); |
| + if (window.internals) { |
|
tony
2013/07/31 22:31:45
Ditto.
|
| + shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelling")', '4'); |
| + |
| + } |
| + |
| + document.getElementById("aux").focus(); |
| + |
| + if (window.internals) { |
|
tony
2013/07/31 22:31:45
Ditto.
|
| + shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelling")', '0'); |
| + shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spelling")', '1'); |
| + } |
| + |
| + testInput.focus(); |
| + if (window.internals) { |
|
tony
2013/07/31 22:31:45
Ditto.
|
| + shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelling")', '4'); |
| + shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spelling")', '1'); |
| + } |
| +} |
| +</script> |
| +<script src="../../fast/js/resources/js-test-post.js"></script> |
| +</body> |
| +</html> |