summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorhubbe <hubbe@chromium.org>2015-05-10 11:50:06 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-10 18:50:36 +0000
commite793a6d9dd7e5509e5ded123d602ce566efd8cb3 (patch)
tree2c28b272dfffae0e2ead4cdb629b7fcb75e50c74 /content
parent9e2363aa6322923af1fe5ed7dfdeb0d58fd709f9 (diff)
downloadchromium_src-e793a6d9dd7e5509e5ded123d602ce566efd8cb3.zip
chromium_src-e793a6d9dd7e5509e5ded123d602ce566efd8cb3.tar.gz
chromium_src-e793a6d9dd7e5509e5ded123d602ce566efd8cb3.tar.bz2
Make IN_PROC_BROWSER_TEST and RunExtension(Sub)test() more stable.
... by replacing QuitWhenIdle with deferred quits. QuitWhenIdle is a race condition by design, and can prevent tests from exiting when a machine is under heavy load. (Possibly, because of the test itself.) With this change, tests exits predictably, regardless of load. BUG=177163 Review URL: https://codereview.chromium.org/1135503003 Cr-Commit-Position: refs/heads/master@{#329080}
Diffstat (limited to 'content')
-rw-r--r--content/public/test/test_utils.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/content/public/test/test_utils.cc b/content/public/test/test_utils.cc
index 566410d..2fa45c0 100644
--- a/content/public/test/test_utils.cc
+++ b/content/public/test/test_utils.cc
@@ -126,9 +126,10 @@ void RunThisRunLoop(base::RunLoop* run_loop) {
}
void RunAllPendingInMessageLoop() {
+ base::RunLoop run_loop;
base::MessageLoop::current()->PostTask(
- FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
- RunMessageLoop();
+ FROM_HERE, GetQuitTaskForRunLoop(&run_loop));
+ RunThisRunLoop(&run_loop);
}
void RunAllPendingInMessageLoop(BrowserThread::ID thread_id) {