Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Side by Side Diff: LayoutTests/fast/forms/file/recover-file-input-in-unposted-form.html

Issue 148983008: Reduce test code duplication in fast/forms/file (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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>
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/file/input-file-write-files.html ('k') | LayoutTests/fast/forms/file/resources/file-drag-common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698