Commit 1b257b0d 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/autocomplete.

This CL was uploaded by git cl split.

R=tommycli@chromium.org

Bug: 809610
Change-Id: I5c6588a869225aeefef8b6d8198d92678a2d7642
Reviewed-on: https://chromium-review.googlesource.com/c/1259028
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596640}
parent 4fb3a475
......@@ -8,6 +8,7 @@
#include <string>
#include "base/bind.h"
#include "base/command_line.h"
#include "base/macros.h"
#include "base/metrics/field_trial.h"
......@@ -294,7 +295,8 @@ void SearchProviderTest::SetUp() {
// We need both the history service and template url model loaded.
ASSERT_TRUE(profile_.CreateHistoryService(true, false));
TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse(
&profile_, &TemplateURLServiceFactory::BuildInstanceFor);
&profile_,
base::BindRepeating(&TemplateURLServiceFactory::BuildInstanceFor));
TemplateURLService* turl_model =
TemplateURLServiceFactory::GetForProfile(&profile_);
......@@ -331,7 +333,8 @@ void SearchProviderTest::SetUp() {
profile_.BlockUntilHistoryProcessesPendingRequests();
AutocompleteClassifierFactory::GetInstance()->SetTestingFactoryAndUse(
&profile_, &AutocompleteClassifierFactory::BuildInstanceFor);
&profile_,
base::BindRepeating(&AutocompleteClassifierFactory::BuildInstanceFor));
client_.reset(
new TestAutocompleteProviderClient(&profile_, &test_url_loader_factory_));
......
......@@ -8,6 +8,7 @@
#include <string>
#include <vector>
#include "base/bind.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
......@@ -67,7 +68,9 @@ ShortcutsProviderExtensionTest::ShortcutsProviderExtensionTest()
void ShortcutsProviderExtensionTest::SetUp() {
ShortcutsBackendFactory::GetInstance()->SetTestingFactoryAndUse(
&profile_, &ShortcutsBackendFactory::BuildProfileNoDatabaseForTesting);
&profile_,
base::BindRepeating(
&ShortcutsBackendFactory::BuildProfileNoDatabaseForTesting));
backend_ = ShortcutsBackendFactory::GetForProfile(&profile_);
ASSERT_TRUE(backend_.get());
ASSERT_TRUE(profile_.CreateHistoryService(true, false));
......
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