Commit 3157471e authored by Lily Chen's avatar Lily Chen Committed by Commit Bot

Use CookieOptions::MakeAllInclusive in ExtensionServiceTest

This change swaps a default net::CookieOptions to an all-inclusive
CookieOptions, which allows the test to set and get all cookies.

Previously, using the default CookieOptions, SameSite cookies could not
be set. This would be a problem when cookies become SameSite-by-default
(see https://www.chromestatus.com/feature/5088147346030592), because
the test would no longer be able to set and get the cookies it expects.

This change will allow the test to keep working when cookies are
SameSite-by-default.

Bug: 1016512
Change-Id: I8915aea124b3f3debb2f84bc58f950175875ee52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1875521Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
Commit-Queue: Lily Chen <chlily@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709168}
parent 8eb23d30
......@@ -4881,7 +4881,8 @@ TEST_F(ExtensionServiceTest, ClearExtensionData) {
net::CanonicalCookie::Create(ext_url, "dummy=value", base::Time::Now(),
base::nullopt /* server_time */);
cookie_store->SetCanonicalCookieAsync(
std::move(cookie), ext_url.scheme(), net::CookieOptions(),
std::move(cookie), ext_url.scheme(),
net::CookieOptions::MakeAllInclusive(),
base::BindOnce(&ExtensionCookieCallback::SetCookieCallback,
base::Unretained(&callback)));
content::RunAllTasksUntilIdle();
......@@ -5024,7 +5025,7 @@ TEST_F(ExtensionServiceTest, ClearAppData) {
bool set_result = false;
base::RunLoop run_loop;
cookie_manager_remote->SetCanonicalCookie(
*cc.get(), origin1.scheme(), net::CookieOptions(),
*cc.get(), origin1.scheme(), net::CookieOptions::MakeAllInclusive(),
base::BindOnce(&SetCookieSaveData, &set_result,
run_loop.QuitClosure()));
run_loop.Run();
......@@ -5035,7 +5036,7 @@ TEST_F(ExtensionServiceTest, ClearAppData) {
base::RunLoop run_loop;
std::vector<net::CanonicalCookie> cookies_result;
cookie_manager_remote->GetCookieList(
origin1, net::CookieOptions(),
origin1, net::CookieOptions::MakeAllInclusive(),
base::BindOnce(&GetCookiesSaveData, &cookies_result,
run_loop.QuitClosure()));
run_loop.Run();
......@@ -5085,7 +5086,7 @@ TEST_F(ExtensionServiceTest, ClearAppData) {
base::RunLoop run_loop;
std::vector<net::CanonicalCookie> cookies_result;
cookie_manager_remote->GetCookieList(
origin1, net::CookieOptions(),
origin1, net::CookieOptions::MakeAllInclusive(),
base::BindOnce(&GetCookiesSaveData, &cookies_result,
run_loop.QuitClosure()));
run_loop.Run();
......@@ -5104,7 +5105,7 @@ TEST_F(ExtensionServiceTest, ClearAppData) {
base::RunLoop run_loop;
std::vector<net::CanonicalCookie> cookies_result;
cookie_manager_remote->GetCookieList(
origin1, net::CookieOptions(),
origin1, net::CookieOptions::MakeAllInclusive(),
base::BindOnce(&GetCookiesSaveData, &cookies_result,
run_loop.QuitClosure()));
run_loop.Run();
......
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