OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../../resources/js-test.js"></script> | 3 <script src="../../../resources/js-test.js"></script> |
| 4 <script src="resources/file-drag-common.js"></script> |
4 </head> | 5 </head> |
5 <body onload="test()"> | 6 <body onload="test()"> |
6 <form id="form" method="post" enctype="multipart/form-data"> | 7 <form id="form" method="post" enctype="multipart/form-data"> |
7 <input id="text-input" type="text" name="posted-text"> | 8 <input id="text-input" type="text" name="posted-text"> |
8 <input id="file-input" type="file" name="posted-file"> | 9 <input id="file-input" type="file" name="posted-file"> |
9 <input id="multiple-file-input" type="file" multiple="multiple" name="posted-fil
es"> | 10 <input id="multiple-file-input" type="file" multiple="multiple" name="posted-fil
es"> |
10 </form> | 11 </form> |
11 <div id="manual-instructions"> | 12 <div id="manual-instructions"> |
12 To run this test manually: | 13 To run this test manually: |
13 <ul> | 14 <ul> |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 if (filesRead == 3) { | 78 if (filesRead == 3) { |
78 finishJSTest(); | 79 finishJSTest(); |
79 } | 80 } |
80 } | 81 } |
81 | 82 |
82 function expectFileContents(file, contents) { | 83 function expectFileContents(file, contents) { |
83 var reader = new FileReader(); | 84 var reader = new FileReader(); |
84 reader.readAsText(file, "UTF-8"); | 85 reader.readAsText(file, "UTF-8"); |
85 reader.onload = checkFileContents.bind(undefined, contents); | 86 reader.onload = checkFileContents.bind(undefined, contents); |
86 } | 87 } |
87 | |
88 function moveMouseToCenterOfElement(element) { | |
89 var centerX = element.offsetLeft + element.offsetWidth / 2; | |
90 var centerY = element.offsetTop + element.offsetHeight / 2; | |
91 eventSender.mouseMoveTo(centerX, centerY); | |
92 } | |
93 | |
94 function dragFilesOntoInput(input, files) { | |
95 eventSender.beginDragWithFiles(files); | |
96 moveMouseToCenterOfElement(input); | |
97 eventSender.mouseUp(); | |
98 } | |
99 </script> | 88 </script> |
100 </body> | 89 </body> |
101 </html> | 90 </html> |
OLD | NEW |