| Index: LayoutTests/http/tests/xmlhttprequest/filename-encoding.html
|
| diff --git a/LayoutTests/http/tests/xmlhttprequest/filename-encoding.html b/LayoutTests/http/tests/xmlhttprequest/filename-encoding.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d1121827998fef8912ec6d3d6ffdf50d9733be06
|
| --- /dev/null
|
| +++ b/LayoutTests/http/tests/xmlhttprequest/filename-encoding.html
|
| @@ -0,0 +1,43 @@
|
| +<!DOCTYPE html>
|
| +<title>Verify that attachment filenames are not normalized</title>
|
| +<script src="/js-test-resources/js-test.js"></script>
|
| +<script>
|
| +description(document.title);
|
| +var jsTestIsAsync = true;
|
| +
|
| +var request = {
|
| + field: "attachment",
|
| + filename: decodeURIComponent("z%CC%87o%CC%81%C5%82c%CC%81.txt"),
|
| + type: "text/plain",
|
| + content: "hello world"
|
| +};
|
| +var file = new File([request.content], request.filename, {type: request.type});
|
| +shouldBe("file.name", "request.filename");
|
| +
|
| +var data = new FormData();
|
| +data.append(request.field, file);
|
| +
|
| +var xhr = new XMLHttpRequest();
|
| +var match, response;
|
| +xhr.open("POST", "resources/multipart-post-echo.php", true);
|
| +xhr.send(data);
|
| +xhr.onreadystatechange = function(e) {
|
| + if (xhr.readyState !== xhr.DONE)
|
| + return;
|
| + match = xhr.responseText.match(/^(.*)=(.*):(.*):(.*)$/);
|
| + response = {
|
| + field: match[1],
|
| + filename: match[2],
|
| + type: match[3],
|
| + content: match[4]
|
| + };
|
| +
|
| + shouldBe("response.field", "request.field");
|
| + shouldBe("response.filename", "request.filename");
|
| + shouldBe("response.type", "request.type");
|
| + shouldBe("response.content", "request.content");
|
| + finishJSTest();
|
| +};
|
| +</script>
|
| +</body>
|
| +</html>
|
|
|