Commit a2a02d01 authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

Use ScopedTaskEnvironment instead of MessageLoop

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=bajones@chromium.org

Change-Id: Icf167d4cc8395db1bad4cc2252b4acb8bbb5c691
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1635613Reviewed-by: default avatarBrandon Jones <bajones@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Auto-Submit: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#664839}
parent 22e874da
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
#include "services/device/public/cpp/power_monitor/power_monitor_broadcast_source.h" #include "services/device/public/cpp/power_monitor/power_monitor_broadcast_source.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/test/power_monitor_test_base.h" #include "base/test/power_monitor_test_base.h"
#include "base/test/scoped_task_environment.h"
#include "base/threading/sequenced_task_runner_handle.h" #include "base/threading/sequenced_task_runner_handle.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -38,7 +38,7 @@ class PowerMonitorBroadcastSourceTest : public testing::Test { ...@@ -38,7 +38,7 @@ class PowerMonitorBroadcastSourceTest : public testing::Test {
base::PowerMonitor* monitor() { return power_monitor_.get(); } base::PowerMonitor* monitor() { return power_monitor_.get(); }
base::MessageLoop message_loop_; base::test::ScopedTaskEnvironment scoped_task_environment_;
private: private:
PowerMonitorBroadcastSource* power_monitor_source_ptr_; PowerMonitorBroadcastSource* power_monitor_source_ptr_;
......
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