| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body> | 3 <body> |
| 4 <form method="GET" action="get-file-upload.html" enctype="application/x-www-form
-urlencoded"> | 4 <form method="GET" action="get-file-upload.html" enctype="application/x-www-form
-urlencoded"> |
| 5 <input type="file" name="file" id="file"> | 5 <input type="file" name="file" id="file"> |
| 6 <input type="hidden" name="submitted" value="true"> | 6 <input type="hidden" name="submitted" value="true"> |
| 7 </form> | 7 </form> |
| 8 <pre id='console'></pre> | 8 <pre id='console'></pre> |
| 9 | 9 |
| 10 <script> | 10 <script> |
| 11 function log(message) | 11 function log(message) |
| 12 { | 12 { |
| 13 document.getElementById('console').appendChild(document.createTextNode(messa
ge + "\n")); | 13 document.getElementById('console').appendChild(document.createTextNode(messa
ge + "\n")); |
| 14 } | 14 } |
| 15 | 15 |
| 16 function startOrVerify() | 16 function startOrVerify() |
| 17 { | 17 { |
| 18 var query = window.location.search; | 18 var query = window.location.search; |
| 19 if (query.indexOf('submitted=true') != -1) { | 19 if (query.indexOf('submitted=true') != -1) { |
| 20 // Verify the result | 20 // Verify the result |
| 21 if (query.indexOf('file=') != -1) | 21 if (query.indexOf('file=') != -1) |
| 22 log('PASS: ' + query); | 22 log('PASS: ' + query); |
| 23 else | 23 else |
| 24 log('FAIL: ' + query); | 24 log('FAIL: ' + query); |
| 25 testRunner.notifyDone(); | 25 testRunner.notifyDone(); |
| 26 } else { | 26 } else { |
| 27 // Mouse events only work after an initial layout | |
| 28 document.body.offsetLeft; | |
| 29 // Start the test | 27 // Start the test |
| 30 eventSender.beginDragWithFiles(['get-file-upload.html']); | 28 eventSender.beginDragWithFiles(['get-file-upload.html']); |
| 31 eventSender.mouseMoveTo(10, 10); | 29 eventSender.mouseMoveTo(10, 10); |
| 32 eventSender.mouseUp(); | 30 eventSender.mouseUp(); |
| 33 document.forms[0].submit(); | 31 document.forms[0].submit(); |
| 34 } | 32 } |
| 35 } | 33 } |
| 36 | 34 |
| 37 if (window.eventSender) { | 35 if (window.eventSender) { |
| 38 testRunner.dumpAsText(); | 36 testRunner.dumpAsText(); |
| 39 testRunner.waitUntilDone(); | 37 testRunner.waitUntilDone(); |
| 40 window.onload = startOrVerify; | 38 window.onload = startOrVerify; |
| 41 } | 39 } |
| 42 </script> | 40 </script> |
| 43 </body> | 41 </body> |
| 44 </html> | 42 </html> |
| OLD | NEW |