Commit 69722f40 authored by Randy Smith's avatar Randy Smith Committed by Commit Bot

Formatting/comment changes in cookie store unit tests.

I missed a couple of comments in
https://chromium-review.googlesource.com/c/581797, so executing on
them in a separate CL.

TBR=mmenke@chromium.org

Bug: 721395
Change-Id: Ica4c496ff28cd202026406f1ebcf4194045c969c
Reviewed-on: https://chromium-review.googlesource.com/600632
Commit-Queue: Randy Smith <rdsmith@chromium.org>
Reviewed-by: default avatarRandy Smith <rdsmith@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491848}
parent 91f96019
...@@ -497,9 +497,9 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) { ...@@ -497,9 +497,9 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) {
cs, cs,
base::MakeUnique<CanonicalCookie>( base::MakeUnique<CanonicalCookie>(
"A", "B", foo_foo_host, "/foo", one_hour_ago, one_hour_from_now, "A", "B", foo_foo_host, "/foo", one_hour_ago, one_hour_from_now,
base::Time(), false, false, CookieSameSite::DEFAULT_MODE, base::Time(), false /* secure */, false /* httponly */,
COOKIE_PRIORITY_DEFAULT), CookieSameSite::DEFAULT_MODE, COOKIE_PRIORITY_DEFAULT),
false, true)); false /* secure_source */, true));
// Note that for the creation time to be set exactly, without modification, // Note that for the creation time to be set exactly, without modification,
// it must be different from the one set by the line above. // it must be different from the one set by the line above.
EXPECT_TRUE(this->SetCanonicalCookie( EXPECT_TRUE(this->SetCanonicalCookie(
...@@ -508,7 +508,7 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) { ...@@ -508,7 +508,7 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) {
"C", "D", "." + foo_bar_domain, "/bar", two_hours_ago, base::Time(), "C", "D", "." + foo_bar_domain, "/bar", two_hours_ago, base::Time(),
one_hour_ago, false, true, CookieSameSite::DEFAULT_MODE, one_hour_ago, false, true, CookieSameSite::DEFAULT_MODE,
COOKIE_PRIORITY_DEFAULT), COOKIE_PRIORITY_DEFAULT),
false, true)); false /* secure_source */, true));
// A secure source is required for creating secure cookies. // A secure source is required for creating secure cookies.
EXPECT_FALSE(this->SetCanonicalCookie( EXPECT_FALSE(this->SetCanonicalCookie(
...@@ -517,7 +517,7 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) { ...@@ -517,7 +517,7 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) {
"E", "F", http_foo_host, "/", base::Time(), base::Time(), "E", "F", http_foo_host, "/", base::Time(), base::Time(),
base::Time(), true, false, CookieSameSite::DEFAULT_MODE, base::Time(), true, false, CookieSameSite::DEFAULT_MODE,
COOKIE_PRIORITY_DEFAULT), COOKIE_PRIORITY_DEFAULT),
false, true)); false /* secure_source */, true));
// A secure source is also required for overwriting secure cookies. Writing // A secure source is also required for overwriting secure cookies. Writing
// a secure cookie then overwriting it from a non-secure source should fail. // a secure cookie then overwriting it from a non-secure source should fail.
...@@ -525,17 +525,17 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) { ...@@ -525,17 +525,17 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) {
cs, cs,
base::MakeUnique<CanonicalCookie>( base::MakeUnique<CanonicalCookie>(
"E", "F", http_foo_host, "/", base::Time(), base::Time(), "E", "F", http_foo_host, "/", base::Time(), base::Time(),
base::Time(), true, false, CookieSameSite::DEFAULT_MODE, base::Time(), true /* secure */, false /* httponly */,
COOKIE_PRIORITY_DEFAULT), CookieSameSite::DEFAULT_MODE, COOKIE_PRIORITY_DEFAULT),
true, true)); true /* secure_source */, true /* modify_http_only */));
EXPECT_FALSE(this->SetCanonicalCookie( EXPECT_FALSE(this->SetCanonicalCookie(
cs, cs,
base::MakeUnique<CanonicalCookie>( base::MakeUnique<CanonicalCookie>(
"E", "F", http_foo_host, "/", base::Time(), base::Time(), "E", "F", http_foo_host, "/", base::Time(), base::Time(),
base::Time(), true, false, CookieSameSite::DEFAULT_MODE, base::Time(), true /* secure */, false /* httponly */,
COOKIE_PRIORITY_DEFAULT), CookieSameSite::DEFAULT_MODE, COOKIE_PRIORITY_DEFAULT),
false, true)); false /* secure_source */, true /* modify_http_only */));
if (TypeParam::supports_http_only) { if (TypeParam::supports_http_only) {
// Permission to modify http only cookies is required to create an // Permission to modify http only cookies is required to create an
...@@ -544,9 +544,9 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) { ...@@ -544,9 +544,9 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) {
cs, cs,
base::MakeUnique<CanonicalCookie>( base::MakeUnique<CanonicalCookie>(
"G", "H", http_foo_host, "/unique", base::Time(), base::Time(), "G", "H", http_foo_host, "/unique", base::Time(), base::Time(),
base::Time(), false, true, CookieSameSite::DEFAULT_MODE, base::Time(), false /* secure */, true /* httponly */,
COOKIE_PRIORITY_DEFAULT), CookieSameSite::DEFAULT_MODE, COOKIE_PRIORITY_DEFAULT),
/* secure_source */ false, /* modify_http_only */ false)); false /* secure_source */, false /* modify_http_only */));
// Permission to modify httponly cookies is also required to overwrite // Permission to modify httponly cookies is also required to overwrite
// an httponly cookie. // an httponly cookie.
...@@ -554,26 +554,26 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) { ...@@ -554,26 +554,26 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) {
cs, cs,
base::MakeUnique<CanonicalCookie>( base::MakeUnique<CanonicalCookie>(
"G", "H", http_foo_host, "/unique", base::Time(), base::Time(), "G", "H", http_foo_host, "/unique", base::Time(), base::Time(),
base::Time(), false, true, CookieSameSite::DEFAULT_MODE, base::Time(), false /* secure */, true /* httponly */,
COOKIE_PRIORITY_DEFAULT), CookieSameSite::DEFAULT_MODE, COOKIE_PRIORITY_DEFAULT),
/* secure_source */ false, /* modify_http_only */ true)); false /* secure_source */, true /* modify_http_only */));
EXPECT_FALSE(this->SetCanonicalCookie( EXPECT_FALSE(this->SetCanonicalCookie(
cs, cs,
base::MakeUnique<CanonicalCookie>( base::MakeUnique<CanonicalCookie>(
"G", "H", http_foo_host, "/unique", base::Time(), base::Time(), "G", "H", http_foo_host, "/unique", base::Time(), base::Time(),
base::Time(), false, true, CookieSameSite::DEFAULT_MODE, base::Time(), false /* secure */, true /* httponly */,
COOKIE_PRIORITY_DEFAULT), CookieSameSite::DEFAULT_MODE, COOKIE_PRIORITY_DEFAULT),
/* secure_source */ false, /* modify_http_only */ false)); false /* secure_source */, false /* modify_http_only */));
} else { } else {
// Leave store in same state as if the above tests had been run. // Leave store in same state as if the above tests had been run.
EXPECT_TRUE(this->SetCanonicalCookie( EXPECT_TRUE(this->SetCanonicalCookie(
cs, cs,
base::MakeUnique<CanonicalCookie>( base::MakeUnique<CanonicalCookie>(
"G", "H", http_foo_host, "/unique", base::Time(), base::Time(), "G", "H", http_foo_host, "/unique", base::Time(), base::Time(),
base::Time(), false, true, CookieSameSite::DEFAULT_MODE, base::Time(), false /* secure */, true /* httponly */,
COOKIE_PRIORITY_DEFAULT), CookieSameSite::DEFAULT_MODE, COOKIE_PRIORITY_DEFAULT),
/* secure_source */ false, /* modify_http_only */ true)); false /* secure_source */, true /* modify_http_only */));
} }
// Get all the cookies for a given URL, regardless of properties. This 'get()' // Get all the cookies for a given URL, regardless of properties. This 'get()'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment