https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 1ed5ba207f0fc2dd0de4fd34a5d3f9b696265e59 authored by Andreas Butler on 14 December 2018, 23:57:08 UTC
[WebLocks]: Modifying weblocks algos to be O(1)
Tip revision: 1ed5ba2
submit-file.sub.html
<!DOCTYPE html>
<meta charset="utf-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<iframe id=testframe name=testframe></iframe>
<form id=testform method=post action="//{{domains[www1]}}:{{location[port]}}/html/semantics/forms/form-submission-0/resources/file-submission.py" target=testframe enctype="multipart/form-data">
<input name=testinput id=testinput type=file>
</form>
<script>
async_test(t => {
  const dataTransfer = new DataTransfer();
  dataTransfer.items.add(new File(["foobar"], "name"));
  assert_equals(1, dataTransfer.files.length);

  testinput.files = dataTransfer.files;
  testform.submit();

  onmessage = e => {
    if (e.source !== testframe) return;
    assert_equals("FieldStorage('testinput', 'name', 'foobar')", e.data);
    t.done();
  };
}, 'Posting a File');
</script>
back to top