Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1459572 [wpt PR 10865] - HTML: FormData serialization of <input t…
…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
1 parent
2a5f142
commit b90bdf9
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...-platform/tests/html/semantics/forms/form-submission-0/form-data-set-empty-file.window.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |