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), |