| 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 21 matching lines...) Expand all Loading... |
| 32 eventSender.mouseUp(); | 32 eventSender.mouseUp(); |
| 33 | 33 |
| 34 shouldBeEqualToString("window.getSelection().toString()", "wellcome_"); | 34 shouldBeEqualToString("window.getSelection().toString()", "wellcome_"); |
| 35 | 35 |
| 36 // Context click on "wellcome_" to show the context menu. | 36 // Context click on "wellcome_" to show the context menu. |
| 37 x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40; | 37 x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40; |
| 38 y = destination.offsetParent.offsetTop + destination.offsetTop + destination
.offsetHeight / 2; | 38 y = destination.offsetParent.offsetTop + destination.offsetTop + destination
.offsetHeight / 2; |
| 39 eventSender.mouseMoveTo(x, y); | 39 eventSender.mouseMoveTo(x, y); |
| 40 contextMenuElements = eventSender.contextClick(); | 40 contextMenuElements = eventSender.contextClick(); |
| 41 // Esc key to hide the context menu. | 41 // Esc key to hide the context menu. |
| 42 eventSender.keyDown(String.fromCharCode(0x001B), null); | 42 eventSender.keyDown("escape", null); |
| 43 | 43 |
| 44 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0); | 44 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0); |
| 45 shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome"); | 45 shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome"); |
| 46 shouldBeEqualToString("window.getSelection().toString()", "wellcome_"); | 46 shouldBeEqualToString("window.getSelection().toString()", "wellcome_"); |
| 47 shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]",
"welcome"); | 47 shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]",
"welcome"); |
| 48 | 48 |
| 49 window.getSelection().removeAllRanges(); | 49 window.getSelection().removeAllRanges(); |
| 50 shouldBeEqualToString("window.getSelection().toString()", ""); | 50 shouldBeEqualToString("window.getSelection().toString()", ""); |
| 51 | 51 |
| 52 // Double-click the misspelled word with the trailing whitespace. | 52 // Double-click the misspelled word with the trailing whitespace. |
| 53 internals.settings.setSmartInsertDeleteEnabled(false); | 53 internals.settings.setSmartInsertDeleteEnabled(false); |
| 54 internals.settings.setSelectTrailingWhitespaceEnabled(true); | 54 internals.settings.setSelectTrailingWhitespaceEnabled(true); |
| 55 var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40; | 55 var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40; |
| 56 var y = destination.offsetParent.offsetTop + destination.offsetTop + destina
tion.offsetHeight / 2; | 56 var y = destination.offsetParent.offsetTop + destination.offsetTop + destina
tion.offsetHeight / 2; |
| 57 eventSender.mouseMoveTo(x, y); | 57 eventSender.mouseMoveTo(x, y); |
| 58 eventSender.mouseDown(); | 58 eventSender.mouseDown(); |
| 59 eventSender.mouseUp(); | 59 eventSender.mouseUp(); |
| 60 eventSender.mouseDown(); | 60 eventSender.mouseDown(); |
| 61 eventSender.mouseUp(); | 61 eventSender.mouseUp(); |
| 62 | 62 |
| 63 shouldBeEqualToString("window.getSelection().toString()", "wellcome_ "); | 63 shouldBeEqualToString("window.getSelection().toString()", "wellcome_ "); |
| 64 | 64 |
| 65 // Context click on "wellcome_ " to show the context menu. | 65 // Context click on "wellcome_ " to show the context menu. |
| 66 x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40; | 66 x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40; |
| 67 y = destination.offsetParent.offsetTop + destination.offsetTop + destination
.offsetHeight / 2; | 67 y = destination.offsetParent.offsetTop + destination.offsetTop + destination
.offsetHeight / 2; |
| 68 eventSender.mouseMoveTo(x, y); | 68 eventSender.mouseMoveTo(x, y); |
| 69 contextMenuElements = eventSender.contextClick(); | 69 contextMenuElements = eventSender.contextClick(); |
| 70 // Esc key to hide the context menu. | 70 // Esc key to hide the context menu. |
| 71 eventSender.keyDown(String.fromCharCode(0x001B), null); | 71 eventSender.keyDown("escape", null); |
| 72 | 72 |
| 73 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0); | 73 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0); |
| 74 shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome"); | 74 shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome"); |
| 75 shouldBeEqualToString("window.getSelection().toString()", "wellcome_ "); | 75 shouldBeEqualToString("window.getSelection().toString()", "wellcome_ "); |
| 76 shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]",
"welcome"); | 76 shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]",
"welcome"); |
| 77 }); | 77 }); |
| 78 | 78 |
| 79 </script> | 79 </script> |
| 80 </body> | 80 </body> |
| 81 </html> | 81 </html> |
| OLD | NEW |