Index: ash/mus/test/wm_test_helper.cc |
diff --git a/ash/mus/test/wm_test_helper.cc b/ash/mus/test/wm_test_helper.cc |
index 94ac00171adfa50e480fda94ad2465c953d35f7b..fa72ce2194a58861c8fb8b2a0de51cbce860eaec 100644 |
--- a/ash/mus/test/wm_test_helper.cc |
+++ b/ash/mus/test/wm_test_helper.cc |
@@ -28,6 +28,10 @@ WmTestHelper::~WmTestHelper() { |
// Needs to be destroyed before material design. |
window_manager_app_.reset(); |
+ base::RunLoop().RunUntilIdle(); |
+ blocking_pool_owner_.reset(); |
+ base::RunLoop().RunUntilIdle(); |
+ |
ash::test::MaterialDesignControllerTestAPI::Uninitialize(); |
ui::test::MaterialDesignControllerTestAPI::Uninitialize(); |
} |
@@ -39,6 +43,12 @@ void WmTestHelper::Init() { |
window_manager_app_ = base::MakeUnique<WindowManagerApplication>(); |
message_loop_.reset(new base::MessageLoopForUI()); |
+ |
+ const size_t kMaxNumberThreads = 3u; // Matches that of content. |
+ const char kThreadNamePrefix[] = "MashBlockingForTesting"; |
+ blocking_pool_owner_ = base::MakeUnique<base::SequencedWorkerPoolOwner>( |
+ kMaxNumberThreads, kThreadNamePrefix); |
+ |
window_manager_app_->window_manager_.reset(new WindowManager(nullptr)); |
screen_ = new WmTestScreen; |
window_manager_app_->window_manager_->screen_.reset(screen_); |
@@ -57,7 +67,8 @@ void WmTestHelper::Init() { |
window_manager_app_->window_manager_.get(), display); |
window_manager_app_->InitWindowManager( |
- window_tree_client_setup_.OwnWindowTreeClient()); |
+ window_tree_client_setup_.OwnWindowTreeClient(), |
+ blocking_pool_owner_->pool()); |
ui::WindowTreeClient* window_tree_client = |
window_manager_app_->window_manager()->window_tree_client(); |