OLD | NEW |
1 <style> | 1 <style> |
2 #scroller { | 2 #scroller { |
3 height: 1000px; | 3 height: 1000px; |
4 } | 4 } |
5 </style> | 5 </style> |
6 <script> | 6 <script> |
7 if (window.testRunner) | 7 if (window.testRunner) |
8 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
9 | 9 |
10 function moveMouseToCenterOfElement(element) | 10 function moveMouseToCenterOfElement(element) |
11 { | 11 { |
12 var centerX = element.offsetLeft + element.offsetWidth / 2; | 12 var centerX = element.offsetLeft + element.offsetWidth / 2; |
13 var centerY = element.offsetTop + element.offsetHeight / 2; | 13 var centerY = element.offsetTop + element.offsetHeight / 2; |
14 eventSender.mouseMoveTo(centerX, centerY); | 14 eventSender.mouseMoveTo(centerX, centerY); |
15 } | 15 } |
16 | 16 |
17 function run() | 17 function run() |
18 { | 18 { |
19 window.scrollBy(0, 1000); | 19 window.scrollBy(0, 1000); |
20 if (window.eventSender) { | 20 if (window.eventSender) { |
21 eventSender.beginDragWithFiles(["resources/abe.png"]); | 21 eventSender.beginDragWithFiles(["resources/drag-file-crash-pass.html
"]); |
22 var fileInput = document.getElementById('file'); | 22 var fileInput = document.getElementById('file'); |
23 moveMouseToCenterOfElement(fileInput); | 23 moveMouseToCenterOfElement(fileInput); |
24 eventSender.mouseUp(); | 24 eventSender.mouseUp(); |
25 } | 25 } |
26 } | 26 } |
27 </script> | 27 </script> |
28 <body onload="run()"> | 28 <body onload="run()"> |
29 <div id="scroller"></div> | 29 <div id="scroller"></div> |
30 <input type="file" id="file"> | 30 <input type="file" id="file"> |
31 This is a test for https://bugs.webkit.org/show_bug.cgi?id=29276. It passes if i
t does not crash. If not run from DRT, drag a file onto the file input. | 31 This is a test for https://bugs.webkit.org/show_bug.cgi?id=29276. It passes if i
t does not crash. If not run from DRT, drag a file onto the file input. |
32 </body> | 32 </body> |
OLD | NEW |