OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <form> | 4 <form> |
5 <input type="file" name="file" multiple id="file"> | 5 <input type="file" name="file" multiple id="file"> |
6 </form> | 6 </form> |
7 <p>The file upload control above should have text '2 files,' not a filename.</p> | 7 <p>The file upload control above should have text '2 files,' not a filename.</p> |
8 | 8 |
9 <script> | 9 <script> |
10 function startTest() | 10 function startTest() |
11 { | 11 { |
12 var input = document.getElementById('file'); | 12 var input = document.getElementById('file'); |
13 | 13 |
| 14 // Mouse events only work after an initial layout |
| 15 document.body.offsetLeft; |
| 16 |
14 // Drop 2 files to the control. | 17 // Drop 2 files to the control. |
15 eventSender.beginDragWithFiles(['input-file-re-render.html', 'script-tests/T
EMPLATE.html']); | 18 eventSender.beginDragWithFiles(['input-file-re-render.html', 'script-tests/T
EMPLATE.html']); |
16 eventSender.mouseMoveTo(10, 10); | 19 eventSender.mouseMoveTo(10, 10); |
17 eventSender.mouseUp(); | 20 eventSender.mouseUp(); |
18 | 21 |
19 // Delete the renderer. | 22 // Delete the renderer. |
20 input.style.display = 'none'; | 23 input.style.display = 'none'; |
21 input.offsetWidth; // Force to do layout | 24 input.offsetWidth; // Force to do layout |
22 | 25 |
23 // Attach a renderer again. | 26 // Attach a renderer again. |
24 input.style.display = 'inline-block'; | 27 input.style.display = 'inline-block'; |
25 | 28 |
26 testRunner.notifyDone(); | 29 testRunner.notifyDone(); |
27 } | 30 } |
28 | 31 |
29 if (window.eventSender) { | 32 if (window.eventSender) { |
30 window.onload = startTest; | 33 window.onload = startTest; |
31 testRunner.waitUntilDone(); | 34 testRunner.waitUntilDone(); |
32 } | 35 } |
33 </script> | 36 </script> |
34 </body> | 37 </body> |
35 </html> | 38 </html> |
OLD | NEW |