Commit b0015ebc authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Convert indirect uses of TestingFactoryFunction

TestingFactoryFunction is a simple function pointer. It is
deprecated in favor of TestingFactory which is a Callback<>.
Convert indirect uses by using base::BindRepeating() in all
invocation of SetTestingFactory/AddTestingFactory.

This converts uses in src//chrome/browser/ui/webui/signin.

This CL was uploaded by git cl split.

R=rogerta@chromium.org

Bug: 809610
Change-Id: Ib267c7d43afb0b4682fa8232431169012389e732
Reviewed-on: https://chromium-review.googlesource.com/c/1259004Reviewed-by: default avatarRoger Tawa <rogerta@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596675}
parent acf7561e
......@@ -189,19 +189,22 @@ class DiceTurnSyncOnHelperTestBase : public testing::Test {
TestingProfile::Builder profile_builder;
profile_builder.AddTestingFactory(
ProfileOAuth2TokenServiceFactory::GetInstance(),
BuildFakeProfileOAuth2TokenService);
profile_builder.AddTestingFactory(SigninManagerFactory::GetInstance(),
BuildFakeSigninManagerBase);
profile_builder.AddTestingFactory(ChromeSigninClientFactory::GetInstance(),
signin::BuildTestSigninClient);
profile_builder.AddTestingFactory(ProfileSyncServiceFactory::GetInstance(),
&BuildMockProfileSyncService);
base::BindRepeating(&BuildFakeProfileOAuth2TokenService));
profile_builder.AddTestingFactory(
SigninManagerFactory::GetInstance(),
base::BindRepeating(&BuildFakeSigninManagerBase));
profile_builder.AddTestingFactory(
ChromeSigninClientFactory::GetInstance(),
base::BindRepeating(&signin::BuildTestSigninClient));
profile_builder.AddTestingFactory(
ProfileSyncServiceFactory::GetInstance(),
base::BindRepeating(&BuildMockProfileSyncService));
profile_builder.AddTestingFactory(
policy::UserPolicySigninServiceFactory::GetInstance(),
&FakeUserPolicySigninService::Build);
base::BindRepeating(&FakeUserPolicySigninService::Build));
profile_builder.AddTestingFactory(
UnifiedConsentServiceFactory::GetInstance(),
&BuildUnifiedConsentServiceForTesting);
base::BindRepeating(&BuildUnifiedConsentServiceForTesting));
profile_ = profile_builder.Build();
account_tracker_service_ =
AccountTrackerServiceFactory::GetForProfile(profile());
......
......@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/bind.h"
#include "base/command_line.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
......@@ -468,9 +469,9 @@ class InlineLoginHelperBrowserTest : public InProcessBrowserTest {
// creating the browser so that a bunch of classes don't register as
// observers and end up needing to unregister when the fake is substituted.
SigninManagerFactory::GetInstance()->SetTestingFactory(
context, &BuildFakeSigninManagerBase);
context, base::BindRepeating(&BuildFakeSigninManagerBase));
ProfileOAuth2TokenServiceFactory::GetInstance()->SetTestingFactory(
context, &BuildFakeProfileOAuth2TokenService);
context, base::BindRepeating(&BuildFakeProfileOAuth2TokenService));
}
void SetUp() override {
......
......@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/bind.h"
#include "base/command_line.h"
#include "base/run_loop.h"
#include "base/strings/string_util.h"
......@@ -164,7 +165,7 @@ IN_PROC_BROWSER_TEST_F(UserManagerUIAuthenticatedUserBrowserTest,
entry_->SetSupervisedUserId("supervised_user_id");
MockLoginUIService* service = static_cast<MockLoginUIService*>(
LoginUIServiceFactory::GetInstance()->SetTestingFactoryAndUse(
profile_, CreateLoginUIService));
profile_, base::BindRepeating(&CreateLoginUIService)));
EXPECT_CALL(*service, DisplayLoginResult(_, _, _));
LaunchAuthenticatedUser("");
......@@ -181,7 +182,7 @@ IN_PROC_BROWSER_TEST_F(UserManagerUIAuthenticatedUserBrowserTest,
entry_->SetActiveTimeToNow();
MockLoginUIService* service = static_cast<MockLoginUIService*>(
LoginUIServiceFactory::GetInstance()->SetTestingFactoryAndUse(
profile_, CreateLoginUIService));
profile_, base::BindRepeating(&CreateLoginUIService)));
EXPECT_CALL(*service, SetProfileBlockingErrorMessage());
LaunchAuthenticatedUser("");
......
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