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 trailing whitespace. | 52 // Double-click the misspelled word with 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 shouldBeEqualToString("window.getSelection().toString()", "wellcome "); | 62 shouldBeEqualToString("window.getSelection().toString()", "wellcome "); |
63 | 63 |
64 // Context click on "wellcome " to show the context menu. | 64 // Context click on "wellcome " to show the context menu. |
65 x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40; | 65 x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40; |
66 y = destination.offsetParent.offsetTop + destination.offsetTop + destination
.offsetHeight / 2; | 66 y = destination.offsetParent.offsetTop + destination.offsetTop + destination
.offsetHeight / 2; |
67 eventSender.mouseMoveTo(x, y); | 67 eventSender.mouseMoveTo(x, y); |
68 contextMenuElements = eventSender.contextClick(); | 68 contextMenuElements = eventSender.contextClick(); |
69 // Esc key to hide the context menu. | 69 // Esc key to hide the context menu. |
70 eventSender.keyDown(String.fromCharCode(0x001B), null); | 70 eventSender.keyDown("escape", null); |
71 | 71 |
72 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0); | 72 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0); |
73 shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome"); | 73 shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome"); |
74 shouldBeEqualToString("window.getSelection().toString()", "wellcome "); | 74 shouldBeEqualToString("window.getSelection().toString()", "wellcome "); |
75 shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]",
"welcome"); | 75 shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]",
"welcome"); |
76 }); | 76 }); |
77 | 77 |
78 </script> | 78 </script> |
79 </body> | 79 </body> |
80 </html> | 80 </html> |
OLD | NEW |