Commit 357909fe authored by Lowell Manners's avatar Lowell Manners Committed by Commit Bot

[iOS] Delete unused method BuildFakeGaiaCookieManagerServiceWithOptions.

iOS tests don't use BuildFakeGaiaCookieManagerServiceWithOptions, so it
is dead code and can be deleted.

This functionality can always be added later if/when there is a test
which needs it.

This is part of step 1a of the plan to eliminate FakeGCMS entirely:
https://docs.google.com/document/d/1t0ZtuV7h-znzdItFgBW0aKPscAwWXIBuNZnNlEGgi7g/edit

Bug: 907782
Change-Id: Ia924bd8f41e6f7090646eae02841a01743f104a2
Reviewed-on: https://chromium-review.googlesource.com/c/1384370
Commit-Queue: Lowell Manners <lowell@chromium.org>
Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619644}
parent 16361c59
...@@ -13,19 +13,10 @@ ...@@ -13,19 +13,10 @@
std::unique_ptr<KeyedService> BuildFakeGaiaCookieManagerService( std::unique_ptr<KeyedService> BuildFakeGaiaCookieManagerService(
web::BrowserState* browser_state) { web::BrowserState* browser_state) {
return BuildFakeGaiaCookieManagerServiceWithOptions(
/*create_fake_url_loader_factory_for_cookie_requests=*/false,
browser_state);
}
std::unique_ptr<KeyedService> BuildFakeGaiaCookieManagerServiceWithOptions(
bool create_fake_url_loader_factory_for_cookie_requests,
web::BrowserState* browser_state) {
ios::ChromeBrowserState* chrome_browser_state = ios::ChromeBrowserState* chrome_browser_state =
ios::ChromeBrowserState::FromBrowserState(browser_state); ios::ChromeBrowserState::FromBrowserState(browser_state);
return std::make_unique<FakeGaiaCookieManagerService>( return std::make_unique<FakeGaiaCookieManagerService>(
ProfileOAuth2TokenServiceFactory::GetForBrowserState( ProfileOAuth2TokenServiceFactory::GetForBrowserState(
chrome_browser_state), chrome_browser_state),
SigninClientFactory::GetForBrowserState(chrome_browser_state), SigninClientFactory::GetForBrowserState(chrome_browser_state));
create_fake_url_loader_factory_for_cookie_requests);
} }
...@@ -14,11 +14,10 @@ class BrowserState; ...@@ -14,11 +14,10 @@ class BrowserState;
} }
// Helper functions to be used with KeyedService::SetTestingFactory(). // Helper functions to be used with KeyedService::SetTestingFactory().
// This is a subset of the helpers available in //chrome. If more helpers are
// needed, they can be copied from fake_gaia_cookie_manager_service_builder.h
// under //chrome.
std::unique_ptr<KeyedService> BuildFakeGaiaCookieManagerService( std::unique_ptr<KeyedService> BuildFakeGaiaCookieManagerService(
web::BrowserState* browser_state); web::BrowserState* browser_state);
std::unique_ptr<KeyedService> BuildFakeGaiaCookieManagerServiceWithOptions(
bool create_fake_url_loader_factory_for_cookie_requests,
web::BrowserState* browser_state);
#endif // IOS_CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_BUILDER_H_ #endif // IOS_CHROME_BROWSER_SIGNIN_FAKE_GAIA_COOKIE_MANAGER_SERVICE_BUILDER_H_
...@@ -15,16 +15,13 @@ ...@@ -15,16 +15,13 @@
namespace { namespace {
TestChromeBrowserState::TestingFactories GetIdentityTestEnvironmentFactories( TestChromeBrowserState::TestingFactories GetIdentityTestEnvironmentFactories() {
bool create_fake_url_loader_factory_for_cookie_requests = true) { return {{ios::GaiaCookieManagerServiceFactory::GetInstance(),
return { base::BindRepeating(&BuildFakeGaiaCookieManagerService)},
{ios::GaiaCookieManagerServiceFactory::GetInstance(), {ProfileOAuth2TokenServiceFactory::GetInstance(),
base::BindRepeating(&BuildFakeGaiaCookieManagerServiceWithOptions, base::BindRepeating(&BuildFakeOAuth2TokenService)},
create_fake_url_loader_factory_for_cookie_requests)}, {ios::SigninManagerFactory::GetInstance(),
{ProfileOAuth2TokenServiceFactory::GetInstance(), base::BindRepeating(&ios::BuildFakeSigninManager)}};
base::BindRepeating(&BuildFakeOAuth2TokenService)},
{ios::SigninManagerFactory::GetInstance(),
base::BindRepeating(&ios::BuildFakeSigninManager)}};
} }
} // namespace } // namespace
...@@ -41,26 +38,22 @@ IdentityTestEnvironmentChromeBrowserStateAdaptor:: ...@@ -41,26 +38,22 @@ IdentityTestEnvironmentChromeBrowserStateAdaptor::
std::unique_ptr<TestChromeBrowserState> std::unique_ptr<TestChromeBrowserState>
IdentityTestEnvironmentChromeBrowserStateAdaptor:: IdentityTestEnvironmentChromeBrowserStateAdaptor::
CreateChromeBrowserStateForIdentityTestEnvironment( CreateChromeBrowserStateForIdentityTestEnvironment(
const TestChromeBrowserState::TestingFactories& input_factories, const TestChromeBrowserState::TestingFactories& input_factories) {
bool create_fake_url_loader_factory_for_cookie_requests) {
TestChromeBrowserState::Builder builder; TestChromeBrowserState::Builder builder;
for (auto& input_factory : input_factories) { for (auto& input_factory : input_factories) {
builder.AddTestingFactory(input_factory.first, input_factory.second); builder.AddTestingFactory(input_factory.first, input_factory.second);
} }
return CreateChromeBrowserStateForIdentityTestEnvironment( return CreateChromeBrowserStateForIdentityTestEnvironment(builder);
builder, create_fake_url_loader_factory_for_cookie_requests);
} }
// static // static
std::unique_ptr<TestChromeBrowserState> std::unique_ptr<TestChromeBrowserState>
IdentityTestEnvironmentChromeBrowserStateAdaptor:: IdentityTestEnvironmentChromeBrowserStateAdaptor::
CreateChromeBrowserStateForIdentityTestEnvironment( CreateChromeBrowserStateForIdentityTestEnvironment(
TestChromeBrowserState::Builder& builder, TestChromeBrowserState::Builder& builder) {
bool create_fake_url_loader_factory_for_cookie_requests) { for (auto& identity_factory : GetIdentityTestEnvironmentFactories()) {
for (auto& identity_factory : GetIdentityTestEnvironmentFactories(
create_fake_url_loader_factory_for_cookie_requests)) {
builder.AddTestingFactory(identity_factory.first, identity_factory.second); builder.AddTestingFactory(identity_factory.first, identity_factory.second);
} }
...@@ -70,10 +63,8 @@ IdentityTestEnvironmentChromeBrowserStateAdaptor:: ...@@ -70,10 +63,8 @@ IdentityTestEnvironmentChromeBrowserStateAdaptor::
// static // static
void IdentityTestEnvironmentChromeBrowserStateAdaptor:: void IdentityTestEnvironmentChromeBrowserStateAdaptor::
SetIdentityTestEnvironmentFactoriesOnBrowserContext( SetIdentityTestEnvironmentFactoriesOnBrowserContext(
TestChromeBrowserState* browser_state, TestChromeBrowserState* browser_state) {
bool create_fake_url_loader_factory_for_cookie_requests) { for (const auto& factory_pair : GetIdentityTestEnvironmentFactories()) {
for (const auto& factory_pair : GetIdentityTestEnvironmentFactories(
create_fake_url_loader_factory_for_cookie_requests)) {
factory_pair.first->SetTestingFactory(browser_state, factory_pair.second); factory_pair.first->SetTestingFactory(browser_state, factory_pair.second);
} }
} }
......
...@@ -31,23 +31,20 @@ class IdentityTestEnvironmentChromeBrowserStateAdaptor { ...@@ -31,23 +31,20 @@ class IdentityTestEnvironmentChromeBrowserStateAdaptor {
// |create_fake_url_loader_factory_for_cookie_requests| to false. // |create_fake_url_loader_factory_for_cookie_requests| to false.
static std::unique_ptr<TestChromeBrowserState> static std::unique_ptr<TestChromeBrowserState>
CreateChromeBrowserStateForIdentityTestEnvironment( CreateChromeBrowserStateForIdentityTestEnvironment(
const TestChromeBrowserState::TestingFactories& input_factories, const TestChromeBrowserState::TestingFactories& input_factories);
bool create_fake_url_loader_factory_for_cookie_requests = false);
// Creates and returns a TestChromeBrowserState that has been configured with // Creates and returns a TestChromeBrowserState that has been configured with
// the given |builder|. // the given |builder|.
// See the above variant for comments on common parameters. // See the above variant for comments on common parameters.
static std::unique_ptr<TestChromeBrowserState> static std::unique_ptr<TestChromeBrowserState>
CreateChromeBrowserStateForIdentityTestEnvironment( CreateChromeBrowserStateForIdentityTestEnvironment(
TestChromeBrowserState::Builder& builder, TestChromeBrowserState::Builder& builder);
bool create_fake_url_loader_factory_for_cookie_requests = false);
// Sets the testing factories that identity::IdentityTestEnvironment // Sets the testing factories that identity::IdentityTestEnvironment
// requires explicitly on a Profile that is passed to it. // requires explicitly on a Profile that is passed to it.
// See the above variant for comments on common parameters. // See the above variant for comments on common parameters.
static void SetIdentityTestEnvironmentFactoriesOnBrowserContext( static void SetIdentityTestEnvironmentFactoriesOnBrowserContext(
TestChromeBrowserState* browser_state, TestChromeBrowserState* browser_state);
bool create_fake_url_loader_factory_for_cookie_requests = false);
// Appends the set of testing factories that identity::IdentityTestEnvironment // Appends the set of testing factories that identity::IdentityTestEnvironment
// requires to |factories_to_append_to|, which should be the set of testing // requires to |factories_to_append_to|, which should be the set of testing
......
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