Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Unified Diff: LayoutTests/http/tests/xmlhttprequest/filename-encoding.html

Issue 1306073004: Don't NFC normalize filenames in form data (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/filename-encoding-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/filename-encoding-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698