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

Unified Diff: content/browser/net/sqlite_persistent_cookie_store_unittest.cc

Issue 876973003: Implement the "first-party-only" cookie flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: FirstPartyOnly. Created 5 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
« no previous file with comments | « content/browser/net/sqlite_persistent_cookie_store_perftest.cc ('k') | net/cookies/canonical_cookie.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/net/sqlite_persistent_cookie_store_unittest.cc
diff --git a/content/browser/net/sqlite_persistent_cookie_store_unittest.cc b/content/browser/net/sqlite_persistent_cookie_store_unittest.cc
index 47590d7274b34a076d2e5021ee42933226ea59f5..ab177a90e85b391eb5c9edf42f2baeff3999c30d 100644
--- a/content/browser/net/sqlite_persistent_cookie_store_unittest.cc
+++ b/content/browser/net/sqlite_persistent_cookie_store_unittest.cc
@@ -159,10 +159,9 @@ class SQLitePersistentCookieStoreTest : public testing::Test {
const std::string& domain,
const std::string& path,
const base::Time& creation) {
- store_->AddCookie(
- net::CanonicalCookie(GURL(), name, value, domain, path, creation,
- creation, creation, false, false,
- net::COOKIE_PRIORITY_DEFAULT));
+ store_->AddCookie(net::CanonicalCookie(
+ GURL(), name, value, domain, path, creation, creation, creation, false,
+ false, false, net::COOKIE_PRIORITY_DEFAULT));
}
std::string ReadRawDBContents() {
@@ -361,11 +360,10 @@ TEST_F(SQLitePersistentCookieStoreTest, TestLoadOldSessionCookies) {
InitializeStore(false, true);
// Add a session cookie.
- store_->AddCookie(
- net::CanonicalCookie(
- GURL(), "C", "D", "sessioncookie.com", "/", base::Time::Now(),
- base::Time(), base::Time::Now(), false, false,
- net::COOKIE_PRIORITY_DEFAULT));
+ store_->AddCookie(net::CanonicalCookie(GURL(), "C", "D", "sessioncookie.com",
+ "/", base::Time::Now(), base::Time(),
+ base::Time::Now(), false, false, false,
+ net::COOKIE_PRIORITY_DEFAULT));
// Force the store to write its data to the disk.
DestroyStore();
@@ -389,11 +387,10 @@ TEST_F(SQLitePersistentCookieStoreTest, TestDontLoadOldSessionCookies) {
InitializeStore(false, true);
// Add a session cookie.
- store_->AddCookie(
- net::CanonicalCookie(
- GURL(), "C", "D", "sessioncookie.com", "/", base::Time::Now(),
- base::Time(), base::Time::Now(), false, false,
- net::COOKIE_PRIORITY_DEFAULT));
+ store_->AddCookie(net::CanonicalCookie(GURL(), "C", "D", "sessioncookie.com",
+ "/", base::Time::Now(), base::Time(),
+ base::Time::Now(), false, false, false,
+ net::COOKIE_PRIORITY_DEFAULT));
// Force the store to write its data to the disk.
DestroyStore();
@@ -420,19 +417,16 @@ TEST_F(SQLitePersistentCookieStoreTest, PersistIsPersistent) {
static const char kPersistentName[] = "persistent";
// Add a session cookie.
- store_->AddCookie(
- net::CanonicalCookie(
- GURL(), kSessionName, "val", "sessioncookie.com", "/",
- base::Time::Now(), base::Time(), base::Time::Now(), false, false,
- net::COOKIE_PRIORITY_DEFAULT));
+ store_->AddCookie(net::CanonicalCookie(
+ GURL(), kSessionName, "val", "sessioncookie.com", "/", base::Time::Now(),
+ base::Time(), base::Time::Now(), false, false, false,
+ net::COOKIE_PRIORITY_DEFAULT));
// Add a persistent cookie.
- store_->AddCookie(
- net::CanonicalCookie(
- GURL(), kPersistentName, "val", "sessioncookie.com", "/",
- base::Time::Now() - base::TimeDelta::FromDays(1),
- base::Time::Now() + base::TimeDelta::FromDays(1),
- base::Time::Now(), false, false,
- net::COOKIE_PRIORITY_DEFAULT));
+ store_->AddCookie(net::CanonicalCookie(
+ GURL(), kPersistentName, "val", "sessioncookie.com", "/",
+ base::Time::Now() - base::TimeDelta::FromDays(1),
+ base::Time::Now() + base::TimeDelta::FromDays(1), base::Time::Now(),
+ false, false, false, net::COOKIE_PRIORITY_DEFAULT));
// Force the store to write its data to the disk.
DestroyStore();
@@ -473,31 +467,25 @@ TEST_F(SQLitePersistentCookieStoreTest, PriorityIsPersistent) {
InitializeStore(false, true);
// Add a low-priority persistent cookie.
- store_->AddCookie(
- net::CanonicalCookie(
- GURL(), kLowName, kCookieValue, kCookieDomain, kCookiePath,
- base::Time::Now() - base::TimeDelta::FromMinutes(1),
- base::Time::Now() + base::TimeDelta::FromDays(1),
- base::Time::Now(), false, false,
- net::COOKIE_PRIORITY_LOW));
+ store_->AddCookie(net::CanonicalCookie(
+ GURL(), kLowName, kCookieValue, kCookieDomain, kCookiePath,
+ base::Time::Now() - base::TimeDelta::FromMinutes(1),
+ base::Time::Now() + base::TimeDelta::FromDays(1), base::Time::Now(),
+ false, false, false, net::COOKIE_PRIORITY_LOW));
// Add a medium-priority persistent cookie.
- store_->AddCookie(
- net::CanonicalCookie(
- GURL(), kMediumName, kCookieValue, kCookieDomain, kCookiePath,
- base::Time::Now() - base::TimeDelta::FromMinutes(2),
- base::Time::Now() + base::TimeDelta::FromDays(1),
- base::Time::Now(), false, false,
- net::COOKIE_PRIORITY_MEDIUM));
+ store_->AddCookie(net::CanonicalCookie(
+ GURL(), kMediumName, kCookieValue, kCookieDomain, kCookiePath,
+ base::Time::Now() - base::TimeDelta::FromMinutes(2),
+ base::Time::Now() + base::TimeDelta::FromDays(1), base::Time::Now(),
+ false, false, false, net::COOKIE_PRIORITY_MEDIUM));
// Add a high-priority peristent cookie.
- store_->AddCookie(
- net::CanonicalCookie(
- GURL(), kHighName, kCookieValue, kCookieDomain, kCookiePath,
- base::Time::Now() - base::TimeDelta::FromMinutes(3),
- base::Time::Now() + base::TimeDelta::FromDays(1),
- base::Time::Now(), false, false,
- net::COOKIE_PRIORITY_HIGH));
+ store_->AddCookie(net::CanonicalCookie(
+ GURL(), kHighName, kCookieValue, kCookieDomain, kCookiePath,
+ base::Time::Now() - base::TimeDelta::FromMinutes(3),
+ base::Time::Now() + base::TimeDelta::FromDays(1), base::Time::Now(),
+ false, false, false, net::COOKIE_PRIORITY_HIGH));
// Force the store to write its data to the disk.
DestroyStore();
« no previous file with comments | « content/browser/net/sqlite_persistent_cookie_store_perftest.cc ('k') | net/cookies/canonical_cookie.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698