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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/spelling/move-cursor-to-misspelled-word.html

Issue 2270293003: Add a switch to TestRunner to enable/disable mock spell checker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use in-class initialization Created 4 years, 3 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 language="javascript" type="text/javascri pt"></script> 3 <script src=../../resources/js-test.js language="javascript" type="text/javascri pt"></script>
4 <title>Testing moving cursor to a misspelled word</title> 4 <title>Testing moving cursor to a misspelled word</title>
5 </head> 5 </head>
6 <body> 6 <body>
7 <div id="src" contenteditable="true" spellcheck="true"></div><br/> 7 <div id="src" contenteditable="true" spellcheck="true"></div><br/>
8 <script language="javascript"> 8 <script language="javascript">
9 description('Test if Chrome WebKit does not remove a misspelled marker when movi ng a cursor on a misspelled word.' + 9 description('Test if Chrome WebKit does not remove a misspelled marker when movi ng a cursor on a misspelled word.' +
10 'To test manually, type a misspelled word "zz " and type a left-arro w key to move the cursor on it.' + 10 'To test manually, type a misspelled word "zz " and type a left-arro w key to move the cursor on it.' +
11 'This test succeeds when "zz" is marked as misspelled.'); 11 'This test succeeds when "zz" is marked as misspelled.');
12 12
13 jsTestIsAsync = true; 13 jsTestIsAsync = true;
14 if (window.testRunner)
15 testRunner.setMockSpellCheckerEnabled(true);
14 16
15 var node = document.getElementById('src'); 17 var node = document.getElementById('src');
16 node.focus(); 18 node.focus();
17 document.execCommand("InsertText", false, 'z'); 19 document.execCommand("InsertText", false, 'z');
18 document.execCommand("InsertText", false, 'z'); 20 document.execCommand("InsertText", false, 'z');
19 document.execCommand("InsertText", false, ' '); 21 document.execCommand("InsertText", false, ' ');
20 window.getSelection().modify('move', 'backward', 'character'); 22 window.getSelection().modify('move', 'backward', 'character');
21 shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 2)', 'true', finishJ STest); 23 shouldBecomeEqual('internals.hasSpellingMarker(document, 0, 2)', 'true', finishJ STest);
22 </script> 24 </script>
23 </body> 25 </body>
24 </html> 26 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698