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

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: CR 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
« no previous file with comments | « no previous file | ios/web/webui/url_data_manager_ios_backend.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..37ecd8e95c61617840fd1e3394385da3bc8d6acb 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,7 @@ 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();
-
- // 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();
+ run_loop.Run();
}
syncable_prefs::TestingPrefServiceSyncable*
« no previous file with comments | « no previous file | ios/web/webui/url_data_manager_ios_backend.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698