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

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: Addressing review comments 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
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..b196c2ee0826d669c826678eb914e7f508b05425
--- /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" language="JavaScript" type="text/JavaScript" ></script>
please use gerrit instead 2013/07/31 16:27:31 language="JavaScript" type="text/JavaScript" Nit
+<script src="resources/util.js"></script>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<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.");
+
+var testTextArea = document.getElementById("testTextArea");
+var testInput = document.getElementById("testInput");
+
+if (!window.internals) {
+ alert("Test manually. See the description for steps");
+ var successfullyParsed = true;
+ return;
tony 2013/07/31 20:59:29 Does it work to return when you're not in a functi
+}
+
+internals.settings.setUnifiedTextCheckerEnabled(true);
+
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+typeText(testTextArea, 'zz. ');
+if (window.internals) {
+ shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spelling")', '1');
+}
+
+typeText(testInput, 'zz zz zz zz. ');
+if (window.internals) {
+ shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelling")', '4');
+
+}
+
+document.getElementById("aux").focus();
+
+if (window.internals) {
+ shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelling")', '0');
+ shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spelling")', '1');
+}
+
+testInput.focus();
+if (window.internals) {
+ shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelling")', '4');
+ shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spelling")', '1');
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698