Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / focus-change-crash2.html
blobd259e36fbc8ab7ffd177e3f417d2ed0c67b2f80e
1 <p>This tests a crash when changing focus deletes the node being focused. This test requires DRT.</p>
2 <div id='test'><input id='1' /><input id='2' /></div>
3 <script>
4 function runTest()
6 document.getElementById("1").addEventListener("keypress", function(e) {
7 document.getElementById("2").focus();
9 setTimeout(function() {
10 document.getElementById("test").innerHTML = "PASSED";
11 testRunner.notifyDone();
12 }, 0);
13 }, false);
15 document.getElementById("1").addEventListener("change", function(e) {
16 document.getElementById("test").innerHTML = "<input id='3' />";
17 window.GCController.collect();
18 document.getElementById("3").focus();
19 }, false);
21 document.getElementById("1").focus();
23 if (window.testRunner) {
24 testRunner.dumpAsText();
25 testRunner.waitUntilDone();
26 eventSender.keyDown("a")
30 runTest();
31 </script>