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

Unified Diff: net/cookies/cookie_store_unittest.h

Issue 2929923002: Fix cookie test that's been broken for a couple of years. (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_store_unittest.h
diff --git a/net/cookies/cookie_store_unittest.h b/net/cookies/cookie_store_unittest.h
index e8ac988290c4e75984e17bc212b8249bf74ae6ca..bc28a4f74ff99e59c3e122d2c905b5b9e2c042ec 100644
--- a/net/cookies/cookie_store_unittest.h
+++ b/net/cookies/cookie_store_unittest.h
@@ -587,12 +587,21 @@ TYPED_TEST_P(CookieStoreTest, DomainTest) {
// IE and Safari do not. Assert the expected policy here.
TYPED_TEST_P(CookieStoreTest, DomainWithTrailingDotTest) {
CookieStore* cs = this->GetCookieStore();
- EXPECT_FALSE(this->SetCookie(cs, this->http_www_google_.url(),
- "a=1; domain=.www.google.com."));
- EXPECT_FALSE(this->SetCookie(cs, this->http_www_google_.url(),
- "b=2; domain=.www.google.com.."));
- this->MatchCookieLines(std::string(),
- this->GetCookies(cs, this->http_www_google_.url()));
+ if (TypeParam::preserves_trailing_dots) {
+ EXPECT_FALSE(this->SetCookie(cs, this->http_www_google_.url(),
+ "a=1; domain=.www.google.izzle."));
+ EXPECT_FALSE(this->SetCookie(cs, this->http_www_google_.url(),
+ "b=2; domain=.www.google.izzle.."));
+ this->MatchCookieLines(std::string(),
+ this->GetCookies(cs, this->http_www_google_.url()));
+ } else {
+ EXPECT_TRUE(this->SetCookie(cs, this->http_www_google_.url(),
+ "a=1; domain=.www.google.izzle."));
+ EXPECT_FALSE(this->SetCookie(cs, this->http_www_google_.url(),
+ "b=2; domain=.www.google.izzle.."));
+ this->MatchCookieLines("a=1",
+ this->GetCookies(cs, this->http_www_google_.url()));
+ }
}
// Test that cookies can bet set on higher level domains.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698