OLD | NEW |
---|---|
(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"></script> | |
12 <script src="resources/util.js"></script> | |
13 <script src="../../fast/js/resources/js-test-pre.js"></script> | |
14 </head> | |
15 <body onload="test();"> | |
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 function test() | |
28 { | |
29 | |
tony
2013/07/31 22:31:45
Nit: Remove blank line.
| |
30 var testTextArea = document.getElementById("testTextArea"); | |
31 var testInput = document.getElementById("testInput"); | |
32 | |
33 if (!window.internals) { | |
34 alert("Test manually. See the description for steps"); | |
35 return; | |
36 } | |
37 | |
38 internals.settings.setUnifiedTextCheckerEnabled(true); | |
39 | |
40 if (window.testRunner) | |
41 testRunner.dumpAsText(); | |
42 | |
43 typeText(testTextArea, 'zz. '); | |
44 if (window.internals) { | |
tony
2013/07/31 22:31:45
You don't need to test for window.internals again
| |
45 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spelling")', '1'); | |
46 } | |
47 | |
48 typeText(testInput, 'zz zz zz zz. '); | |
49 if (window.internals) { | |
tony
2013/07/31 22:31:45
Ditto.
| |
50 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "sp elling")', '4'); | |
51 | |
52 } | |
53 | |
54 document.getElementById("aux").focus(); | |
55 | |
56 if (window.internals) { | |
tony
2013/07/31 22:31:45
Ditto.
| |
57 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "sp elling")', '0'); | |
58 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spelling")', '1'); | |
59 } | |
60 | |
61 testInput.focus(); | |
62 if (window.internals) { | |
tony
2013/07/31 22:31:45
Ditto.
| |
63 shouldBe('internals.markerCountForNode(findFirstTextNode(testInput), "sp elling")', '4'); | |
64 shouldBe('internals.markerCountForNode(findFirstTextNode(testTextArea), "spelling")', '1'); | |
65 } | |
66 } | |
67 </script> | |
68 <script src="../../fast/js/resources/js-test-post.js"></script> | |
69 </body> | |
70 </html> | |
OLD | NEW |