| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <script src="../../resources/js-test.js"></script> | 2 <script src="../../resources/js-test.js"></script> |
| 3 <script> | 3 <script> |
| 4 function getCenterFor(element) | 4 function getCenterFor(element) |
| 5 { | 5 { |
| 6 var rect = element.getBoundingClientRect(); | 6 var rect = element.getBoundingClientRect(); |
| 7 return { x : parseInt((rect.left + rect.right) / 2) , y : parseInt((rect.top +
rect.bottom) / 2)}; | 7 return { x : parseInt((rect.left + rect.right) / 2) , y : parseInt((rect.top +
rect.bottom) / 2)}; |
| 8 } | 8 } |
| 9 | 9 |
| 10 function runTest() | 10 function runTest() |
| 11 { | 11 { |
| 12 if (!window.testRunner) | 12 if (!window.testRunner) |
| 13 return; | 13 return; |
| 14 if (!window.eventSender) | 14 if (!window.eventSender) |
| 15 return; | 15 return; |
| 16 | 16 |
| 17 testRunner.dumpAsText(); | 17 testRunner.dumpAsText(); |
| 18 center = getCenterFor(document.getElementById("emptyselect")); | 18 center = getCenterFor(document.getElementById("emptyselect")); |
| 19 eventSender.mouseMoveTo(center.x, center.y); | 19 eventSender.mouseMoveTo(center.x, center.y); |
| 20 eventSender.mouseDown(); | 20 eventSender.mouseDown(); |
| 21 eventSender.mouseUp(); | 21 eventSender.mouseUp(); |
| 22 eventSender.keyDown("downArrow"); | 22 eventSender.keyDown("ArrowDown"); |
| 23 } | 23 } |
| 24 | 24 |
| 25 </script> | 25 </script> |
| 26 <style> | 26 <style> |
| 27 </style> | 27 </style> |
| 28 <body onload="runTest();"> | 28 <body onload="runTest();"> |
| 29 <select multiple id="emptyselect"></select> | 29 <select multiple id="emptyselect"></select> |
| 30 This should not crash | 30 This should not crash |
| 31 </body> | 31 </body> |
| 32 </html> | 32 </html> |
| 33 | 33 |
| OLD | NEW |