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 c0c4b4f5f965834fd74aa3380f01b8318787c612..904ef680d81d2d9738a23d07720b8695432df43d 100644 |
| --- a/content/public/test/test_browser_thread_bundle.cc |
| +++ b/content/public/test/test_browser_thread_bundle.cc |
| @@ -9,6 +9,7 @@ |
| #include "base/message_loop/message_loop.h" |
| #include "base/run_loop.h" |
| #include "base/test/scoped_async_task_scheduler.h" |
| +#include "base/threading/sequenced_worker_pool.h" |
| #include "content/browser/browser_thread_impl.h" |
| #include "content/public/test/test_browser_thread.h" |
| @@ -58,6 +59,9 @@ TestBrowserThreadBundle::~TestBrowserThreadBundle() { |
| scoped_async_task_scheduler_.reset(); |
| + // Disable redirection of SequencedWorkerPools to TaskScheduler. |
| + base::SequencedWorkerPool::EnableForProcess(); |
|
gab
2017/03/22 16:23:30
Do we need this? Sounds better to have tasks be re
fdoray
2017/04/03 14:57:28
In TestBrowserThreadBundle::CreateThreads(), we en
gab
2017/04/03 16:56:17
I see expand comment here then, something like:
/
|
| + |
| // |message_loop_| needs to explicitly go away before fake threads in order |
| // for DestructionObservers hooked to |message_loop_| to be able to invoke |
| // BrowserThread::CurrentlyOn() -- ref. ~TestBrowserThread(). |
| @@ -93,6 +97,9 @@ void TestBrowserThreadBundle::CreateThreads() { |
| scoped_async_task_scheduler_ = |
| base::MakeUnique<base::test::ScopedAsyncTaskScheduler>(); |
| + // Enable redirection of SequencedWorkerPools to TaskScheduler. |
| + base::SequencedWorkerPool::EnableWithRedirectionToTaskSchedulerForProcess(); |
| + |
| if (options_ & REAL_DB_THREAD) { |
| db_thread_.reset(new TestBrowserThread(BrowserThread::DB)); |
| db_thread_->Start(); |