Index: content/public/test/test_utils.cc |
diff --git a/content/public/test/test_utils.cc b/content/public/test/test_utils.cc |
index 4afe2321e9f3f4c021831dc3857db3582e9991a7..95c8d987d619b0c124c2b2b2ace9c2c2a43492cb 100644 |
--- a/content/public/test/test_utils.cc |
+++ b/content/public/test/test_utils.cc |
@@ -13,6 +13,7 @@ |
#include "base/run_loop.h" |
#include "base/single_thread_task_runner.h" |
#include "base/strings/utf_string_conversions.h" |
+#include "base/task_scheduler/task_scheduler.h" |
#include "base/threading/sequenced_worker_pool.h" |
#include "base/threading/thread_task_runner_handle.h" |
#include "base/values.h" |
@@ -157,8 +158,13 @@ void RunAllPendingInMessageLoop(BrowserThread::ID thread_id) { |
void RunAllBlockingPoolTasksUntilIdle() { |
while (true) { |
+ // Flush blocking pool tasks. |
robliao
2017/03/17 01:00:14
Remove this comment as it's stating what the next
fdoray
2017/03/31 20:26:04
Removed unnecessary comment.
I have a few CLs to
|
content::BrowserThread::GetBlockingPool()->FlushForTesting(); |
+ // Also flush TaskScheduler tasks since all blocking pool call sites are |
+ // being migrated to TaskScheduler. |
+ base::TaskScheduler::GetInstance()->FlushForTesting(); |
+ |
TaskObserver task_observer; |
base::MessageLoop::current()->AddTaskObserver(&task_observer); |
base::RunLoop().RunUntilIdle(); |