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 | |
17 // Drop 2 files to the control. | 14 // Drop 2 files to the control. |
18 eventSender.beginDragWithFiles(['input-file-re-render.html', 'script-tests/T
EMPLATE.html']); | 15 eventSender.beginDragWithFiles(['input-file-re-render.html', 'script-tests/T
EMPLATE.html']); |
19 eventSender.mouseMoveTo(10, 10); | 16 eventSender.mouseMoveTo(10, 10); |
20 eventSender.mouseUp(); | 17 eventSender.mouseUp(); |
21 | 18 |
22 // Delete the renderer. | 19 // Delete the renderer. |
23 input.style.display = 'none'; | 20 input.style.display = 'none'; |
24 input.offsetWidth; // Force to do layout | 21 input.offsetWidth; // Force to do layout |
25 | 22 |
26 // Attach a renderer again. | 23 // Attach a renderer again. |
27 input.style.display = 'inline-block'; | 24 input.style.display = 'inline-block'; |
28 | 25 |
29 testRunner.notifyDone(); | 26 testRunner.notifyDone(); |
30 } | 27 } |
31 | 28 |
32 if (window.eventSender) { | 29 if (window.eventSender) { |
33 window.onload = startTest; | 30 window.onload = startTest; |
34 testRunner.waitUntilDone(); | 31 testRunner.waitUntilDone(); |
35 } | 32 } |
36 </script> | 33 </script> |
37 </body> | 34 </body> |
38 </html> | 35 </html> |
OLD | NEW |