Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: chrome/browser/chromeos/drive/file_system_unittest.cc

Issue 1124813003: [chrome/browser/chromeos/drive] Avoid use of MessageLoopProxy by use of TTRH (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/drive/file_system_unittest.cc
diff --git a/chrome/browser/chromeos/drive/file_system_unittest.cc b/chrome/browser/chromeos/drive/file_system_unittest.cc
index 2c22a657d950773d3a60898aad24d424f5b33ed6..375890274ec2641c3febab290e44a24e732efcf2 100644
--- a/chrome/browser/chromeos/drive/file_system_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system_unittest.cc
@@ -12,9 +12,10 @@
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/memory/scoped_ptr.h"
-#include "base/message_loop/message_loop_proxy.h"
#include "base/prefs/testing_pref_service.h"
#include "base/run_loop.h"
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "chrome/browser/chromeos/drive/change_list_loader.h"
#include "chrome/browser/chromeos/drive/drive.pb.h"
#include "chrome/browser/chromeos/drive/fake_free_disk_space_getter.h"
@@ -106,10 +107,9 @@ class FileSystemTest : public testing::Test {
fake_free_disk_space_getter_.reset(new FakeFreeDiskSpaceGetter);
- scheduler_.reset(new JobScheduler(pref_service_.get(),
- logger_.get(),
+ scheduler_.reset(new JobScheduler(pref_service_.get(), logger_.get(),
fake_drive_service_.get(),
- base::MessageLoopProxy::current().get()));
+ base::ThreadTaskRunnerHandle::Get()));
mock_directory_observer_.reset(new MockDirectoryChangeObserver);
@@ -120,33 +120,27 @@ class FileSystemTest : public testing::Test {
const base::FilePath metadata_dir = temp_dir_.path().AppendASCII("meta");
ASSERT_TRUE(base::CreateDirectory(metadata_dir));
metadata_storage_.reset(new internal::ResourceMetadataStorage(
- metadata_dir, base::MessageLoopProxy::current().get()));
+ metadata_dir, base::ThreadTaskRunnerHandle::Get()));
ASSERT_TRUE(metadata_storage_->Initialize());
const base::FilePath cache_dir = temp_dir_.path().AppendASCII("files");
ASSERT_TRUE(base::CreateDirectory(cache_dir));
- cache_.reset(new internal::FileCache(
- metadata_storage_.get(),
- cache_dir,
- base::MessageLoopProxy::current().get(),
- fake_free_disk_space_getter_.get()));
+ cache_.reset(new internal::FileCache(metadata_storage_.get(), cache_dir,
+ base::ThreadTaskRunnerHandle::Get(),
+ fake_free_disk_space_getter_.get()));
ASSERT_TRUE(cache_->Initialize());
- resource_metadata_.reset(new internal::ResourceMetadata(
- metadata_storage_.get(), cache_.get(),
- base::MessageLoopProxy::current()));
+ resource_metadata_.reset(
+ new internal::ResourceMetadata(metadata_storage_.get(), cache_.get(),
+ base::ThreadTaskRunnerHandle::Get()));
ASSERT_EQ(FILE_ERROR_OK, resource_metadata_->Initialize());
const base::FilePath temp_file_dir = temp_dir_.path().AppendASCII("tmp");
ASSERT_TRUE(base::CreateDirectory(temp_file_dir));
- file_system_.reset(new FileSystem(
- pref_service_.get(),
- logger_.get(),
- cache_.get(),
- scheduler_.get(),
- resource_metadata_.get(),
- base::MessageLoopProxy::current().get(),
- temp_file_dir));
+ file_system_.reset(
+ new FileSystem(pref_service_.get(), logger_.get(), cache_.get(),
+ scheduler_.get(), resource_metadata_.get(),
+ base::ThreadTaskRunnerHandle::Get(), temp_file_dir));
file_system_->AddObserver(mock_directory_observer_.get());
// Disable delaying so that the sync starts immediately.
@@ -222,21 +216,20 @@ class FileSystemTest : public testing::Test {
const base::FilePath metadata_dir = temp_dir_.path().AppendASCII("meta");
ASSERT_TRUE(base::CreateDirectory(metadata_dir));
scoped_ptr<internal::ResourceMetadataStorage,
- test_util::DestroyHelperForTests> metadata_storage(
- new internal::ResourceMetadataStorage(
- metadata_dir, base::MessageLoopProxy::current().get()));
+ test_util::DestroyHelperForTests>
+ metadata_storage(new internal::ResourceMetadataStorage(
+ metadata_dir, base::ThreadTaskRunnerHandle::Get()));
const base::FilePath cache_dir = temp_dir_.path().AppendASCII("files");
scoped_ptr<internal::FileCache, test_util::DestroyHelperForTests> cache(
- new internal::FileCache(metadata_storage.get(),
- cache_dir,
- base::MessageLoopProxy::current().get(),
+ new internal::FileCache(metadata_storage.get(), cache_dir,
+ base::ThreadTaskRunnerHandle::Get(),
fake_free_disk_space_getter_.get()));
scoped_ptr<internal::ResourceMetadata, test_util::DestroyHelperForTests>
resource_metadata(new internal::ResourceMetadata(
metadata_storage_.get(), cache.get(),
- base::MessageLoopProxy::current()));
+ base::ThreadTaskRunnerHandle::Get()));
ASSERT_EQ(FILE_ERROR_OK, resource_metadata->Initialize());

Powered by Google App Engine
This is Rietveld 408576698