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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/files/blob-reading-from-form-file.html

Issue 2710033003: Add unknown file size handling in ComplexFormDataBytesConsumer (Closed)
Patch Set: fix Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/filesystem/form-reading-from-file.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <form id="form">
2 <input id="file" multiple type="file" name="file">
3 </form>
4
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
7 <script type="text/javascript">
8
9 promise_test((t) => {
10 eventSender.beginDragWithFiles(
11 ['resources/UTF8.txt', 'resources/UTF8-2.txt']);
12 eventSender.mouseMoveTo(10, 10);
13 eventSender.mouseUp();
14
15 var form = document.getElementById('form');
16 var formData = new FormData(form);
17 var request = new Request('/', {
18 method: 'POST',
19 body: formData
20 });
21 return request.text().then(text => {
22 assert_true(text.search('WebKitFormBoundary') > 0,
23 'the boundary is contained');
24 assert_true(text.search('Hello') > 0, 'UTF8.txt is contained');
25 assert_true(text.search('Wonderful') > 0, 'UTF8-2.txt is contained');
26 });
27 }, "Reading a text from form files.");
28
29
30 promise_test((t) => {
31 eventSender.beginDragWithFiles(['resources/UTF8.txt']);
32 eventSender.mouseMoveTo(10, 10);
33 eventSender.mouseUp();
34
35 var file = document.getElementById('file');
36 var formData = new FormData();
37 formData.append('file', file.files[0]);
38 assert_equals(file.files[0].size, 5, 'file size');
39 var request = new Request('/', {
40 method: 'POST',
41 body: formData
42 });
43 return request.text().then(text => {
44 assert_true(text.search('WebKitFormBoundary') > 0,
45 'the boundary is contained');
46 assert_true(text.search('Hello') > 0, 'UTF8.txt is contained');
47 assert_true(text.search('Wonderful') < 0, 'UTF8-2.txt is not contained');
48 });
49 }, "Reading a text from a generated form data.");
50
51 </script>
52
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/filesystem/form-reading-from-file.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698