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

[scheduling] Use ScopedTaskEnvironment instead of MessageLoop in storage_monitor

MessageLoop will go away, eventually.

BUG=891670

Change-Id: Ic4740c19ad445bb1974f12876732829b88148a01
Reviewed-on: https://chromium-review.googlesource.com/c/1352782Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#612713}
parent b2d301e2
......@@ -4,7 +4,6 @@
#include "components/storage_monitor/storage_monitor.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/waitable_event.h"
......@@ -24,7 +23,7 @@ void SetLatch(bool* called) {
namespace storage_monitor {
TEST(StorageMonitorTest, TestInitialize) {
base::MessageLoop message_loop;
base::test::ScopedTaskEnvironment task_environment;
TestStorageMonitor::Destroy();
TestStorageMonitor monitor;
EXPECT_FALSE(monitor.init_called());
......@@ -39,7 +38,7 @@ TEST(StorageMonitorTest, TestInitialize) {
TEST(StorageMonitorTest, DeviceAttachDetachNotifications) {
TestStorageMonitor::Destroy();
base::MessageLoop message_loop;
base::test::ScopedTaskEnvironment task_environment;
const std::string kDeviceId1 = "dcim:UUID:FFF0-0001";
const std::string kDeviceId2 = "dcim:UUID:FFF0-0002";
MockRemovableStorageObserver observer1;
......@@ -82,7 +81,7 @@ TEST(StorageMonitorTest, DeviceAttachDetachNotifications) {
TEST(StorageMonitorTest, GetAllAvailableStoragesEmpty) {
TestStorageMonitor::Destroy();
base::MessageLoop message_loop;
base::test::ScopedTaskEnvironment task_environment;
TestStorageMonitor monitor;
std::vector<StorageInfo> devices = monitor.GetAllAvailableStorages();
EXPECT_EQ(0U, devices.size());
......@@ -90,7 +89,7 @@ TEST(StorageMonitorTest, GetAllAvailableStoragesEmpty) {
TEST(StorageMonitorTest, GetAllAvailableStorageAttachDetach) {
TestStorageMonitor::Destroy();
base::MessageLoop message_loop;
base::test::ScopedTaskEnvironment task_environment;
TestStorageMonitor monitor;
const std::string kDeviceId1 = "dcim:UUID:FFF0-0042";
const base::FilePath kDevicePath1(FILE_PATH_LITERAL("/testfoo"));
......
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