Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: LayoutTests/editing/spelling/markers-input-type-text.html

Issue 21024004: Add/remove spell checking markers in text inputs depending on focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clean up in the test & the new expected file. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/editing/spelling/markers-input-type-text-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..cf393c4c61270eaecc64fafdb216007f03699796
--- /dev/null
+++ b/LayoutTests/editing/spelling/markers-input-type-text.html
@@ -0,0 +1,61 @@
+<!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()
+{
+ 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. ');
+ shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spelling")', '1');
+
+ typeText(testInput, 'zz zz zz zz. ');
+ shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelling")', '4');
+
+ document.getElementById("aux").focus();
+
+ shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelling")', '0');
+ shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spelling")', '1');
+
+ testInput.focus();
+
+ 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>
« no previous file with comments | « no previous file | LayoutTests/editing/spelling/markers-input-type-text-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698