Commit 045d82cd authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

Use ScopedTaskEnvironment instead of MessageLoop in...

Use ScopedTaskEnvironment instead of MessageLoop in /chrome/browser/chromeos/extensions/file_manager

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

Change-Id: Ie1df92f584a7ee5cce3f3fd2b91db6bd00fa709c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1649678
Auto-Submit: Carlos Caballero <carlscab@google.com>
Reviewed-by: default avatarJoel Hockey <joelhockey@chromium.org>
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667339}
parent be6b0633
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
#include <vector> #include <vector>
#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/scoped_task_environment.h"
#include "chrome/browser/chromeos/file_manager/volume_manager.h" #include "chrome/browser/chromeos/file_manager/volume_manager.h"
#include "chromeos/disks/disk.h" #include "chromeos/disks/disk.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -86,7 +86,7 @@ class DeviceEventRouterTest : public testing::Test { ...@@ -86,7 +86,7 @@ class DeviceEventRouterTest : public testing::Test {
std::unique_ptr<DeviceEventRouterImpl> device_event_router; std::unique_ptr<DeviceEventRouterImpl> device_event_router;
private: private:
base::MessageLoop message_loop_; base::test::ScopedTaskEnvironment scoped_task_environment_;
}; };
TEST_F(DeviceEventRouterTest, AddAndRemoveDevice) { TEST_F(DeviceEventRouterTest, AddAndRemoveDevice) {
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/test/scoped_task_environment.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
namespace file_manager { namespace file_manager {
...@@ -94,7 +94,7 @@ class JobEventRouterTest : public testing::Test { ...@@ -94,7 +94,7 @@ class JobEventRouterTest : public testing::Test {
std::unique_ptr<JobEventRouterImpl> job_event_router; std::unique_ptr<JobEventRouterImpl> job_event_router;
private: private:
base::MessageLoop message_loop_; base::test::ScopedTaskEnvironment scoped_task_environment_;
}; };
TEST_F(JobEventRouterTest, Basic) { TEST_F(JobEventRouterTest, Basic) {
......
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