OLD | NEW |
1 <body onload="test()"> | 1 <body onload="test()"> |
2 <p>This test checks that spelling suggestions in the context menu are not show w
hen spellcheck="false". | 2 <p>This test checks that spelling suggestions in the context menu are not show w
hen spellcheck="false". |
3 To test manually, right click on the text in the input box.</p> | 3 To test manually, right click on the text in the input box.</p> |
4 <input id="input" spellcheck="false" /> | 4 <input id="input" spellcheck="false" /> |
5 <div id="result">FAIL: Did not run test</div> | 5 <div id="result">FAIL: Did not run test</div> |
6 </body> | 6 </body> |
7 <script> | 7 <script> |
8 function test() | 8 function test() |
9 { | 9 { |
10 if (window.testRunner) | 10 if (window.testRunner) { |
| 11 testRunner.setMockSpellCheckerEnabled(true); |
11 testRunner.dumpAsText(); | 12 testRunner.dumpAsText(); |
| 13 } |
12 | 14 |
13 var input = document.getElementById("input"); | 15 var input = document.getElementById("input"); |
14 input.focus(); | 16 input.focus(); |
15 document.execCommand("InsertText", false, 'wellcome'); | 17 document.execCommand("InsertText", false, 'wellcome'); |
16 document.execCommand("InsertText", false, ' '); | 18 document.execCommand("InsertText", false, ' '); |
17 | 19 |
18 var x = input.offsetParent.offsetLeft + input.offsetLeft + 4; | 20 var x = input.offsetParent.offsetLeft + input.offsetLeft + 4; |
19 var y = input.offsetParent.offsetTop + input.offsetTop + input.offsetHeight
/ 2; | 21 var y = input.offsetParent.offsetTop + input.offsetTop + input.offsetHeight
/ 2; |
20 | 22 |
21 if (!window.eventSender) | 23 if (!window.eventSender) |
22 return; | 24 return; |
23 | 25 |
24 eventSender.mouseMoveTo(x, y); | 26 eventSender.mouseMoveTo(x, y); |
25 var itemNamesWithoutSpellChecking = eventSender.contextClick(); | 27 var itemNamesWithoutSpellChecking = eventSender.contextClick(); |
26 | 28 |
27 input.setAttribute("spellcheck", "true"); | 29 input.setAttribute("spellcheck", "true"); |
28 eventSender.mouseMoveTo(x, y); | 30 eventSender.mouseMoveTo(x, y); |
29 | 31 |
30 var itemNamesWithSpellChecking = eventSender.contextClick(); | 32 var itemNamesWithSpellChecking = eventSender.contextClick(); |
31 | 33 |
32 if (itemNamesWithSpellChecking.length > itemNamesWithoutSpellChecking.length
) | 34 if (itemNamesWithSpellChecking.length > itemNamesWithoutSpellChecking.length
) |
33 document.getElementById('result').innerHTML = 'SUCCESS'; | 35 document.getElementById('result').innerHTML = 'SUCCESS'; |
34 else | 36 else |
35 document.getElementById('result').innerHTML = 'FAILURE: No spell checkin
g suggestions'; | 37 document.getElementById('result').innerHTML = 'FAILURE: No spell checkin
g suggestions'; |
36 } | 38 } |
37 </script> | 39 </script> |
OLD | NEW |