OLD | NEW |
1 <html> | 1 <html> |
2 <body onload="loaded()"> | 2 <body onload="loaded()"> |
3 <p>This test checks that an exception thrown when getting the | 3 <p>This test checks that an exception thrown when getting the |
4 handleEvent property of an event listener does not crash.</p> | 4 handleEvent property of an event listener does not crash.</p> |
5 <hr> | 5 <hr> |
6 <script> | 6 <script> |
7 if (window.testRunner) | 7 if (window.testRunner) |
8 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
9 | 9 |
10 function loaded() { | 10 function loaded() { |
11 var o = {}; | 11 var o = {}; |
12 o.__defineGetter__("handleEvent", function() { throw 42; }); | 12 o.__defineGetter__("handleEvent", function() { throw 42; }); |
13 var div = document.getElementById("div"); | 13 var div = document.getElementById("div"); |
14 div.onkeydown = o; | 14 div.addEventListener('keydown', o); |
15 var event = document.createEvent("KeyboardEvent"); | 15 var event = document.createEvent("KeyboardEvent"); |
16 event.initKeyboardEvent("keydown", true, true, null, "Enter", ""); | 16 event.initKeyboardEvent("keydown", true, true, null, "Enter", ""); |
17 div.dispatchEvent(event); | 17 div.dispatchEvent(event); |
18 } | 18 } |
19 </script> | 19 </script> |
20 <div id="div">PASS: You didn't crash.</div> | 20 <div id="div">PASS: You didn't crash.</div> |
21 </body> | 21 </body> |
22 </html> | 22 </html> |
OLD | NEW |