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

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: Fix compile on Windows. 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
« no previous file with comments | « 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..c4cffcd933031b1bb8af218ccfa513b31ffc3821 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 blacklisting "\xd83d\xdd12" did not inadvertently blacklist
+ // all strings with the surrogate '\xdd12'.
+ {"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]
+ << "\"";
}
}
}
« no previous file with comments | « net/base/net_util_icu.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698