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

Unified Diff: content/public/test/test_utils.cc

Issue 2564943002: Reland "Add thread checking to RunLoop, deprecate MessageLoopRunner. (patchset #4 id:20002 of https… (Closed)
Patch Set: Created 4 years 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 | « content/public/test/test_utils.h ('k') | extensions/test/result_catcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/test_utils.cc
diff --git a/content/public/test/test_utils.cc b/content/public/test/test_utils.cc
index a19a31d5aa36c9d1214c5c91a34c06ce96863b0b..4c6449df4a768ca0e90008041d931fabc39c98c3 100644
--- a/content/public/test/test_utils.cc
+++ b/content/public/test/test_utils.cc
@@ -120,23 +120,14 @@ void RunMessageLoop() {
void RunThisRunLoop(base::RunLoop* run_loop) {
base::MessageLoop::ScopedNestableTaskAllower allow(
base::MessageLoop::current());
-
- // If we're running inside a browser test, we might need to allow the test
- // launcher to do extra work before/after running a nested message loop.
- TestLauncherDelegate* delegate = NULL;
- delegate = GetCurrentTestLauncherDelegate();
- if (delegate)
- delegate->PreRunMessageLoop(run_loop);
run_loop->Run();
- if (delegate)
- delegate->PostRunMessageLoop();
}
void RunAllPendingInMessageLoop() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
base::RunLoop run_loop;
base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, GetQuitTaskForRunLoop(&run_loop));
+ FROM_HERE, GetDeferredQuitTaskForRunLoop(&run_loop));
RunThisRunLoop(&run_loop);
}
@@ -175,7 +166,7 @@ void RunAllBlockingPoolTasksUntilIdle() {
}
}
-base::Closure GetQuitTaskForRunLoop(base::RunLoop* run_loop) {
+base::Closure GetDeferredQuitTaskForRunLoop(base::RunLoop* run_loop) {
return base::Bind(&DeferredQuitRunLoop, run_loop->QuitClosure(),
kNumQuitDeferrals);
}
@@ -240,7 +231,7 @@ void MessageLoopRunner::Quit() {
if (loop_running_) {
switch (quit_mode_) {
case QuitMode::DEFERRED:
- GetQuitTaskForRunLoop(&run_loop_).Run();
+ GetDeferredQuitTaskForRunLoop(&run_loop_).Run();
break;
case QuitMode::IMMEDIATE:
run_loop_.Quit();
« no previous file with comments | « content/public/test/test_utils.h ('k') | extensions/test/result_catcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698