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

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

Issue 2318223003: mash: Migrate wallpaper controllers to ash/common. (Closed)
Patch Set: Fix nit. 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
« no previous file with comments | « ash/mus/test/wm_test_helper.h ('k') | ash/mus/window_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..63a5c48093389013266ed71fa16f0b61267b663a 100644
--- a/ash/mus/test/wm_test_helper.cc
+++ b/ash/mus/test/wm_test_helper.cc
@@ -12,6 +12,7 @@
#include "ash/mus/window_manager_application.h"
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
+#include "base/test/sequenced_worker_pool_owner.h"
#include "services/ui/public/cpp/property_type_converters.h"
#include "services/ui/public/cpp/tests/window_tree_client_private.h"
#include "services/ui/public/cpp/window_tree_client.h"
@@ -28,6 +29,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 +44,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 +68,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();
« no previous file with comments | « ash/mus/test/wm_test_helper.h ('k') | ash/mus/window_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698