summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/FileAPI/file/send-file-form-punctuation.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /testing/web-platform/tests/FileAPI/file/send-file-form-punctuation.html
parentInitial commit. (diff)
downloadthunderbird-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-punctuation.html')
-rw-r--r--testing/web-platform/tests/FileAPI/file/send-file-form-punctuation.html226
1 files changed, 226 insertions, 0 deletions
diff --git a/testing/web-platform/tests/FileAPI/file/send-file-form-punctuation.html b/testing/web-platform/tests/FileAPI/file/send-file-form-punctuation.html
new file mode 100644
index 0000000000..a6568e2e56
--- /dev/null
+++ b/testing/web-platform/tests/FileAPI/file/send-file-form-punctuation.html
@@ -0,0 +1,226 @@
+<!DOCTYPE html>
+<meta charset="utf-8" />
+<title>Upload files named using punctuation</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";
+
+ // 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-QUOTATION-MARK-[\x22].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName:
+ "file-for-upload-in-form-QUOTATION-MARK-[\x22].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: '"file-for-upload-in-form-double-quoted.txt"',
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: '"file-for-upload-in-form-double-quoted.txt"',
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-REVERSE-SOLIDUS-[\\].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName:
+ "file-for-upload-in-form-REVERSE-SOLIDUS-[\\].txt",
+ });
+
+ // The rest should be passed through unmodified:
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-EXCLAMATION-MARK-[!].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-EXCLAMATION-MARK-[!].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-DOLLAR-SIGN-[$].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-DOLLAR-SIGN-[$].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-PERCENT-SIGN-[%].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-PERCENT-SIGN-[%].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-AMPERSAND-[&].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-AMPERSAND-[&].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-APOSTROPHE-['].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-APOSTROPHE-['].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-LEFT-PARENTHESIS-[(].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-LEFT-PARENTHESIS-[(].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-RIGHT-PARENTHESIS-[)].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName:
+ "file-for-upload-in-form-RIGHT-PARENTHESIS-[)].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-ASTERISK-[*].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-ASTERISK-[*].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-PLUS-SIGN-[+].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-PLUS-SIGN-[+].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-COMMA-[,].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-COMMA-[,].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-FULL-STOP-[.].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-FULL-STOP-[.].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-SOLIDUS-[/].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-SOLIDUS-[/].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-COLON-[:].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-COLON-[:].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-SEMICOLON-[;].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-SEMICOLON-[;].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-EQUALS-SIGN-[=].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-EQUALS-SIGN-[=].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-QUESTION-MARK-[?].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-QUESTION-MARK-[?].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-CIRCUMFLEX-ACCENT-[^].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName:
+ "file-for-upload-in-form-CIRCUMFLEX-ACCENT-[^].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-LEFT-SQUARE-BRACKET-[[].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName:
+ "file-for-upload-in-form-LEFT-SQUARE-BRACKET-[[].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-RIGHT-SQUARE-BRACKET-[]].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName:
+ "file-for-upload-in-form-RIGHT-SQUARE-BRACKET-[]].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-LEFT-CURLY-BRACKET-[{].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName:
+ "file-for-upload-in-form-LEFT-CURLY-BRACKET-[{].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-VERTICAL-LINE-[|].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-VERTICAL-LINE-[|].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-RIGHT-CURLY-BRACKET-[}].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName:
+ "file-for-upload-in-form-RIGHT-CURLY-BRACKET-[}].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "file-for-upload-in-form-TILDE-[~].txt",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "file-for-upload-in-form-TILDE-[~].txt",
+ });
+
+ formPostFileUploadTest({
+ fileNameSource: "ASCII",
+ fileBaseName: "'file-for-upload-in-form-single-quoted.txt'",
+ formEncoding: "UTF-8",
+ expectedEncodedBaseName: "'file-for-upload-in-form-single-quoted.txt'",
+ });
+</script>