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

Unified Diff: ios/chrome/browser/browser_state/test_chrome_browser_state.mm

Issue 2314243002: Remove calls to deprecated MessageLoop methods in ios. (Closed)
Patch Set: Created 4 years, 3 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: 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*
« no previous file with comments | « no previous file | ios/web/webui/url_data_manager_ios_backend.mm » ('j') | ios/web/webui/url_data_manager_ios_backend.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698