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

Unified Diff: components/history/core/browser/history_service_unittest.cc

Issue 1144153004: components: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 7 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: components/history/core/browser/history_service_unittest.cc
diff --git a/components/history/core/browser/history_service_unittest.cc b/components/history/core/browser/history_service_unittest.cc
index 160198843ab87e23ec53ce9dfd47d23ec145e950..d333526420942c265cc3c88c43328d3ee39318e6 100644
--- a/components/history/core/browser/history_service_unittest.cc
+++ b/components/history/core/browser/history_service_unittest.cc
@@ -21,8 +21,11 @@
#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/single_thread_task_runner.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/thread_task_runner_handle.h"
#include "components/history/core/browser/history_database_params.h"
#include "components/history/core/browser/history_db_task.h"
#include "components/history/core/test/database_test_utils.h"
@@ -75,8 +78,8 @@ class HistoryServiceTest : public testing::Test {
// Make sure we don't have any event pending that could disrupt the next
// test.
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::MessageLoop::QuitClosure());
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::MessageLoop::QuitClosure());
base::MessageLoop::current()->Run();
}
@@ -678,10 +681,9 @@ void CheckDirectiveProcessingResult(
}
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100));
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&CheckDirectiveProcessingResult, timeout,
- change_processor, num_changes));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&CheckDirectiveProcessingResult, timeout,
+ change_processor, num_changes));
}
// Create a delete directive for a few specific history entries,
@@ -748,7 +750,7 @@ TEST_F(HistoryServiceTest, ProcessGlobalIdDeleteDirective) {
// Inject a task to check status and keep message loop filled before directive
// processing finishes.
- base::MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(&CheckDirectiveProcessingResult,
base::Time::Now() + base::TimeDelta::FromSeconds(10),
@@ -833,7 +835,7 @@ TEST_F(HistoryServiceTest, ProcessTimeRangeDeleteDirective) {
// Inject a task to check status and keep message loop filled before
// directive processing finishes.
- base::MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(&CheckDirectiveProcessingResult,
base::Time::Now() + base::TimeDelta::FromSeconds(10),
« no previous file with comments | « components/history/core/browser/history_service.cc ('k') | components/history/core/browser/top_sites_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698