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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/spelling/inline_spelling_markers.html

Issue 2186923002: Remove grammar checking from layout tests, and MockGrammarCheck (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@RemoveGrammarTests
Patch Set: Rebased Created 4 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
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../resources/js-test.js"></script> 3 <script src="../../resources/js-test.js"></script>
4 <script src="../../editing/editing.js"></script> 4 <script src="../../editing/editing.js"></script>
5 <style> 5 <style>
6 body { overflow:hidden; } 6 body { overflow:hidden; }
7 7
8 .testDiv { 8 .testDiv {
9 width: 200px; 9 width: 200px;
10 height: 20px; 10 height: 20px;
11 border: 1px solid black; 11 border: 1px solid black;
12 white-space: nowrap; 12 white-space: nowrap;
13 overflow: hidden; 13 overflow: hidden;
14 } 14 }
15 15
16 .forcertl { 16 .forcertl {
17 direction: rtl; 17 direction: rtl;
18 unicode-bidi: bidi-override; 18 unicode-bidi: bidi-override;
19 } 19 }
20 20
21 .ellipses { 21 .ellipses {
22 text-overflow:ellipsis; 22 text-overflow:ellipsis;
23 } 23 }
24 24
25 </style> 25 </style>
26 26
27 </head> 27 </head>
28 <body> 28 <body>
29 <script> 29 <script>
30 description("This tests the correct placement of inline spelling and grammar " 30 description("This tests the correct placement of inline spelling "
31 + "markers in text. Spelling markers should line up exactly under misspelled " 31 + "markers in text. Spelling markers should line up exactly under misspelled "
32 + "words in all cases."); 32 + "words in all cases.");
33 33
34 jsTestIsAsync = true; 34 jsTestIsAsync = true;
35 35
36 if (window.internals) 36 if (window.internals)
37 internals.settings.setUnifiedTextCheckerEnabled(true); 37 internals.settings.setUnifiedTextCheckerEnabled(true);
38 38
39 if (window.testRunner) 39 if (window.testRunner)
40 testRunner.dumpAsTextWithPixelResults(); 40 testRunner.dumpAsTextWithPixelResults();
(...skipping 24 matching lines...) Expand all
65 moveSelectionForwardByWordCommand(); 65 moveSelectionForwardByWordCommand();
66 66
67 verifyMarkers(); 67 verifyMarkers();
68 } 68 }
69 69
70 function verifyMarkers() 70 function verifyMarkers()
71 { 71 {
72 if (!window.internals) 72 if (!window.internals)
73 return done(); 73 return done();
74 74
75 // Take care of spelling markers first.
76 shouldBecomeEqual('internals.hasSpellingMarker(document, 8, 4)', 'true', fun ction() { // Verifies 'adlj'. 75 shouldBecomeEqual('internals.hasSpellingMarker(document, 8, 4)', 'true', fun ction() { // Verifies 'adlj'.
77 shouldBecomeEqual('internals.hasSpellingMarker(document, 13, 6)', 'true' , function() { // Verifies 'adaasj'. 76 shouldBecomeEqual('internals.hasSpellingMarker(document, 13, 6)', 'true' , function() { // Verifies 'adaasj'.
78 shouldBecomeEqual('internals.hasSpellingMarker(document, 20, 5)', 't rue', verifyGrammarMarkers) // Verifies 'sdklj'. 77 shouldBecomeEqual('internals.hasSpellingMarker(document, 20, 5)', 't rue', function() { // Verifies 'sdklj'.
79 })
80 });
81
82 function verifyGrammarMarkers() {
83 shouldBecomeEqual('internals.hasGrammarMarker(document, 4, 3)', 'true', function() { // Verifies second 'the'.
84 shouldBecomeEqual('internals.hasGrammarMarker(document, 33, 5)', 'tr ue', function() { // Verifies second 'there'.
85 // Markers of next element can not be found after modification s election without blur event. 78 // Markers of next element can not be found after modification s election without blur event.
86 div.blur(); 79 div.blur();
87 done(); 80 done();
88 }) 81 })
89 }); 82 })
90 } 83 });
91 } 84 }
92 85
93 var tests = [ function() { moveCursorOverAllWords('testLTR'); }, 86 var tests = [ function() { moveCursorOverAllWords('testLTR'); },
94 function() { moveCursorOverAllWords('testRTL'); }, 87 function() { moveCursorOverAllWords('testRTL'); },
95 function() { moveCursorOverAllWords('testLTREllipses'); }, 88 function() { moveCursorOverAllWords('testLTREllipses'); },
96 function() { moveCursorOverAllWords('testRTLEllipses'); } ]; 89 function() { moveCursorOverAllWords('testRTLEllipses'); } ];
97 90
98 function done() 91 function done()
99 { 92 {
100 var next = tests.shift(); 93 var next = tests.shift();
101 if (next) 94 if (next)
102 return window.setTimeout(next, 0); 95 return window.setTimeout(next, 0);
103 96
104 finishJSTest(); 97 finishJSTest();
105 } 98 }
106 done(); 99 done();
107 </script> 100 </script>
108 </body> 101 </body>
109 </html> 102 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698