Skip to content

Commit

Permalink
Bug 1459572 [wpt PR 10865] - HTML: FormData serialization of <input t…
Browse files Browse the repository at this point in the history
…ype=file> without selection, a=testonly

Automatic update from web-platform-testsHTML: FormData representation of <input type=file> without selection

For whatwg/html#3658.
--

wpt-commits: 11f912ed1d8c8da3cb23f8e77444c4bc03c18e01
wpt-pr: 10865
  • Loading branch information
annevk authored and moz-wptsync-bot committed May 14, 2018
1 parent 2a5f142 commit b90bdf9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions testing/web-platform/meta/MANIFEST.json
Expand Up @@ -338986,6 +338986,12 @@
{}
]
],
"html/semantics/forms/form-submission-0/form-data-set-empty-file.window.js": [
[
"/html/semantics/forms/form-submission-0/form-data-set-empty-file.window.html",
{}
]
],
"html/semantics/forms/form-submission-0/form-data-set-usv.html": [
[
"/html/semantics/forms/form-submission-0/form-data-set-usv.html",
Expand Down Expand Up @@ -576395,6 +576401,10 @@
"5cb7e225df89561a1137933615b93c9912444006",
"support"
],
"html/semantics/forms/form-submission-0/form-data-set-empty-file.window.js": [
"727543085a822c9976f443b2e5adbf9708aecec2",
"testharness"
],
"html/semantics/forms/form-submission-0/form-data-set-usv-form.html": [
"82386590b55a9028e47d16d6a8c67cd0e44e919e",
"support"
Expand Down
@@ -0,0 +1,14 @@
promise_test(() => {
const form = document.body.appendChild(document.createElement("form")),
input = form.appendChild(document.createElement("input"));
input.type = "file";
input.name = "hi";
const fd = new FormData(form),
value = fd.get(input.name);
assert_true(value instanceof File, "value is a File");
assert_equals(value.name, "", "name");
assert_equals(value.type, "application/octet-stream", "type");
return new Response(value).text().then(body => {
assert_equals(body, "", "body");
});
}, "Empty <input type=file> is still serialized");

0 comments on commit b90bdf9

Please sign in to comment.