Index: ios/chrome/browser/browser_state/test_chrome_browser_state.mm |
diff --git a/ios/chrome/browser/browser_state/test_chrome_browser_state.mm b/ios/chrome/browser/browser_state/test_chrome_browser_state.mm |
index 1e5dd33a4fce4a0221580300ac34128f77e84d71..de4ba06c46c1a8cc0fa234e0c91e30dba036a949 100644 |
--- a/ios/chrome/browser/browser_state/test_chrome_browser_state.mm |
+++ b/ios/chrome/browser/browser_state/test_chrome_browser_state.mm |
@@ -360,9 +360,10 @@ void TestChromeBrowserState::DestroyHistoryService() { |
if (!history_service) |
return; |
+ base::RunLoop run_loop; |
+ |
history_service->ClearCachedDataForContextID(0); |
- history_service->SetOnBackendDestroyTask( |
- base::MessageLoop::QuitWhenIdleClosure()); |
+ history_service->SetOnBackendDestroyTask(run_loop.QuitWhenIdleClosure()); |
history_service->Shutdown(); |
history_service = nullptr; |
@@ -374,13 +375,11 @@ void TestChromeBrowserState::DestroyHistoryService() { |
// moving to the next test. Note: if this never terminates, somebody is |
// probably leaking a reference to the history backend, so it never calls |
// our destroy task. |
- base::MessageLoop::current()->Run(); |
+ run_loop.Run(); |
// Make sure we don't have any event pending that could disrupt the next |
// test. |
- base::ThreadTaskRunnerHandle::Get()->PostTask( |
- FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
- base::MessageLoop::current()->Run(); |
+ base::RunLoop().RunUntilIdle(); |
sdefresne
2016/09/07 11:06:36
Why use a second base::RunLoop() object here inste
fdoray
2016/09/07 13:16:03
A RunLoop can't be reused.
In the latest patch se
|
} |
syncable_prefs::TestingPrefServiceSyncable* |