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