Commit 423143d7 authored by Dylan Cutler's avatar Dylan Cutler Committed by Chromium LUCI CQ

Get components/signin/public/identity_manager:unit_tests to build when

CanonicalCookie's constructor is private.

This is part of a larger effort to make CanonicalCookie's generic
constructor private.

This CL replaces uses of the constructor with the factory
CreateUnsafeCookieForTesting. This factory is meant for test-only code
and should not be used in production.

Bug: 1102874
Change-Id: Id6d17a9971b70e33d15ab649cce44466a6dcaf51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2588641
Commit-Queue: David Roger <droger@chromium.org>
Reviewed-by: default avatarMaksim Orlovich <morlovich@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837017}
parent d4e5a1f1
......@@ -2052,12 +2052,12 @@ TEST_F(IdentityManagerTest, CallbackSentOnAccountsCookieDeletedByUserAction) {
base::RunLoop run_loop;
identity_manager_observer()->SetOnCookieDeletedByUserCallback(
run_loop.QuitClosure());
net::CanonicalCookie cookie(
auto cookie = net::CanonicalCookie::CreateUnsafeCookieForTesting(
"SAPISID", std::string(), ".google.com", "/", base::Time(), base::Time(),
base::Time(), /*secure=*/true, false, net::CookieSameSite::NO_RESTRICTION,
net::COOKIE_PRIORITY_DEFAULT, false);
SimulateCookieDeletedByUser(identity_manager()->GetGaiaCookieManagerService(),
cookie);
*cookie);
run_loop.Run();
}
......@@ -2084,12 +2084,12 @@ TEST_F(IdentityManagerTest, OnNetworkInitialized) {
// Note that this call differs from calling SimulateCookieDeletedByUser()
// directly in the sense that SimulateCookieDeletedByUser() does not go
// through any mojo pipe.
net::CanonicalCookie cookie(
auto cookie = net::CanonicalCookie::CreateUnsafeCookieForTesting(
"SAPISID", std::string(), ".google.com", "/", base::Time(), base::Time(),
base::Time(), /*secure=*/true, false, net::CookieSameSite::NO_RESTRICTION,
net::COOKIE_PRIORITY_DEFAULT, false);
test_cookie_manager_ptr->DispatchCookieChange(net::CookieChangeInfo(
cookie, net::CookieAccessResult(), net::CookieChangeCause::EXPLICIT));
*cookie, net::CookieAccessResult(), net::CookieChangeCause::EXPLICIT));
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