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

Side by Side Diff: LayoutTests/editing/spelling/spelling-changed-text.html

Issue 484353004: Test tidying: use "escape" and "backspace" with eventSender.keyDown() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More quoting consistency wibbles Created 6 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 <script src="resources/util.js"></script> 5 <script src="resources/util.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <div id="container"> 8 <div id="container">
9 <div id="destination" contentEditable></div> 9 <div id="destination" contentEditable></div>
10 </div> 10 </div>
11 11
12 <script> 12 <script>
13 13
14 description("Spellcheck should not crash after the text has changed and results are served from cache." 14 description("Spellcheck should not crash after the text has changed and results are served from cache."
15 + " To test manually, launch Chromium compiled with Address Sanitizer, enabl e 'Ask Google for Suggestions', type 'Spell wellcome. Is it broken?', delete the words 'Is it broken?', and context-click on the word 'wellcome'." 15 + " To test manually, launch Chromium compiled with Address Sanitizer, enabl e 'Ask Google for Suggestions', type 'Spell wellcome. Is it broken?', delete the words 'Is it broken?', and context-click on the word 'wellcome'."
16 + " The test succeeds when the browser does not crash and shows suggestions in the context menu."); 16 + " The test succeeds when the browser does not crash and shows suggestions in the context menu.");
17 17
18 initSpellTest("destination", "Spell wellcome. Is it broken?", function(textNode) { 18 initSpellTest("destination", "Spell wellcome. Is it broken?", function(textNode) {
19 // Select the text "Is it broken?". 19 // Select the text "Is it broken?".
20 var deleteRange = document.createRange(); 20 var deleteRange = document.createRange();
21 deleteRange.setStart(textNode, 15); 21 deleteRange.setStart(textNode, 15);
22 deleteRange.setEnd(textNode, 29); 22 deleteRange.setEnd(textNode, 29);
23 window.getSelection().removeAllRanges(); 23 window.getSelection().removeAllRanges();
24 window.getSelection().addRange(deleteRange); 24 window.getSelection().addRange(deleteRange);
25 shouldBeEqualToString("window.getSelection().toString()", " Is it broken?"); 25 shouldBeEqualToString("window.getSelection().toString()", " Is it broken?");
26 // Del key to delete the text "Is it broken?". 26 // Del key to delete the text "Is it broken?".
27 eventSender.keyDown(String.fromCharCode(0x007F), null); 27 eventSender.keyDown("delete", null);
28 28
29 // Context click to show the context menu. 29 // Context click to show the context menu.
30 var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 50; 30 var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 50;
31 var y = destination.offsetParent.offsetTop + destination.offsetTop + destina tion.offsetHeight / 2; 31 var y = destination.offsetParent.offsetTop + destination.offsetTop + destina tion.offsetHeight / 2;
32 eventSender.mouseMoveTo(x, y); 32 eventSender.mouseMoveTo(x, y);
33 contextMenuElements = eventSender.contextClick(); 33 contextMenuElements = eventSender.contextClick();
34 // Esc key to hide the context menu. 34 // Esc key to hide the context menu.
35 eventSender.keyDown(String.fromCharCode(0x001B), null); 35 eventSender.keyDown("escape", null);
36 36
37 document.getElementById("destination").innerHTML = ""; 37 document.getElementById("destination").innerHTML = "";
38 }); 38 });
39 39
40 </script> 40 </script>
41 </body> 41 </body>
42 </html> 42 </html>
OLDNEW
« no previous file with comments | « LayoutTests/editing/spelling/input-type-text.html ('k') | LayoutTests/editing/spelling/spelling-double-clicked-word.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698