Commit 322d2a2a authored by Lowell Manners's avatar Lowell Manners Committed by Commit Bot

Revert "Delete (now) useless FakeGaiaCookieManagerService factory method."

Reverting this, it looks like it caused some Andriod trybots to fail due
to an invalid cast.

This reverts commit 05caea21.

TBR=droger@chromium.org

Bug: 907782
Change-Id: I57e11af47c3bfbdb79faae2aa9f52742c49be411
Reviewed-on: https://chromium-review.googlesource.com/c/1437631Reviewed-by: default avatarLowell Manners <lowell@chromium.org>
Commit-Queue: Lowell Manners <lowell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626497}
parent db252e95
......@@ -12,6 +12,14 @@
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "services/network/test/test_url_loader_factory.h"
std::unique_ptr<KeyedService> BuildFakeGaiaCookieManagerService(
content::BrowserContext* context) {
Profile* profile = Profile::FromBrowserContext(context);
return std::make_unique<FakeGaiaCookieManagerService>(
ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
ChromeSigninClientFactory::GetForProfile(profile));
}
std::unique_ptr<KeyedService> BuildFakeGaiaCookieManagerServiceWithURLLoader(
network::TestURLLoaderFactory* test_url_loader_factory,
content::BrowserContext* context) {
......
......@@ -18,6 +18,10 @@ namespace network {
class TestURLLoaderFactory;
}
// Helper functions to be used with KeyedService::SetTestingFactory().
std::unique_ptr<KeyedService> BuildFakeGaiaCookieManagerService(
content::BrowserContext* context);
// Builds a FakeGaiaCookieManagerService which uses the provided
// |test_url_loader_factory| for cookie-related requests.
std::unique_ptr<KeyedService> BuildFakeGaiaCookieManagerServiceWithURLLoader(
......
......@@ -68,7 +68,9 @@ void IdentityTestEnvironmentProfileAdaptor::
// static
TestingProfile::TestingFactories
IdentityTestEnvironmentProfileAdaptor::GetIdentityTestEnvironmentFactories() {
return {{ProfileOAuth2TokenServiceFactory::GetInstance(),
return {{GaiaCookieManagerServiceFactory::GetInstance(),
base::BindRepeating(&BuildFakeGaiaCookieManagerService)},
{ProfileOAuth2TokenServiceFactory::GetInstance(),
base::BindRepeating(&BuildFakeProfileOAuth2TokenService)},
{SigninManagerFactory::GetInstance(),
base::BindRepeating(&BuildFakeSigninManagerForTesting)}};
......
......@@ -135,7 +135,9 @@ class DiceSigninUiUtilTest : public BrowserWithTestWindowTest {
return {{SigninManagerFactory::GetInstance(),
base::BindRepeating(&BuildFakeSigninManagerForTesting)},
{ProfileOAuth2TokenServiceFactory::GetInstance(),
base::BindRepeating(&BuildFakeProfileOAuth2TokenService)}};
base::BindRepeating(&BuildFakeProfileOAuth2TokenService)},
{GaiaCookieManagerServiceFactory::GetInstance(),
base::BindRepeating(&BuildFakeGaiaCookieManagerService)}};
}
// BrowserWithTestWindowTest:
......
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