https://github.com/web-platform-tests/wpt
Raw File
Tip revision: dc95d6e03b834edb8aef5b1c9f63187625197117 authored by Dong-hee Na on 10 October 2018, 08:14:18 UTC
Convert blocks.dat to html5lib_blocks.html
Tip revision: dc95d6e
form-data-set-empty-file.window.js
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");
back to top