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

Unified Diff: content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc

Issue 1170623003: Revert "content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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: content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc
diff --git a/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc b/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc
index bbcae168c8a8c2f579f7d4295f4dfdcf07350e65..451353d1cd91e7bfe12797da0cef158340157a96 100644
--- a/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc
+++ b/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc
@@ -9,11 +9,9 @@
#include "base/bind.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
-#include "base/location.h"
+#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
-#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
-#include "base/thread_task_runner_handle.h"
#include "content/browser/quota/mock_quota_manager.h"
#include "content/browser/quota/mock_quota_manager_proxy.h"
#include "content/public/test/async_file_test_helper.h"
@@ -81,7 +79,7 @@ class TestValidatorFactory : public storage::CopyOrMoveFileValidatorFactory {
void StartPreWriteValidation(
const ResultCallback& result_callback) override {
// Post the result since a real validator must do work asynchronously.
- base::ThreadTaskRunnerHandle::Get()->PostTask(
+ base::MessageLoop::current()->PostTask(
FROM_HERE, base::Bind(result_callback, result_));
}
@@ -94,7 +92,7 @@ class TestValidatorFactory : public storage::CopyOrMoveFileValidatorFactory {
result = base::File::FILE_ERROR_SECURITY;
}
// Post the result since a real validator must do work asynchronously.
- base::ThreadTaskRunnerHandle::Get()->PostTask(
+ base::MessageLoop::current()->PostTask(
FROM_HERE, base::Bind(result_callback, result));
}
@@ -149,7 +147,7 @@ class ScopedThreadStopper {
if (thread_) {
// Give another chance for deleted streams to perform Close.
base::RunLoop run_loop;
- thread_->task_runner()->PostTaskAndReply(
+ thread_->message_loop_proxy()->PostTaskAndReply(
FROM_HERE, base::Bind(&base::DoNothing), run_loop.QuitClosure());
run_loop.Run();
thread_->Stop();
@@ -193,12 +191,13 @@ class CopyOrMoveOperationTestHelper {
ASSERT_TRUE(base_.CreateUniqueTempDir());
base::FilePath base_dir = base_.path();
quota_manager_ =
- new MockQuotaManager(false /* is_incognito */, base_dir,
- base::ThreadTaskRunnerHandle::Get().get(),
- base::ThreadTaskRunnerHandle::Get().get(),
- NULL /* special storage policy */);
+ new MockQuotaManager(false /* is_incognito */,
+ base_dir,
+ base::MessageLoopProxy::current().get(),
+ base::MessageLoopProxy::current().get(),
+ NULL /* special storage policy */);
quota_manager_proxy_ = new MockQuotaManagerProxy(
- quota_manager_.get(), base::ThreadTaskRunnerHandle::Get().get());
+ quota_manager_.get(), base::MessageLoopProxy::current().get());
file_system_context_ =
CreateFileSystemContextForTesting(quota_manager_proxy_.get(), base_dir);
@@ -729,8 +728,8 @@ TEST(LocalFileSystemCopyOrMoveOperationTest, StreamCopyHelper) {
ScopedThreadStopper thread_stopper(&file_thread);
ASSERT_TRUE(thread_stopper.is_valid());
- scoped_refptr<base::SingleThreadTaskRunner> task_runner =
- file_thread.task_runner();
+ scoped_refptr<base::MessageLoopProxy> task_runner =
+ file_thread.message_loop_proxy();
scoped_ptr<storage::FileStreamReader> reader(
storage::FileStreamReader::CreateForLocalFile(
@@ -785,8 +784,8 @@ TEST(LocalFileSystemCopyOrMoveOperationTest, StreamCopyHelperWithFlush) {
ScopedThreadStopper thread_stopper(&file_thread);
ASSERT_TRUE(thread_stopper.is_valid());
- scoped_refptr<base::SingleThreadTaskRunner> task_runner =
- file_thread.task_runner();
+ scoped_refptr<base::MessageLoopProxy> task_runner =
+ file_thread.message_loop_proxy();
scoped_ptr<storage::FileStreamReader> reader(
storage::FileStreamReader::CreateForLocalFile(
@@ -836,8 +835,8 @@ TEST(LocalFileSystemCopyOrMoveOperationTest, StreamCopyHelper_Cancel) {
ScopedThreadStopper thread_stopper(&file_thread);
ASSERT_TRUE(thread_stopper.is_valid());
- scoped_refptr<base::SingleThreadTaskRunner> task_runner =
- file_thread.task_runner();
+ scoped_refptr<base::MessageLoopProxy> task_runner =
+ file_thread.message_loop_proxy();
scoped_ptr<storage::FileStreamReader> reader(
storage::FileStreamReader::CreateForLocalFile(
@@ -855,7 +854,7 @@ TEST(LocalFileSystemCopyOrMoveOperationTest, StreamCopyHelper_Cancel) {
base::TimeDelta()); // For testing, we need all the progress.
// Call Cancel() later.
- base::ThreadTaskRunnerHandle::Get()->PostTask(
+ base::MessageLoopProxy::current()->PostTask(
FROM_HERE,
base::Bind(&CopyOrMoveOperationDelegate::StreamCopyHelper::Cancel,
base::Unretained(&helper)));
« no previous file with comments | « content/browser/fileapi/copy_or_move_file_validator_unittest.cc ('k') | content/browser/fileapi/dragged_file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698