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

Unified Diff: net/base/net_util_unittest.cc

Issue 339017: Loosen RFC 1738 compliance check to allow underscores where we already allowe... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 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.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_unittest.cc
===================================================================
--- net/base/net_util_unittest.cc (revision 29940)
+++ net/base/net_util_unittest.cc (working copy)
@@ -344,7 +344,7 @@
#endif
};
-struct RFC1738Case {
+struct CompliantHostCase {
const char* host;
bool expected_output;
};
@@ -815,8 +815,8 @@
}
}
-TEST(NetUtilTest, RFC1738) {
- const RFC1738Case rfc1738_cases[] = {
+TEST(NetUtilTest, CompliantHost) {
+ const CompliantHostCase compliant_host_cases[] = {
{"", false},
{"a", true},
{"-", false},
@@ -825,19 +825,20 @@
{"a.a", true},
{"9.a", true},
{"a.9", false},
+ {"_9a", false},
{"a.a9", true},
{"a.9a", false},
{"a+9a", false},
{"1-.a-b", false},
- {"1-2.a-b", true},
+ {"1-2.a_b", true},
{"a.b.c.d.e", true},
{"1.2.3.4.e", true},
{"a.b.c.d.5", false},
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(rfc1738_cases); ++i) {
- EXPECT_EQ(rfc1738_cases[i].expected_output,
- net::IsCanonicalizedHostRFC1738Compliant(rfc1738_cases[i].host));
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(compliant_host_cases); ++i) {
+ EXPECT_EQ(compliant_host_cases[i].expected_output,
+ net::IsCanonicalizedHostCompliant(compliant_host_cases[i].host));
}
}
« no previous file with comments | « net/base/net_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698