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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/url/script-tests/mailto.js

Issue 2820373002: Reland of 'Improve canonicalization of mailto url path components' (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/url/mailto-expected.txt ('k') | url/url_canon_mailtourl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 description("Tests mailto: URL canonicalization"); 1 description("Tests mailto: URL canonicalization");
2 2
3 cases = [ 3 cases = [
4 ["addr1", "addr1"], 4 ["addr1", "addr1"],
5 ["addr1@foo.com", "addr1@foo.com"], 5 ["addr1@foo.com", "addr1@foo.com"],
6 6
7 // Trailing whitespace is stripped. 7 // Trailing whitespace is stripped.
8 ["addr1 \t ", "addr1"], 8 ["addr1 \t ", "addr1"],
9 ["addr1?to=jon", "addr1?to=jon"], 9 ["addr1?to=jon", "addr1?to=jon"],
10 ["addr1,addr2", "addr1,addr2"], 10 ["addr1,addr2", "addr1,addr2"],
11 ["addr1, addr2", "addr1, addr2"], 11 ["addr1, addr2", "addr1,%20addr2"],
12 ['addr1,"addr2"', "addr1,%22addr2%22"],
12 ["addr1%2caddr2", "addr1%2caddr2"], 13 ["addr1%2caddr2", "addr1%2caddr2"],
13 14
14 // U+10300 input as UTF-16 surrogate pair, expected as escaped UTF-8 15 // U+10300 input as UTF-16 surrogate pair, expected as escaped UTF-8
15 ["\uD800\uDF00", "%F0%90%8C%80"], 16 ["\uD800\uDF00", "%F0%90%8C%80"],
16 ["addr1?", "addr1?"], 17 ["addr1?", "addr1?"],
17 18
18 // Null character should be escaped to %00 19 // Null character should be escaped to %00
19 // Not sure how to test null characters in JavaScript. They appear to get 20 // Not sure how to test null characters in JavaScript. They appear to get
20 // stripped out. 21 // stripped out.
21 // ["addr1\\0addr2?foo", "addr1%00addr2?foo"], 22 // ["addr1\\0addr2?foo", "addr1%00addr2?foo"],
22 ]; 23 ];
23 24
24 for (var i = 0; i < cases.length; ++i) { 25 for (var i = 0; i < cases.length; ++i) {
25 shouldBe("canonicalize('mailto:" + cases[i][0] + "')", 26 shouldBe("canonicalize('mailto:" + cases[i][0] + "')",
26 "'mailto:" + cases[i][1] + "'"); 27 "'mailto:" + cases[i][1] + "'");
27 } 28 }
28 // Invalid -- UTF-8 encoded surrogate value. 29 // Invalid -- UTF-8 encoded surrogate value.
29 shouldBeFalse("canonicalize('mailto:\xed\xa0\x80') == 'mailto:%EF%BF%BD'"); 30 shouldBeFalse("canonicalize('mailto:\xed\xa0\x80') == 'mailto:%EF%BF%BD'");
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/url/mailto-expected.txt ('k') | url/url_canon_mailtourl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698