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

Unified Diff: base/test/scoped_task_environment.cc

Issue 2893823003: Flush all TaskScheduler<->MainLoop tasks in ~TestBrowserThreadBundle() (Closed)
Patch Set: . Created 3 years, 7 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 | content/public/test/test_browser_thread_bundle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/scoped_task_environment.cc
diff --git a/base/test/scoped_task_environment.cc b/base/test/scoped_task_environment.cc
index 8ccf040a3fea88d3ca22114d07c5773a468cf001..672ffb053b542c5fc4b6b747a17f40076270acc2 100644
--- a/base/test/scoped_task_environment.cc
+++ b/base/test/scoped_task_environment.cc
@@ -55,8 +55,11 @@ ScopedTaskEnvironment::ScopedTaskEnvironment(MainThreadType main_thread_type)
}
ScopedTaskEnvironment::~ScopedTaskEnvironment() {
- // Intentionally do not RunLoop().RunUntilIdle() here as this simulates the
- // replaced base::~MessageLoop() behaviour better.
+ // Ideally this would RunLoop().RunUntilIdle() here to catch any errors or
+ // infinite post loop in the remaining work but this isn't possible right now
+ // because base::~MessageLoop() didn't use to do this and adding it here would
+ // make the migration away from MessageLoop that much harder.
+
DCHECK_EQ(TaskScheduler::GetInstance(), task_scheduler_);
// Without FlushForTesting(), DeleteSoon() and ReleaseSoon() tasks could be
// skipped, resulting in memory leaks.
« no previous file with comments | « no previous file | content/public/test/test_browser_thread_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698