Chromium Code Reviews| Index: content/public/test/test_browser_thread_bundle.cc |
| diff --git a/content/public/test/test_browser_thread_bundle.cc b/content/public/test/test_browser_thread_bundle.cc |
| index a7fdd7602757462d7d6ec8245224ee7b84f4e93a..402ccb368d17dcf418df41a2dab5d31fb7d9fa17 100644 |
| --- a/content/public/test/test_browser_thread_bundle.cc |
| +++ b/content/public/test/test_browser_thread_bundle.cc |
| @@ -7,6 +7,7 @@ |
| #include "base/logging.h" |
| #include "base/message_loop/message_loop.h" |
| #include "base/run_loop.h" |
| +#include "base/test/scoped_async_task_scheduler.h" |
| #include "base/test/scoped_task_scheduler.h" |
| #include "content/browser/browser_thread_impl.h" |
| #include "content/public/test/test_browser_thread.h" |
| @@ -55,7 +56,8 @@ TestBrowserThreadBundle::~TestBrowserThreadBundle() { |
| ui_thread_->Stop(); |
| base::RunLoop().RunUntilIdle(); |
| - task_scheduler_.reset(); |
| + scoped_async_task_scheduler_.reset(); |
| + scoped_task_scheduler_.reset(); |
| // |message_loop_| needs to explicitly go away before fake threads in order |
| // for DestructionObservers hooked to |message_loop_| to be able to invoke |
| @@ -86,8 +88,13 @@ void TestBrowserThreadBundle::Init() { |
| void TestBrowserThreadBundle::CreateThreads() { |
| DCHECK(!threads_created_); |
| - task_scheduler_.reset( |
| - new base::test::ScopedTaskScheduler(message_loop_.get())); |
| + if (options_ & REAL_TASK_SCHEDULER) { |
| + scoped_async_task_scheduler_.reset( |
| + new base::test::ScopedAsyncTaskScheduler()); |
|
robliao
2017/01/12 20:15:02
Should Async instead have been an option off of Sc
fdoray
2017/01/12 21:25:56
No. It is very convenient to be able to add a Scop
robliao
2017/01/12 21:31:03
Do we expect many uses of ScopedAsyncTaskScheduler
|
| + } else { |
| + scoped_task_scheduler_.reset( |
| + new base::test::ScopedTaskScheduler(message_loop_.get())); |
| + } |
| if (options_ & REAL_DB_THREAD) { |
| db_thread_.reset(new TestBrowserThread(BrowserThread::DB)); |