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

Unified Diff: net/base/net_util_icu_unittest.cc

Issue 1158023004: Added characters that look like padlocks to net IDN character blacklist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Blacklist the other padlock symbols, and more/fixed tests. Created 5 years, 6 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
« net/base/net_util_icu.cc ('K') | « net/base/net_util_icu.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_util_icu_unittest.cc
diff --git a/net/base/net_util_icu_unittest.cc b/net/base/net_util_icu_unittest.cc
index 1b315c297c45edcb773d884c058208d3c9991aed..51690f6ffdf32179fe1cb6569b4a726203716319 100644
--- a/net/base/net_util_icu_unittest.cc
+++ b/net/base/net_util_icu_unittest.cc
@@ -331,6 +331,21 @@ const IDNTestCase idn_cases[] = {
false, false, false, false, false,
false, false, false, false, false,
}},
+ // Padlock icon spoof.
+ {"xn--google-hj64e", L"\U0001f512google.com",
+ {false, false, false, false, false,
+ false, false, false, false, false,
+ false, false, false, false, false,
+ false, false, false, false, false,
+ }},
+ // Ensure that by blacklisting "\xd83d\xdd12", we have not inadvertently
+ // blacklisted all strings with the surrogate '\xdd12'.
mmenke 2015/06/05 15:08:06 nit: Don't use "we" in comments
Matt Giuca 2015/06/09 04:10:35 Hmm, not a fan of this rule (it means rewriting ac
+ {"xn--fk9c.com", L"\U00010912.com",
+ {true, false, false, false, false,
+ false, false, false, false, false,
+ false, false, false, false, false,
+ false, false, false, false, false,
+ }},
#if 0
// These two cases are special. We need a separate test.
// U+3000 and U+3002 are normalized to ASCII space and dot.
@@ -422,7 +437,9 @@ TEST(NetUtilTest, IDNToUnicodeFast) {
WideToUTF16(idn_cases[i].unicode_output) :
ASCIIToUTF16(idn_cases[i].input));
AppendLanguagesToOutputs(kLanguages[j], &expected, &output);
- EXPECT_EQ(expected, output);
+ EXPECT_EQ(expected, output) << "input: \"" << idn_cases[i].input
+ << "\", languages: \"" << kLanguages[j]
+ << "\"";
}
}
}
@@ -438,7 +455,9 @@ TEST(NetUtilTest, IDNToUnicodeSlow) {
WideToUTF16(idn_cases[i].unicode_output) :
ASCIIToUTF16(idn_cases[i].input));
AppendLanguagesToOutputs(kLanguages[j], &expected, &output);
- EXPECT_EQ(expected, output);
+ EXPECT_EQ(expected, output) << "input: \"" << idn_cases[i].input
+ << "\", languages: \"" << kLanguages[j]
+ << "\"";
}
}
}
« net/base/net_util_icu.cc ('K') | « net/base/net_util_icu.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698