Index: components/history/core/browser/history_querying_unittest.cc |
diff --git a/components/history/core/browser/history_querying_unittest.cc b/components/history/core/browser/history_querying_unittest.cc |
index 535688c0fcdb96c424d24b4fe0ee46e64cf2fe6b..98dd62fa67ff4fe2e477e1edf0938747dd17a375 100644 |
--- a/components/history/core/browser/history_querying_unittest.cc |
+++ b/components/history/core/browser/history_querying_unittest.cc |
@@ -180,7 +180,8 @@ class HistoryQueryTest : public testing::Test { |
void TearDown() override { |
if (history_) { |
- history_->SetOnBackendDestroyTask(base::MessageLoop::QuitClosure()); |
+ history_->SetOnBackendDestroyTask( |
+ base::MessageLoop::QuitWhenIdleClosure()); |
history_->Cleanup(); |
history_.reset(); |
base::MessageLoop::current()->Run(); // Wait for the other thread. |
@@ -189,7 +190,8 @@ class HistoryQueryTest : public testing::Test { |
void QueryHistoryComplete(QueryResults* results) { |
results->Swap(&last_query_results_); |
- base::MessageLoop::current()->Quit(); // Will return out to QueryHistory. |
+ base::MessageLoop::current() |
+ ->QuitWhenIdle(); // Will return out to QueryHistory. |
} |
base::ScopedTempDir temp_dir_; |