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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/spelling/design-mode-spellcheck-off.html

Issue 2442313002: Convert editing/spelling/design-mode-spellcheck-off.html with spellcheck_test (Closed)
Patch Set: Wed Oct 26 17:56:37 JST 2016 Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/design-mode-spellcheck-off-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <script src="../../resources/testharness.js"></script>
3 <body spellcheck="false"> 3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../editing.js"></script> 4 <script src="../assert_selection.js"></script>
5 <script src="../../resources/js-test.js"></script> 5 <script src="spellcheck_test.js"></script>
6 <div id="misspelled" onmouseup="checkSpellingMarker()">asd is misspelled.</div>
7 <script> 6 <script>
8 description("This tests whether WebKit does not spell check in 'designMode' " 7 spellcheck_test(
9 + "when spellcheck='false'. To test manually, click 'asd' and move cursor un til '.'. " 8 [
10 + "There should be no spelling marker for 'asd'."); 9 '<div id="container" spellcheck="false">',
11 10 '<div>|asd is misspelled.</div>',
12 jsTestIsAsync = true; 11 '</div>'
13 if (window.testRunner) 12 ].join(''),
14 testRunner.setMockSpellCheckerEnabled(true); 13 document => {
15 14 document.designMode = 'on';
16 document.designMode = "on"; 15 document.getSelection().modify('move', 'forward', 'word');
17 16 },
18 function checkSpellingMarker() 17 [
19 { 18 '<div id="container" spellcheck="false">',
20 if (!window.internals) 19 '<div>asd is misspelled.</div>',
21 return; 20 '</div>'
22 21 ].join(''),
23 // First, verify spelling with spellcheck attribute off. 22 {
24 // Move selection to the next word to notify WebKit that "asd" has been type d/changed 23 title: 'No spelling marker in designMode when spellcheck=false.',
25 // to give a chance to spellcheck. 24 callback: sample => spellcheck_test(
26 moveSelectionForwardByWordCommand(); 25 sample,
27 26 document => {
28 shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 3)', 'false', fu nction() { 27 document.getElementById('container').setAttribute('spellcheck', 'tru e');
29 evalAndLog('document.body.setAttribute("spellcheck", "true")'); 28 // Do any selection change to force spellchecking after attribute ch ange.
30 // Do any selection change to force spellchecking after attribute change . 29 document.getSelection().modify('move', 'forward', 'line');
31 moveSelectionForwardByLineCommand(); 30 },
32 shouldBecomeDifferent('internals.hasSpellingMarker(document, 0, 3)', 'fa lse', finishJSTest); 31 [
32 '<div id="container" spellcheck="true">',
33 '<div>_asd_ is misspelled.</div>',
34 '</div>'
35 ].join(''),
36 'Spelling marker appears when changing spellcheck from false to true.' )
33 }); 37 });
34 } 38 </script>
35
36 if (window.eventSender) {
37 var misspelledDiv = document.getElementById("misspelled");
38 var x = misspelledDiv.offsetLeft;
39 var y = misspelledDiv.offsetTop;
40 eventSender.mouseMoveTo(x, y);
41 eventSender.mouseDown();
42 eventSender.mouseUp();
43 }
44 </script>
45 </body>
46 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/design-mode-spellcheck-off-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698