Commit 9afa0fc3 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/browsing_data.

This CL was uploaded by git cl split.

R=markusheintz@chromium.org

Bug: 809610
Change-Id: Ie7a9a867b2214dd56e7c54fcf8328dc02cc0b4ea
Reviewed-on: https://chromium-review.googlesource.com/c/1258361
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarMartin Šrámek <msramek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601643}
parent 335d60d5
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "base/bind.h"
#include "base/containers/flat_set.h" #include "base/containers/flat_set.h"
#include "base/guid.h" #include "base/guid.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
...@@ -619,7 +620,7 @@ class ClearDomainReliabilityTester { ...@@ -619,7 +620,7 @@ class ClearDomainReliabilityTester {
// Set and use factory that will attach service stuffed in kludgey struct. // Set and use factory that will attach service stuffed in kludgey struct.
DomainReliabilityServiceFactory::GetInstance()->SetTestingFactoryAndUse( DomainReliabilityServiceFactory::GetInstance()->SetTestingFactoryAndUse(
profile_, profile_,
&TestingDomainReliabilityServiceFactoryFunction); base::BindRepeating(&TestingDomainReliabilityServiceFactoryFunction));
// Verify and detach kludgey struct. // Verify and detach kludgey struct.
EXPECT_EQ(data, profile_->GetUserData(kKey)); EXPECT_EQ(data, profile_->GetUserData(kKey));
...@@ -636,9 +637,10 @@ class RemovePasswordsTester { ...@@ -636,9 +637,10 @@ class RemovePasswordsTester {
explicit RemovePasswordsTester(TestingProfile* testing_profile) { explicit RemovePasswordsTester(TestingProfile* testing_profile) {
PasswordStoreFactory::GetInstance()->SetTestingFactoryAndUse( PasswordStoreFactory::GetInstance()->SetTestingFactoryAndUse(
testing_profile, testing_profile,
password_manager::BuildPasswordStore< base::BindRepeating(
content::BrowserContext, &password_manager::BuildPasswordStore<
testing::NiceMock<password_manager::MockPasswordStore>>); content::BrowserContext,
testing::NiceMock<password_manager::MockPasswordStore>>));
store_ = static_cast<password_manager::MockPasswordStore*>( store_ = static_cast<password_manager::MockPasswordStore*>(
PasswordStoreFactory::GetInstance() PasswordStoreFactory::GetInstance()
...@@ -1194,7 +1196,7 @@ class ChromeBrowsingDataRemoverDelegateTest : public testing::Test { ...@@ -1194,7 +1196,7 @@ class ChromeBrowsingDataRemoverDelegateTest : public testing::Test {
remover_ = content::BrowserContext::GetBrowsingDataRemover(profile_.get()); remover_ = content::BrowserContext::GetBrowsingDataRemover(profile_.get());
ProtocolHandlerRegistryFactory::GetInstance()->SetTestingFactory( ProtocolHandlerRegistryFactory::GetInstance()->SetTestingFactory(
profile_.get(), &BuildProtocolHandlerRegistry); profile_.get(), base::BindRepeating(&BuildProtocolHandlerRegistry));
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
static_cast<ChromeBrowsingDataRemoverDelegate*>( static_cast<ChromeBrowsingDataRemoverDelegate*>(
......
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