summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authordroger@chromium.org <droger@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-30 18:33:14 +0000
committerdroger@chromium.org <droger@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-30 18:33:14 +0000
commite43ef38755efc86469da1dae13f770781a95ba29 (patch)
tree25e40050a8201b744d003155a92f3e522b60362f /net
parentdd4e28105bd9298e2e8cff25716cc710aff64f40 (diff)
downloadchromium_src-e43ef38755efc86469da1dae13f770781a95ba29.zip
chromium_src-e43ef38755efc86469da1dae13f770781a95ba29.tar.gz
chromium_src-e43ef38755efc86469da1dae13f770781a95ba29.tar.bz2
Unit test for CookieStore::DeleteSessionCookies
BUG=236364 Review URL: https://chromiumcodereview.appspot.com/14642004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197412 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/cookies/cookie_store_unittest.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/net/cookies/cookie_store_unittest.h b/net/cookies/cookie_store_unittest.h
index 0d2d7ed..f209ab7 100644
--- a/net/cookies/cookie_store_unittest.h
+++ b/net/cookies/cookie_store_unittest.h
@@ -891,6 +891,22 @@ TYPED_TEST_P(CookieStoreTest, CookieOrdering) {
this->GetCookies(cs, GURL("http://d.c.b.a.google.com/aa/bb/cc/dd")));
}
+TYPED_TEST_P(CookieStoreTest, DeleteSessionCookie) {
+ scoped_refptr<CookieStore> cs(this->GetCookieStore());
+ // Create a session cookie and a persistent cookie.
+ EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
+ std::string(kValidCookieLine)));
+ EXPECT_TRUE(this->SetCookie(cs, this->url_google_,
+ "C=D; path=/; domain=google.izzle;"
+ "expires=Mon, 18-Apr-22 22:50:13 GMT"));
+ this->MatchCookieLines("A=B; C=D",
+ this->GetCookies(cs, this->url_google_));
+ // Delete the session cookie.
+ this->DeleteSessionCookies(cs);
+ // Check that the session cookie has been deleted but not the persistent one.
+ EXPECT_EQ("C=D", this->GetCookies(cs, this->url_google_));
+}
+
REGISTER_TYPED_TEST_CASE_P(CookieStoreTest,
TypeTest,
DomainTest,
@@ -912,7 +928,8 @@ REGISTER_TYPED_TEST_CASE_P(CookieStoreTest,
TestSecure,
NetUtilCookieTest,
OverwritePersistentCookie,
- CookieOrdering);
+ CookieOrdering,
+ DeleteSessionCookie);
template<class CookieStoreTestTraits>
class MultiThreadedCookieStoreTest :