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

Unified Diff: net/cookies/cookie_store_unittest.h

Issue 1746303002: Replace std::string::find with base::StartsWith when comparing cookie paths. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove new test case Created 4 years, 10 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/cookies/cookie_monster.cc ('K') | « net/cookies/cookie_monster_unittest.cc ('k') | 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 141cce564c864bac0e0fac24c53ccbb2ea1a9fb7..7198f5084a21240fa468c9751ee6ec0ae45401c7 100644
--- a/net/cookies/cookie_store_unittest.h
+++ b/net/cookies/cookie_store_unittest.h
@@ -1300,6 +1300,34 @@ TYPED_TEST_P(CookieStoreTest, GetAllCookiesAsync) {
ASSERT_TRUE(++it == cookies.end());
}
+TYPED_TEST_P(CookieStoreTest, DeleteCookieAsync) {
+ scoped_refptr<CookieStore> cs(this->GetCookieStore());
+
+ EXPECT_TRUE(
+ this->SetCookie(cs.get(), this->http_www_google_.url(), "A=A1; path=/"));
+ EXPECT_TRUE(this->SetCookie(cs.get(), this->http_www_google_.url(),
+ "A=A2; path=/foo"));
+ EXPECT_TRUE(this->SetCookie(cs.get(), this->http_www_google_.url(),
+ "A=A3; path=/bar"));
mmenke 2016/03/02 20:02:01 I tried adding a "path=/fo" test, but iOS apparent
Mike West 2016/03/03 18:56:28 What? What does iOS do?
mmenke 2016/03/03 19:02:58 iOS seems to return (Or at least delete, think ret
+ EXPECT_TRUE(
+ this->SetCookie(cs.get(), this->http_www_google_.url(), "B=B1; path=/"));
+ EXPECT_TRUE(this->SetCookie(cs.get(), this->http_www_google_.url(),
+ "B=B2; path=/foo"));
+ EXPECT_TRUE(this->SetCookie(cs.get(), this->http_www_google_.url(),
+ "B=B3; path=/bar"));
+
+ this->DeleteCookie(cs.get(), this->http_www_google_.AppendPath("foo/bar"),
+ "A");
+
+ CookieList cookies = this->GetAllCookies(cs.get());
+ size_t expected_size = 4;
+ EXPECT_EQ(expected_size, cookies.size());
+ for (const auto& cookie : cookies) {
+ EXPECT_NE("A1", cookie.Value());
+ EXPECT_NE("A2", cookie.Value());
+ }
+}
+
TYPED_TEST_P(CookieStoreTest, DeleteCanonicalCookieAsync) {
scoped_refptr<CookieStore> cs(this->GetCookieStore());
@@ -1394,6 +1422,7 @@ REGISTER_TYPED_TEST_CASE_P(CookieStoreTest,
OverwritePersistentCookie,
CookieOrdering,
GetAllCookiesAsync,
+ DeleteCookieAsync,
DeleteCanonicalCookieAsync,
DeleteSessionCookie);
« net/cookies/cookie_monster.cc ('K') | « net/cookies/cookie_monster_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698