Update web-platform-tests to revision e87f38097902e16348d4e17f4fe3bc2d0112bff1

This commit is contained in:
WPT Sync Bot 2018-03-17 21:12:30 -04:00
parent 2f8fa32e91
commit db5631a086
381 changed files with 11610 additions and 4232 deletions

View file

@ -0,0 +1,2 @@
def main(request, response):
return ([("Content-Type", "text/html")], "<script>parent.postMessage(\"" + str(request.POST.first("testinput")) + "\", '*');</script>")

View file

@ -0,0 +1,25 @@
<!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>