summaryrefslogtreecommitdiffstats
path: root/net/cookies/cookie_store_unittest.h
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-28 04:50:10 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-28 04:50:10 +0000
commitdedec0b98955617acca49f50627a6d18d1f7958e (patch)
tree159fa18bbe7e89598ce3d07025a43802c17e7050 /net/cookies/cookie_store_unittest.h
parentd2a2ca70268d37cc4958ece3ef02c7345a7dd54d (diff)
downloadchromium_src-dedec0b98955617acca49f50627a6d18d1f7958e.zip
chromium_src-dedec0b98955617acca49f50627a6d18d1f7958e.tar.gz
chromium_src-dedec0b98955617acca49f50627a6d18d1f7958e.tar.bz2
Remove the last traces of experimental support for MAC cookies
Support for MAC cookies was mostly removed in r126928. However, changes to the cookie store were not fully reverted, and new callsites were introduced due to the interface changes. This fully removes the interfaces introduced for MAC cookies, including the CookieMonster::CookieInfo class. BUG=none TBR=willchan Review URL: https://chromiumcodereview.appspot.com/12326056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185160 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/cookies/cookie_store_unittest.h')
-rw-r--r--net/cookies/cookie_store_unittest.h127
1 files changed, 25 insertions, 102 deletions
diff --git a/net/cookies/cookie_store_unittest.h b/net/cookies/cookie_store_unittest.h
index 0b742b3..eed8b00 100644
--- a/net/cookies/cookie_store_unittest.h
+++ b/net/cookies/cookie_store_unittest.h
@@ -45,9 +45,6 @@ const char kValidDomainCookieLine[] = "A=B; path=/; domain=google.izzle";
// // The cookie store supports cookies with the exclude_httponly() option.
// static const bool supports_http_only;
//
-// // The cookie store supports the GetCookiesWithInfoAsync() method.
-// static const bool supports_cookies_with_info;
-//
// // The cookie store is able to make the difference between the ".com"
// // and the "com" domains.
// static const bool supports_non_dotted_domains;
@@ -115,24 +112,6 @@ class CookieStoreTest : public testing::Test {
return callback.cookie();
}
- void GetCookiesWithInfo(CookieStore* cs,
- const GURL& url,
- const CookieOptions& options,
- std::string* cookie_line,
- std::vector<CookieStore::CookieInfo>* cookie_info) {
- DCHECK(cs);
- DCHECK(cookie_line);
- DCHECK(cookie_info);
- GetCookiesWithInfoCallback callback;
- cs->GetCookiesWithInfoAsync(
- url, options, base::Bind(&GetCookiesWithInfoCallback::Run,
- base::Unretained(&callback)));
- RunFor(kTimeout);
- EXPECT_TRUE(callback.did_run());
- *cookie_line = callback.cookie_line();
- *cookie_info = callback.cookie_info();
- }
-
bool SetCookieWithOptions(CookieStore* cs,
const GURL& url,
const std::string& cookie_line,
@@ -632,40 +611,6 @@ TYPED_TEST_P(CookieStoreTest, HttpOnlyTest) {
this->MatchCookieLines("A=C", this->GetCookies(cs, this->url_google_));
}
-TYPED_TEST_P(CookieStoreTest, TestGetCookiesWithInfo) {
- if (!TypeParam::supports_cookies_with_info)
- return;
-
- scoped_refptr<CookieStore> cs(this->GetCookieStore());
- CookieOptions options;
-
- EXPECT_TRUE(this->SetCookieWithOptions(cs, this->url_google_, "A=B",
- options));
- EXPECT_TRUE(this->SetCookieWithOptions(cs, this->url_google_,
- "C=D; Mac-Key=390jfn0awf3; Mac-Algorithm=hmac-sha-1", options));
-
- this->MatchCookieLines("A=B; C=D",
- this->GetCookiesWithOptions(cs, this->url_google_, options));
-
- std::string cookie_line;
- std::vector<CookieStore::CookieInfo> cookie_infos;
-
- this->GetCookiesWithInfo(cs, this->url_google_, options, &cookie_line,
- &cookie_infos);
-
- EXPECT_EQ("A=B; C=D", cookie_line);
-
- EXPECT_EQ(2U, cookie_infos.size());
-
- EXPECT_EQ("A", cookie_infos[0].name);
- EXPECT_EQ("", cookie_infos[0].mac_key);
- EXPECT_EQ("", cookie_infos[0].mac_algorithm);
-
- EXPECT_EQ("C", cookie_infos[1].name);
- EXPECT_EQ("390jfn0awf3", cookie_infos[1].mac_key);
- EXPECT_EQ("hmac-sha-1", cookie_infos[1].mac_algorithm);
-}
-
TYPED_TEST_P(CookieStoreTest, TestCookieDeletion) {
scoped_refptr<CookieStore> cs(this->GetCookieStore());
@@ -904,12 +849,26 @@ TYPED_TEST_P(CookieStoreTest, CookieOrdering) {
}
REGISTER_TYPED_TEST_CASE_P(CookieStoreTest,
- TypeTest, DomainTest, DomainWithTrailingDotTest, ValidSubdomainTest,
- InvalidDomainTest, DomainWithoutLeadingDotTest, CaseInsensitiveDomainTest,
- TestIpAddress, TestNonDottedAndTLD, TestHostEndsWithDot, InvalidScheme,
- InvalidScheme_Read, PathTest, HttpOnlyTest, TestGetCookiesWithInfo,
- TestCookieDeletion, TestDeleteAllCreatedBetween, TestSecure,
- NetUtilCookieTest, OverwritePersistentCookie, CookieOrdering);
+ TypeTest,
+ DomainTest,
+ DomainWithTrailingDotTest,
+ ValidSubdomainTest,
+ InvalidDomainTest,
+ DomainWithoutLeadingDotTest,
+ CaseInsensitiveDomainTest,
+ TestIpAddress,
+ TestNonDottedAndTLD,
+ TestHostEndsWithDot,
+ InvalidScheme,
+ InvalidScheme_Read,
+ PathTest,
+ HttpOnlyTest,
+ TestCookieDeletion,
+ TestDeleteAllCreatedBetween,
+ TestSecure,
+ NetUtilCookieTest,
+ OverwritePersistentCookie,
+ CookieOrdering);
template<class CookieStoreTestTraits>
class MultiThreadedCookieStoreTest :
@@ -940,16 +899,6 @@ class MultiThreadedCookieStoreTest :
base::Bind(&GetCookieStringCallback::Run, base::Unretained(callback)));
}
- void GetCookiesWithInfoTask(CookieStore* cs,
- const GURL& url,
- const CookieOptions& options,
- GetCookiesWithInfoCallback* callback) {
- cs->GetCookiesWithInfoAsync(
- url, options,
- base::Bind(&GetCookiesWithInfoCallback::Run,
- base::Unretained(callback)));
- }
-
void SetCookieWithOptionsTask(CookieStore* cs,
const GURL& url,
const std::string& cookie_line,
@@ -1022,34 +971,6 @@ TYPED_TEST_P(MultiThreadedCookieStoreTest, ThreadCheckGetCookiesWithOptions) {
EXPECT_EQ("A=B", callback.cookie());
}
-TYPED_TEST_P(MultiThreadedCookieStoreTest, ThreadCheckGetCookiesWithInfo) {
- if (!TypeParam::supports_cookies_with_info)
- return;
- scoped_refptr<CookieStore> cs(this->GetCookieStore());
- CookieOptions options;
- std::string cookie_line;
- std::vector<CookieStore::CookieInfo> cookie_infos;
- EXPECT_TRUE(this->SetCookie(cs, this->url_google_, "A=B"));
- this->GetCookiesWithInfo(cs, this->url_google_, options, &cookie_line,
- &cookie_infos);
- this->MatchCookieLines("A=B", cookie_line);
- EXPECT_EQ(1U, cookie_infos.size());
- EXPECT_EQ("A", cookie_infos[0].name);
- EXPECT_EQ("", cookie_infos[0].mac_key);
- EXPECT_EQ("", cookie_infos[0].mac_algorithm);
- GetCookiesWithInfoCallback callback(&this->other_thread_);
- base::Closure task = base::Bind(
- &net::MultiThreadedCookieStoreTest<TypeParam>::GetCookiesWithInfoTask,
- base::Unretained(this), cs, this->url_google_, options, &callback);
- this->RunOnOtherThread(task);
- EXPECT_TRUE(callback.did_run());
- this->MatchCookieLines("A=B", callback.cookie_line());
- EXPECT_EQ(1U, callback.cookie_info().size());
- EXPECT_EQ("A", callback.cookie_info()[0].name);
- EXPECT_EQ("", callback.cookie_info()[0].mac_key);
- EXPECT_EQ("", callback.cookie_info()[0].mac_algorithm);
-}
-
TYPED_TEST_P(MultiThreadedCookieStoreTest, ThreadCheckSetCookieWithOptions) {
scoped_refptr<CookieStore> cs(this->GetCookieStore());
CookieOptions options;
@@ -1110,9 +1031,11 @@ TYPED_TEST_P(MultiThreadedCookieStoreTest, ThreadCheckDeleteSessionCookies) {
}
REGISTER_TYPED_TEST_CASE_P(MultiThreadedCookieStoreTest,
- ThreadCheckGetCookies, ThreadCheckGetCookiesWithOptions,
- ThreadCheckGetCookiesWithInfo, ThreadCheckSetCookieWithOptions,
- ThreadCheckDeleteCookie, ThreadCheckDeleteSessionCookies);
+ ThreadCheckGetCookies,
+ ThreadCheckGetCookiesWithOptions,
+ ThreadCheckSetCookieWithOptions,
+ ThreadCheckDeleteCookie,
+ ThreadCheckDeleteSessionCookies);
} // namespace net