Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: ash/mus/test/wm_test_helper.cc

Issue 2318223003: mash: Migrate wallpaper controllers to ash/common. (Closed)
Patch Set: Add base/test:test_support dep to ash/mus:unittests. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698