Commit 2bf5a304 authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

Use ScopedTaskEnvironment instead of MessageLoop in /chromeos/components/tether

MessageLoop will go away, eventually.

ScopedTaskEnvironment will per default start a ThreadPool, which should
be fine in most of the cases. If you belive your test needs to make sure
that no ThreadPool runs let me know and I will update the patch.

BUG=891670
This CL was uploaded by git cl split.

R=hansberry@chromium.org

Change-Id: I3659594870f528f8fa4523aeace161c246614ab2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1649372
Auto-Submit: Carlos Caballero <carlscab@google.com>
Reviewed-by: default avatarRyan Hansberry <hansberry@chromium.org>
Commit-Queue: Ryan Hansberry <hansberry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667306}
parent 770762cd
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h" #include "base/test/scoped_task_environment.h"
#include "chromeos/components/tether/fake_active_host.h" #include "chromeos/components/tether/fake_active_host.h"
#include "chromeos/network/network_state.h" #include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h" #include "chromeos/network/network_state_handler.h"
...@@ -98,7 +98,7 @@ class ActiveHostNetworkStateUpdaterTest : public testing::Test { ...@@ -98,7 +98,7 @@ class ActiveHostNetworkStateUpdaterTest : public testing::Test {
EXPECT_TRUE(network_state->IsConnectedState()); EXPECT_TRUE(network_state->IsConnectedState());
} }
base::MessageLoop message_loop_; base::test::ScopedTaskEnvironment scoped_task_environment_;
NetworkStateTestHelper helper_{true /* use_default_devices_and_services */}; NetworkStateTestHelper helper_{true /* use_default_devices_and_services */};
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/test/metrics/histogram_tester.h" #include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_task_environment.h"
#include "chromeos/components/multidevice/remote_device_ref.h" #include "chromeos/components/multidevice/remote_device_ref.h"
#include "chromeos/components/multidevice/remote_device_test_util.h" #include "chromeos/components/multidevice/remote_device_test_util.h"
#include "chromeos/components/tether/connect_tethering_operation.h" #include "chromeos/components/tether/connect_tethering_operation.h"
...@@ -313,7 +313,7 @@ class TetherConnectorImplTest : public testing::Test { ...@@ -313,7 +313,7 @@ class TetherConnectorImplTest : public testing::Test {
} }
const multidevice::RemoteDeviceRefList test_devices_; const multidevice::RemoteDeviceRefList test_devices_;
const base::MessageLoop message_loop_; base::test::ScopedTaskEnvironment scoped_task_environment_;
NetworkStateTestHelper helper_{true /* use_default_devices_and_services */}; NetworkStateTestHelper helper_{true /* use_default_devices_and_services */};
std::unique_ptr<FakeConnectTetheringOperationFactory> fake_operation_factory_; std::unique_ptr<FakeConnectTetheringOperationFactory> fake_operation_factory_;
......
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