Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / focus-crash.html
blob07bcd2d912315086a9ef84e559e32f26fd62b956
1 <html><head>
2 <title>Focus crash</title>
3 </head>
4 <body onload="load()">
5 To run this test manually, click the "Crash me" button.
6 <div id='container'>
7 <iframe id='testframe' style="width: 100%; height:200px;" src="../resources/iframebody.html"></iframe>
8 </div>
9 <input id='testbutton' type="button" value="Crash me" onclick="crash()">
10 <ul id="console"></ul>
11 <script>
13 function load()
15 document.getElementById('testframe').contentWindow.document.body.focus();
16 if (window.testRunner)
17 testRunner.dumpAsText();
19 if (eventSender) {
20 var button = document.getElementById('testbutton');
21 eventSender.mouseMoveTo(button.offsetLeft + 10, button.offsetTop + 5)
22 eventSender.mouseDown();
23 eventSender.mouseUp();
27 function crash()
29 var focuselem = document.getElementById('testframe').contentWindow;
30 var elem = document.getElementById('container');
31 elem.style.display = 'none';
32 focuselem.focus();
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>