Commit cfa59d94 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/profiles.

This CL was uploaded by git cl split.

R=skuhne@chromium.org

Bug: 809610
Change-Id: Ic45b0fc9fbeb570f14e193b37723234c6ab74ee3
Reviewed-on: https://chromium-review.googlesource.com/c/1257932Reviewed-by: default avatarStefan Kuhne <skuhne@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596677}
parent 2748f4c6
......@@ -4,6 +4,7 @@
#include "chrome/browser/profiles/profile_downloader.h"
#include "base/bind.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/profiles/profile_downloader_delegate.h"
......@@ -45,10 +46,12 @@ class ProfileDownloaderTest : public testing::Test,
void SetUp() override {
TestingProfile::Builder builder;
builder.AddTestingFactory(ProfileOAuth2TokenServiceFactory::GetInstance(),
&BuildFakeProfileOAuth2TokenService);
builder.AddTestingFactory(AccountFetcherServiceFactory::GetInstance(),
FakeAccountFetcherServiceBuilder::BuildForTests);
builder.AddTestingFactory(
ProfileOAuth2TokenServiceFactory::GetInstance(),
base::BindRepeating(&BuildFakeProfileOAuth2TokenService));
builder.AddTestingFactory(
AccountFetcherServiceFactory::GetInstance(),
base::BindRepeating(&FakeAccountFetcherServiceBuilder::BuildForTests));
profile_ = builder.Build();
account_tracker_service_ =
AccountTrackerServiceFactory::GetForProfile(profile_.get());
......
......@@ -167,8 +167,9 @@ class ProfileStatisticsBrowserTest : public InProcessBrowserTest {
// PasswordStore has not completed.
PasswordStoreFactory::GetInstance()->SetTestingFactory(
browser()->profile(),
password_manager::BuildPasswordStore<
content::BrowserContext, password_manager::TestPasswordStore>);
base::BindRepeating(
&password_manager::BuildPasswordStore<
content::BrowserContext, password_manager::TestPasswordStore>));
}
};
......
......@@ -10,6 +10,7 @@
#include <utility>
#include <vector>
#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/run_loop.h"
#include "base/task/post_task.h"
......@@ -58,7 +59,7 @@ void LoadBookmarkModel(Profile* profile,
bookmarks::BookmarkModel* CreateBookmarkModelWithoutLoad(Profile* profile) {
return static_cast<bookmarks::BookmarkModel*>(
BookmarkModelFactory::GetInstance()->SetTestingFactoryAndUse(
profile, BuildBookmarkModelWithoutLoad));
profile, base::BindRepeating(&BuildBookmarkModelWithoutLoad)));
}
class BookmarkStatHelper {
......@@ -106,8 +107,9 @@ TEST_F(ProfileStatisticsTest, WaitOrCountBookmarks) {
profile->CreateWebDataService();
PasswordStoreFactory::GetInstance()->SetTestingFactory(
profile,
password_manager::BuildPasswordStore<
content::BrowserContext, password_manager::TestPasswordStore>);
base::BindRepeating(
&password_manager::BuildPasswordStore<
content::BrowserContext, password_manager::TestPasswordStore>));
bookmarks::BookmarkModel* bookmark_model =
CreateBookmarkModelWithoutLoad(profile);
......
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