| 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 11 matching lines...) Expand all Loading... |
| 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> |
| OLD | NEW |