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 @@
std::unique_ptr<KeyedService> BuildFakeGaiaCookieManagerService(
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::FromBrowserState(browser_state);
return std::make_unique<FakeGaiaCookieManagerService>(
ProfileOAuth2TokenServiceFactory::GetForBrowserState(
chrome_browser_state),
SigninClientFactory::GetForBrowserState(chrome_browser_state),
create_fake_url_loader_factory_for_cookie_requests);
SigninClientFactory::GetForBrowserState(chrome_browser_state));
}
......@@ -14,11 +14,10 @@ class BrowserState;
}
// 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(
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_
......@@ -15,16 +15,13 @@
namespace {
TestChromeBrowserState::TestingFactories GetIdentityTestEnvironmentFactories(
bool create_fake_url_loader_factory_for_cookie_requests = true) {
return {
{ios::GaiaCookieManagerServiceFactory::GetInstance(),
base::BindRepeating(&BuildFakeGaiaCookieManagerServiceWithOptions,
create_fake_url_loader_factory_for_cookie_requests)},
{ProfileOAuth2TokenServiceFactory::GetInstance(),
base::BindRepeating(&BuildFakeOAuth2TokenService)},
{ios::SigninManagerFactory::GetInstance(),
base::BindRepeating(&ios::BuildFakeSigninManager)}};
TestChromeBrowserState::TestingFactories GetIdentityTestEnvironmentFactories() {
return {{ios::GaiaCookieManagerServiceFactory::GetInstance(),
base::BindRepeating(&BuildFakeGaiaCookieManagerService)},
{ProfileOAuth2TokenServiceFactory::GetInstance(),
base::BindRepeating(&BuildFakeOAuth2TokenService)},
{ios::SigninManagerFactory::GetInstance(),
base::BindRepeating(&ios::BuildFakeSigninManager)}};
}
} // namespace
......@@ -41,26 +38,22 @@ IdentityTestEnvironmentChromeBrowserStateAdaptor::
std::unique_ptr<TestChromeBrowserState>
IdentityTestEnvironmentChromeBrowserStateAdaptor::
CreateChromeBrowserStateForIdentityTestEnvironment(
const TestChromeBrowserState::TestingFactories& input_factories,
bool create_fake_url_loader_factory_for_cookie_requests) {
const TestChromeBrowserState::TestingFactories& input_factories) {
TestChromeBrowserState::Builder builder;
for (auto& input_factory : input_factories) {
builder.AddTestingFactory(input_factory.first, input_factory.second);
}
return CreateChromeBrowserStateForIdentityTestEnvironment(
builder, create_fake_url_loader_factory_for_cookie_requests);
return CreateChromeBrowserStateForIdentityTestEnvironment(builder);
}
// static
std::unique_ptr<TestChromeBrowserState>
IdentityTestEnvironmentChromeBrowserStateAdaptor::
CreateChromeBrowserStateForIdentityTestEnvironment(
TestChromeBrowserState::Builder& builder,
bool create_fake_url_loader_factory_for_cookie_requests) {
for (auto& identity_factory : GetIdentityTestEnvironmentFactories(
create_fake_url_loader_factory_for_cookie_requests)) {
TestChromeBrowserState::Builder& builder) {
for (auto& identity_factory : GetIdentityTestEnvironmentFactories()) {
builder.AddTestingFactory(identity_factory.first, identity_factory.second);
}
......@@ -70,10 +63,8 @@ IdentityTestEnvironmentChromeBrowserStateAdaptor::
// static
void IdentityTestEnvironmentChromeBrowserStateAdaptor::
SetIdentityTestEnvironmentFactoriesOnBrowserContext(
TestChromeBrowserState* browser_state,
bool create_fake_url_loader_factory_for_cookie_requests) {
for (const auto& factory_pair : GetIdentityTestEnvironmentFactories(
create_fake_url_loader_factory_for_cookie_requests)) {
TestChromeBrowserState* browser_state) {
for (const auto& factory_pair : GetIdentityTestEnvironmentFactories()) {
factory_pair.first->SetTestingFactory(browser_state, factory_pair.second);
}
}
......
......@@ -31,23 +31,20 @@ class IdentityTestEnvironmentChromeBrowserStateAdaptor {
// |create_fake_url_loader_factory_for_cookie_requests| to false.
static std::unique_ptr<TestChromeBrowserState>
CreateChromeBrowserStateForIdentityTestEnvironment(
const TestChromeBrowserState::TestingFactories& input_factories,
bool create_fake_url_loader_factory_for_cookie_requests = false);
const TestChromeBrowserState::TestingFactories& input_factories);
// Creates and returns a TestChromeBrowserState that has been configured with
// the given |builder|.
// See the above variant for comments on common parameters.
static std::unique_ptr<TestChromeBrowserState>
CreateChromeBrowserStateForIdentityTestEnvironment(
TestChromeBrowserState::Builder& builder,
bool create_fake_url_loader_factory_for_cookie_requests = false);
TestChromeBrowserState::Builder& builder);
// Sets the testing factories that identity::IdentityTestEnvironment
// requires explicitly on a Profile that is passed to it.
// See the above variant for comments on common parameters.
static void SetIdentityTestEnvironmentFactoriesOnBrowserContext(
TestChromeBrowserState* browser_state,
bool create_fake_url_loader_factory_for_cookie_requests = false);
TestChromeBrowserState* browser_state);
// Appends the set of testing factories that identity::IdentityTestEnvironment
// 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