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

Side by Side Diff: LayoutTests/editing/spelling/spelling-should-select-multiple-words.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>
(...skipping 11 matching lines...) Expand all
22 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0); 22 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
23 shouldBeEqualToString("spellingMarkerRange.toString()", "upper case"); 23 shouldBeEqualToString("spellingMarkerRange.toString()", "upper case");
24 shouldBeEqualToString("window.getSelection().toString()", ""); 24 shouldBeEqualToString("window.getSelection().toString()", "");
25 25
26 // Context click on "upper case" to show the context menu. 26 // Context click on "upper case" to show the context menu.
27 var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 1 00; 27 var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 1 00;
28 var y = destination.offsetParent.offsetTop + destination.offsetTop + des tination.offsetHeight / 2; 28 var y = destination.offsetParent.offsetTop + destination.offsetTop + des tination.offsetHeight / 2;
29 eventSender.mouseMoveTo(x, y); 29 eventSender.mouseMoveTo(x, y);
30 contextMenuElements = eventSender.contextClick(); 30 contextMenuElements = eventSender.contextClick();
31 // Esc key to hide the context menu. 31 // Esc key to hide the context menu.
32 eventSender.keyDown(String.fromCharCode(0x001B), null); 32 eventSender.keyDown("escape", null);
33 33
34 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0); 34 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
35 shouldBeEqualToString("spellingMarkerRange.toString()", "upper case"); 35 shouldBeEqualToString("spellingMarkerRange.toString()", "upper case");
36 shouldBeEqualToString("window.getSelection().toString()", "upper case"); 36 shouldBeEqualToString("window.getSelection().toString()", "upper case");
37 shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]", "uppercase"); 37 shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]", "uppercase");
38 38
39 window.getSelection().removeAllRanges(); 39 window.getSelection().removeAllRanges();
40 } 40 }
41 }); 41 });
42 42
43 </script> 43 </script>
44 </body> 44 </body>
45 </html> 45 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698