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

Unified Diff: net/cookies/cookie_util_unittest.cc

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 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/cookies/cookie_util.cc ('k') | net/data/ssl/certificates/10_year_validity.pem » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_util_unittest.cc
diff --git a/net/cookies/cookie_util_unittest.cc b/net/cookies/cookie_util_unittest.cc
index fc2763146c9f7287261562ef3e17ffb642764ac1..392faf122c1caef7a8ca0aa285e55f1fa4224130 100644
--- a/net/cookies/cookie_util_unittest.cc
+++ b/net/cookies/cookie_util_unittest.cc
@@ -43,8 +43,6 @@ void CheckSerialize(
EXPECT_EQ(str_expected, net::cookie_util::SerializeRequestCookieLine(prc));
}
-} // namespace
-
TEST(CookieUtilTest, TestDomainIsHostOnly) {
const struct {
const char* str;
@@ -194,3 +192,20 @@ TEST(CookieUtilTest, TestRequestCookieParsing) {
CheckSerialize(tests[i].parsed, tests[i].str);
}
}
+
+TEST(CookieUtilTest, TestGetEffectiveDomain) {
+ // Note: registry_controlled_domains::GetDomainAndRegistry is tested in its
+ // own unittests.
+ EXPECT_EQ("example.com",
+ net::cookie_util::GetEffectiveDomain("http", "www.example.com"));
+ EXPECT_EQ("example.com",
+ net::cookie_util::GetEffectiveDomain("https", "www.example.com"));
+ EXPECT_EQ("example.com",
+ net::cookie_util::GetEffectiveDomain("ws", "www.example.com"));
+ EXPECT_EQ("example.com",
+ net::cookie_util::GetEffectiveDomain("wss", "www.example.com"));
+ EXPECT_EQ("www.example.com",
+ net::cookie_util::GetEffectiveDomain("ftp", "www.example.com"));
+}
+
+} // namespace
« no previous file with comments | « net/cookies/cookie_util.cc ('k') | net/data/ssl/certificates/10_year_validity.pem » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698