Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / undo-crash.html
blob881736bcc38e4094303919b71bfa50a0c2d3d5ba
1 <html><head>
2 <title>Undo crash</title>
3 </head>
4 <body onload="load()">
5 To run this test manually, type some text in the input field, then click the "Crash me" button.
6 <input id="testinput" type="text"></input>
7 <input id='testbutton' type="button" value="Crash me" onclick="crash()">
8 <ul id="console"></ul>
9 <script>
11 function load()
13 document.getElementById('testinput').focus();
14 if (window.testRunner)
15 testRunner.dumpAsText();
16 document.execCommand('InsertText', false, 'b');
17 document.execCommand('InsertText', false, 'l');
18 document.execCommand('InsertText', false, 'a');
19 document.execCommand('InsertText', false, 'h');
20 if (eventSender) {
21 var button = document.getElementById('testbutton');
22 eventSender.mouseMoveTo(button.offsetLeft + 10, button.offsetTop + 5)
23 eventSender.mouseDown();
24 eventSender.mouseUp();
28 function crash()
30 var elem = document.getElementById('testinput');
31 elem.style.display = 'none';
32 document.execCommand('undo');
33 log("SUCCEEDED");
36 function log(str) {
37 var li = document.createElement("li");
38 li.appendChild(document.createTextNode(str));
39 var console = document.getElementById("console");
40 console.appendChild(li);
42 </script>
43 </body>
44 </html>