OLD | NEW |
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 16 matching lines...) Expand all Loading... |
27 window.getSelection().addRange(wordRange); | 27 window.getSelection().addRange(wordRange); |
28 | 28 |
29 shouldBeEqualToString("window.getSelection().toString()", "upper case"); | 29 shouldBeEqualToString("window.getSelection().toString()", "upper case"); |
30 | 30 |
31 // Context click on "upper case" to show the context menu. | 31 // Context click on "upper case" to show the context menu. |
32 var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 100; | 32 var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 100; |
33 var y = destination.offsetParent.offsetTop + destination.offsetTop + destina
tion.offsetHeight / 2; | 33 var y = destination.offsetParent.offsetTop + destination.offsetTop + destina
tion.offsetHeight / 2; |
34 eventSender.mouseMoveTo(x, y); | 34 eventSender.mouseMoveTo(x, y); |
35 contextMenuElements = eventSender.contextClick(); | 35 contextMenuElements = eventSender.contextClick(); |
36 // Esc key to hide the context menu. | 36 // Esc key to hide the context menu. |
37 eventSender.keyDown(String.fromCharCode(0x001B), null); | 37 eventSender.keyDown("escape", null); |
38 | 38 |
39 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0); | 39 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0); |
40 shouldBeEqualToString("spellingMarkerRange.toString()", "upper case"); | 40 shouldBeEqualToString("spellingMarkerRange.toString()", "upper case"); |
41 shouldBeEqualToString("window.getSelection().toString()", "upper case"); | 41 shouldBeEqualToString("window.getSelection().toString()", "upper case"); |
42 shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]",
"uppercase"); | 42 shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]",
"uppercase"); |
43 }); | 43 }); |
44 | 44 |
45 </script> | 45 </script> |
46 </body> | 46 </body> |
47 </html> | 47 </html> |
OLD | NEW |