Skip to content

Commit

Permalink
Convert indirect uses of TestingFactoryFunction
Browse files Browse the repository at this point in the history
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//extensions/browser/api.

This CL was uploaded by git cl split.

R=tbarzic@chromium.org

Bug: 809610
Change-Id: Id9e8d81f60c29865b75ea219472a029c0ba7e487
Reviewed-on: https://chromium-review.googlesource.com/c/1257793
Reviewed-by: Toni Baržić <tbarzic@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597046}
  • Loading branch information
sdefresne authored and Commit Bot committed Oct 5, 2018
1 parent 73b803d commit 24c3dae
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <limits>

#include "base/bind.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/fake_power_manager_client.h"
#include "extensions/browser/api/system_power_source/system_power_source_api.h"
Expand Down Expand Up @@ -341,7 +342,8 @@ TEST_F(SystemPowerSourceApiUnitTest, GetPowerSourceRounding) {
TEST_F(SystemPowerSourceApiUnitTest, OnPowerChangedEvent) {
TestEventRouter* event_router = static_cast<TestEventRouter*>(
EventRouterFactory::GetInstance()->SetTestingFactoryAndUse(
browser_context(), &TestEventRouterFactoryFunction));
browser_context(),
base::BindRepeating(&TestEventRouterFactoryFunction)));
SystemPowerSourceAPI system_power_source_api(browser_context());

power_manager_client_->UpdatePowerProperties(MakePowerSupplyProperties(
Expand All @@ -365,7 +367,8 @@ TEST_F(SystemPowerSourceApiUnitTest, OnPowerChangedEvent) {
TEST_F(SystemPowerSourceApiUnitTest, RequestStatusUpdate) {
TestEventRouter* event_router = static_cast<TestEventRouter*>(
EventRouterFactory::GetInstance()->SetTestingFactoryAndUse(
browser_context(), &TestEventRouterFactoryFunction));
browser_context(),
base::BindRepeating(&TestEventRouterFactoryFunction)));
SystemPowerSourceAPI system_power_source_api(browser_context());

power_manager_client_->UpdatePowerProperties(MakePowerSupplyProperties(
Expand Down

0 comments on commit 24c3dae

Please sign in to comment.