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

Unified Diff: components/url_formatter/url_formatter_unittest.cc

Issue 2683793010: Block domain labels made of Cyrillic letters that look alike Latin (Closed)
Patch Set: go back to ps11 Created 3 years, 9 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 | « components/url_formatter/url_formatter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/url_formatter/url_formatter_unittest.cc
diff --git a/components/url_formatter/url_formatter_unittest.cc b/components/url_formatter/url_formatter_unittest.cc
index c0fe9509a6d4ac21a85ed744678e9468412c3155..5b2646ce09c7c6677e91396cfaeb8c3cb9f5bae8 100644
--- a/components/url_formatter/url_formatter_unittest.cc
+++ b/components/url_formatter/url_formatter_unittest.cc
@@ -32,6 +32,7 @@ struct IDNTestCase {
const bool unicode_allowed;
};
+// TODO(jshin): Replace L"..." with "..." in UTF-8 when it's easier to read.
const IDNTestCase idn_cases[] = {
// No IDN
{"www.google.com", L"www.google.com", true},
@@ -209,6 +210,35 @@ const IDNTestCase idn_cases[] = {
// U+30FB + Latin
{"xn--abc-os4b.jp", L"\x30fb" L"abc.jp", false},
+ // Cyrillic labels made of Latin-look-alike Cyrillic letters.
+ // ѕсоре.com with ѕсоре in Cyrillic
+ {"xn--e1argc3h.com", L"\x0455\x0441\x043e\x0440\x0435.com", false},
+ // ѕсоре123.com with ѕсоре in Cyrillic.
+ {"xn--123-qdd8bmf3n.com",
+ L"\x0455\x0441\x043e\x0440\x0435" L"123.com", false},
+ // ѕсоре-рау.com with ѕсоре and рау in Cyrillic.
+ {"xn----8sbn9akccw8m.com",
+ L"\x0455\x0441\x043e\x0440\x0435-\x0440\x0430\x0443.com", false},
+ // ѕсоре·рау.com with scope and pay in Cyrillic and U+00B7 between them.
+ {"xn--uba29ona9akccw8m.com",
+ L"\x0455\x0441\x043e\x0440\x0435\u00b7\x0440\x0430\x0443.com", false},
+
+ // The same as above three, but in IDN TLD.
+ {"xn--e1argc3h.xn--p1ai",
+ L"\x0455\x0441\x043e\x0440\x0435.\x0440\x0444", true},
+ {"xn--123-qdd8bmf3n.xn--p1ai",
+ L"\x0455\x0441\x043e\x0440\x0435" L"123.\x0440\x0444", true},
+ {"xn--uba29ona9akccw8m.xn--p1ai",
+ L"\x0455\x0441\x043e\x0440\x0435\u00b7\x0440\x0430\x0443.\x0440\x0444",
+ true},
+
+ // ѕсоре-рау.한국 with ѕсоре and рау in Cyrillic.
+ {"xn----8sbn9akccw8m.xn--3e0b707e",
+ L"\x0455\x0441\x043e\x0440\x0435-\x0440\x0430\x0443.\xd55c\xad6d", true},
+
+ // музей (museum in Russian) has characters without a Latin-look-alike.
+ {"xn--e1adhj9a.com", L"\x043c\x0443\x0437\x0435\x0439.com", true},
+
// Mixed digits: the first two will also fail mixed script test
// Latin + ASCII digit + Deva digit
{"xn--asc1deva-j0q.co.in", L"asc1deva\x0967.co.in", false},
« no previous file with comments | « components/url_formatter/url_formatter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698