Update web-platform-tests to revision 5349c6a6327372f856ecbe07d863d468a4236726

This commit is contained in:
WPT Sync Bot 2018-12-08 20:32:47 -05:00
parent d17d5adb6d
commit c5c7a1f47a
19 changed files with 427 additions and 39 deletions

View file

@ -0,0 +1,2 @@
def main(request, response):
return "PASS" if request.POST["file_input"].file.read() == b"File to upload\n" else "FAIL"

View file

@ -0,0 +1,26 @@
<!doctype html>
<meta charset=utf8>
<title>File upload using testdriver</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<form id="form">
<input id="file_input" name="file_input" type="file">
</form>
<script>
let form = document.getElementById("form");
let input = document.getElementById("file_input");
test_driver
.send_keys(input, "{{fs_path(file_upload_data.txt)}}")
.then(() =>
fetch("file_upload.py",
{method: "POST",
body: new FormData(form)}))
.then(response => response.text())
.then(data => {
assert_equals(data, "PASS");
done();
})
.catch(() => assert_unreached("File upload failed"));
</script>

View file

@ -0,0 +1 @@
File to upload