diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /testing/web-platform/tests/FileAPI/file/send-file-form-controls.html | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/FileAPI/file/send-file-form-controls.html')
-rw-r--r-- | testing/web-platform/tests/FileAPI/file/send-file-form-controls.html | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/testing/web-platform/tests/FileAPI/file/send-file-form-controls.html b/testing/web-platform/tests/FileAPI/file/send-file-form-controls.html new file mode 100644 index 0000000000..6347065bca --- /dev/null +++ b/testing/web-platform/tests/FileAPI/file/send-file-form-controls.html @@ -0,0 +1,113 @@ +<!DOCTYPE html> +<meta charset="utf-8" /> +<title>Upload files named using controls</title> +<link + rel="help" + href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart-form-data" +/> +<link + rel="help" + href="https://html.spec.whatwg.org/multipage/dnd.html#datatransferitemlist" +/> +<link rel="help" href="https://w3c.github.io/FileAPI/#file-constructor" /> +<link + rel="author" + title="Benjamin C. Wiley Sittler" + href="mailto:bsittler@chromium.org" +/> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="../support/send-file-form-helper.js"></script> +<script> + "use strict"; + + formPostFileUploadTest({ + fileNameSource: "ASCII", + fileBaseName: "file-for-upload-in-form-NUL-[\0].txt", + formEncoding: "UTF-8", + expectedEncodedBaseName: "file-for-upload-in-form-NUL-[\0].txt", + }); + + formPostFileUploadTest({ + fileNameSource: "ASCII", + fileBaseName: "file-for-upload-in-form-BS-[\b].txt", + formEncoding: "UTF-8", + expectedEncodedBaseName: "file-for-upload-in-form-BS-[\b].txt", + }); + + formPostFileUploadTest({ + fileNameSource: "ASCII", + fileBaseName: "file-for-upload-in-form-VT-[\v].txt", + formEncoding: "UTF-8", + expectedEncodedBaseName: "file-for-upload-in-form-VT-[\v].txt", + }); + + // These have characters that undergo processing in name=, + // filename=, and/or value; formPostFileUploadTest postprocesses + // expectedEncodedBaseName for these internally. + + formPostFileUploadTest({ + fileNameSource: "ASCII", + fileBaseName: "file-for-upload-in-form-LF-[\n].txt", + formEncoding: "UTF-8", + expectedEncodedBaseName: "file-for-upload-in-form-LF-[\n].txt", + }); + + formPostFileUploadTest({ + fileNameSource: "ASCII", + fileBaseName: "file-for-upload-in-form-LF-CR-[\n\r].txt", + formEncoding: "UTF-8", + expectedEncodedBaseName: "file-for-upload-in-form-LF-CR-[\n\r].txt", + }); + + formPostFileUploadTest({ + fileNameSource: "ASCII", + fileBaseName: "file-for-upload-in-form-CR-[\r].txt", + formEncoding: "UTF-8", + expectedEncodedBaseName: "file-for-upload-in-form-CR-[\r].txt", + }); + + formPostFileUploadTest({ + fileNameSource: "ASCII", + fileBaseName: "file-for-upload-in-form-CR-LF-[\r\n].txt", + formEncoding: "UTF-8", + expectedEncodedBaseName: "file-for-upload-in-form-CR-LF-[\r\n].txt", + }); + + formPostFileUploadTest({ + fileNameSource: "ASCII", + fileBaseName: "file-for-upload-in-form-HT-[\t].txt", + formEncoding: "UTF-8", + expectedEncodedBaseName: "file-for-upload-in-form-HT-[\t].txt", + }); + + formPostFileUploadTest({ + fileNameSource: "ASCII", + fileBaseName: "file-for-upload-in-form-FF-[\f].txt", + formEncoding: "UTF-8", + expectedEncodedBaseName: "file-for-upload-in-form-FF-[\f].txt", + }); + + formPostFileUploadTest({ + fileNameSource: "ASCII", + fileBaseName: "file-for-upload-in-form-DEL-[\x7F].txt", + formEncoding: "UTF-8", + expectedEncodedBaseName: "file-for-upload-in-form-DEL-[\x7F].txt", + }); + + // The rest should be passed through unmodified: + + formPostFileUploadTest({ + fileNameSource: "ASCII", + fileBaseName: "file-for-upload-in-form-ESC-[\x1B].txt", + formEncoding: "UTF-8", + expectedEncodedBaseName: "file-for-upload-in-form-ESC-[\x1B].txt", + }); + + formPostFileUploadTest({ + fileNameSource: "ASCII", + fileBaseName: "file-for-upload-in-form-SPACE-[ ].txt", + formEncoding: "UTF-8", + expectedEncodedBaseName: "file-for-upload-in-form-SPACE-[ ].txt", + }); +</script> |