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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/filename-encoding-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Verify that attachment filenames are not normalized</title>
3 <script src="/js-test-resources/js-test.js"></script>
4 <script>
5 description(document.title);
6 var jsTestIsAsync = true;
7
8 var request = {
9 field: "attachment",
10 filename: decodeURIComponent("z%CC%87o%CC%81%C5%82c%CC%81.txt"),
11 type: "text/plain",
12 content: "hello world"
13 };
14 var file = new File([request.content], request.filename, {type: request.type});
15 shouldBe("file.name", "request.filename");
16
17 var data = new FormData();
18 data.append(request.field, file);
19
20 var xhr = new XMLHttpRequest();
21 var match, response;
22 xhr.open("POST", "resources/multipart-post-echo.php", true);
23 xhr.send(data);
24 xhr.onreadystatechange = function(e) {
25 if (xhr.readyState !== xhr.DONE)
26 return;
27 match = xhr.responseText.match(/^(.*)=(.*):(.*):(.*)$/);
28 response = {
29 field: match[1],
30 filename: match[2],
31 type: match[3],
32 content: match[4]
33 };
34
35 shouldBe("response.field", "request.field");
36 shouldBe("response.filename", "request.filename");
37 shouldBe("response.type", "request.type");
38 shouldBe("response.content", "request.content");
39 finishJSTest();
40 };
41 </script>
42 </body>
43 </html>
OLDNEW
« 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