mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +01:00
Update web-platform-tests to revision 5349c6a6327372f856ecbe07d863d468a4236726
This commit is contained in:
parent
d17d5adb6d
commit
c5c7a1f47a
19 changed files with 427 additions and 39 deletions
|
@ -0,0 +1,2 @@
|
|||
def main(request, response):
|
||||
return "PASS" if request.POST["file_input"].file.read() == b"File to upload\n" else "FAIL"
|
|
@ -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>
|
|
@ -0,0 +1 @@
|
|||
File to upload
|
Loading…
Add table
Add a link
Reference in a new issue