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

Unified Diff: net/cookies/cookie_monster_unittest.cc

Issue 1409243003: Revert of Implement $Secure- cookie prefix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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_monster.cc ('k') | net/cookies/cookie_options.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cookies/cookie_monster_unittest.cc
diff --git a/net/cookies/cookie_monster_unittest.cc b/net/cookies/cookie_monster_unittest.cc
index 82ae3a2d57c2a3ac16b4bc2efd8a42b50cba4e0c..839add8b11e4147c779687651827365bc798a282 100644
--- a/net/cookies/cookie_monster_unittest.cc
+++ b/net/cookies/cookie_monster_unittest.cc
@@ -100,7 +100,6 @@
static const bool filters_schemes = true;
static const bool has_path_prefix_bug = false;
static const int creation_time_granularity_in_ms = 0;
- static const bool enforces_prefixes = true;
};
INSTANTIATE_TYPED_TEST_CASE_P(CookieMonster,
@@ -161,7 +160,7 @@
ResultSavingCookieCallback<bool> callback;
cm->SetCookieWithDetailsAsync(
url, name, value, domain, path, expiration_time, secure, http_only,
- first_party_only, false /* enforce prefixes */, priority,
+ first_party_only, priority,
base::Bind(&ResultSavingCookieCallback<bool>::Run,
base::Unretained(&callback)));
RunFor(kTimeout);
@@ -671,8 +670,8 @@
ACTION_P3(SetCookieWithDetailsAction, cookie_monster, cc, callback) {
cookie_monster->SetCookieWithDetailsAsync(
cc.url, cc.name, cc.value, cc.domain, cc.path, cc.expiration_time,
- cc.secure, cc.http_only, cc.first_party_only,
- false /* enforce prefixes */, cc.priority, callback->AsCallback());
+ cc.secure, cc.http_only, cc.first_party_only, cc.priority,
+ callback->AsCallback());
}
ACTION_P2(GetAllCookiesAction, cookie_monster, callback) {
@@ -2476,7 +2475,7 @@
CookiePriority priority = COOKIE_PRIORITY_DEFAULT;
cm->SetCookieWithDetailsAsync(
url, name, value, domain, path, expiration_time, secure, http_only,
- first_party_only, false /* enforce prefixes */, priority,
+ first_party_only, priority,
base::Bind(&ResultSavingCookieCallback<bool>::Run,
base::Unretained(callback)));
}
@@ -2967,29 +2966,6 @@
CookieMonster::COOKIE_SOURCE_NONSECURE_COOKIE_NONCRYPTOGRAPHIC_SCHEME, 1);
}
-TEST_F(CookieMonsterTest, SecureCookiePrefix) {
- scoped_refptr<CookieMonster> cm(new CookieMonster(NULL, NULL));
- // A $Secure- cookie must be Secure.
- EXPECT_FALSE(SetCookie(cm.get(), https_www_google_.url(), "$Secure-A=B"));
- EXPECT_FALSE(
- SetCookie(cm.get(), https_www_google_.url(), "$Secure-A=B; httponly"));
-
- // A typoed prefix does not have to be Secure.
- EXPECT_TRUE(
- SetCookie(cm.get(), https_www_google_.url(), "$secure-A=B; Secure"));
- EXPECT_TRUE(SetCookie(cm.get(), https_www_google_.url(), "$secure-A=C;"));
- EXPECT_TRUE(
- SetCookie(cm.get(), https_www_google_.url(), "$SecureA=B; Secure"));
- EXPECT_TRUE(SetCookie(cm.get(), https_www_google_.url(), "$SecureA=C;"));
-
- EXPECT_TRUE(
- SetCookie(cm.get(), https_www_google_.url(), "$Secure-A=B; Secure"));
-
- // A $Secure- cookie can't be set on a non-secure origin.
- EXPECT_FALSE(
- SetCookie(cm.get(), http_www_google_.url(), "$Secure-A=B; Secure"));
-}
-
class CookieMonsterNotificationTest : public CookieMonsterTest {
public:
CookieMonsterNotificationTest()
« no previous file with comments | « net/cookies/cookie_monster.cc ('k') | net/cookies/cookie_options.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698