Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / spelling / spelling-changed-text.html
blob7c4b48e92bd8241f4217c4bc33a134bc66b1ba2e
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <script src="resources/util.js"></script>
6 </head>
7 <body>
8 <div id="container">
9 <div id="destination" contentEditable></div>
10 </div>
12 <script>
14 description("Spellcheck should not crash after the text has changed and results are served from cache."
15 + " To test manually, launch Chromium compiled with Address Sanitizer, enable 'Ask Google for Suggestions', type 'Spell wellcome. Is it broken?', delete the words 'Is it broken?', and context-click on the word 'wellcome'."
16 + " The test succeeds when the browser does not crash and shows suggestions in the context menu.");
18 initSpellTest("destination", "Spell wellcome. Is it broken?", function(textNode) {
19 // Select the text "Is it broken?".
20 var deleteRange = document.createRange();
21 deleteRange.setStart(textNode, 15);
22 deleteRange.setEnd(textNode, 29);
23 window.getSelection().removeAllRanges();
24 window.getSelection().addRange(deleteRange);
25 shouldBeEqualToString("window.getSelection().toString()", " Is it broken?");
26 // Del key to delete the text "Is it broken?".
27 eventSender.keyDown("delete", null);
29 // Context click to show the context menu.
30 var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 50;
31 var y = destination.offsetParent.offsetTop + destination.offsetTop + destination.offsetHeight / 2;
32 eventSender.mouseMoveTo(x, y);
33 contextMenuElements = eventSender.contextClick();
34 // Esc key to hide the context menu.
35 eventSender.keyDown("escape", null);
37 document.getElementById("destination").innerHTML = "";
38 });
40 </script>
41 </body>
42 </html>