4 <script src="../../resources/js-test.js"></script>
5 <script src="resources/util.js"></script>
9 <div id="destination" contentEditable></div>
14 description("Spell check selects the misspelled word on context menu key. " +
15 "To test manually, type 'wellcome home.' place the cursor on 'wellcome', and press the context menu key. " +
16 "The test succeeds when 'wellcome' is selected after the context menu key.");
18 initSpellTest("destination", "wellcome home.", function(textNode) {
19 var behaviors = ["win", "mac"];
20 for (var i = 0; i < behaviors.length; i++) {
21 internals.settings.setEditingBehavior(behaviors[i]);
23 // Place cursor on "wellcome".
24 window.getSelection().removeAllRanges();
25 var range = document.createRange();
26 range.setStart(textNode, 2);
27 range.setEnd(textNode, 2);
28 window.getSelection().addRange(range);
30 // Context menu key to show the context menu.
31 eventSender.keyDown("menu");
33 // Esc to close the context menu.
34 eventSender.keyDown("escape");
36 shouldBeEqualToString("window.getSelection().toString()", "wellcome");