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

Side by Side 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, 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style>
5 .editing {
6 border: 2px solid red;
7 padding: 12px;
8 font-size: 24px;
9 }
10 </style>
11 <script src="../editing.js" language="JavaScript" type="text/JavaScript" ></scri pt>
please use gerrit instead 2013/07/31 16:27:31 language="JavaScript" type="text/JavaScript" Nit
12 <script src="resources/util.js"></script>
13 <script src="../../fast/js/resources/js-test-pre.js"></script>
14 </head>
15 <body>
16 <textarea id="testTextArea"></textarea><br/>
17 <input type="text" id="testInput" /><br/>
18 <br/>
19 <textarea id="aux"></textarea>
20 <script>
21 description("Markers in text inputs should only be visible if an input is being edited " +
22 "but removing markers from the input must not touch other markers." +
23 "When testing manually type something misspelled in the first textarea, " +
24 "focus the text input and type something with misspellings there too." +
25 "Then focus the second text area. Mispelling marks should be removed from the in put" +
26 "but not for the first textarea. Focus the input again - misspelling marks shoul d be restored.");
27
28 var testTextArea = document.getElementById("testTextArea");
29 var testInput = document.getElementById("testInput");
30
31 if (!window.internals) {
32 alert("Test manually. See the description for steps");
33 var successfullyParsed = true;
34 return;
tony 2013/07/31 20:59:29 Does it work to return when you're not in a functi
35 }
36
37 internals.settings.setUnifiedTextCheckerEnabled(true);
38
39 if (window.testRunner)
40 testRunner.dumpAsText();
41
42 typeText(testTextArea, 'zz. ');
43 if (window.internals) {
44 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '1');
45 }
46
47 typeText(testInput, 'zz zz zz zz. ');
48 if (window.internals) {
49 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelli ng")', '4');
50
51 }
52
53 document.getElementById("aux").focus();
54
55 if (window.internals) {
56 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelli ng")', '0');
57 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '1');
58 }
59
60 testInput.focus();
61 if (window.internals) {
62 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "spelli ng")', '4');
63 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spe lling")', '1');
64 }
65
66 var successfullyParsed = true;
67 </script>
68 <script src="../../fast/js/resources/js-test-post.js"></script>
69 </body>
70 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698