diff options
author | hubbe <hubbe@chromium.org> | 2015-05-10 11:50:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-10 18:50:36 +0000 |
commit | e793a6d9dd7e5509e5ded123d602ce566efd8cb3 (patch) | |
tree | 2c28b272dfffae0e2ead4cdb629b7fcb75e50c74 /content | |
parent | 9e2363aa6322923af1fe5ed7dfdeb0d58fd709f9 (diff) | |
download | chromium_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.cc | 5 |
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) { |