Index: ash/test/ash_test_helper.cc |
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc |
index ac80264797a1b23043e93230fedcea56cf35c799..40201b0bda780d791ac483936242879ab93074fa 100644 |
--- a/ash/test/ash_test_helper.cc |
+++ b/ash/test/ash_test_helper.cc |
@@ -32,6 +32,7 @@ |
#include "chromeos/network/network_handler.h" |
#include "device/bluetooth/bluetooth_adapter_factory.h" |
#include "device/bluetooth/dbus/bluez_dbus_manager.h" |
+#include "services/ui/public/cpp/input_devices/input_device_client.h" |
#include "ui/aura/env.h" |
#include "ui/aura/input_state_lookup.h" |
#include "ui/aura/mus/window_tree_client.h" |
@@ -82,6 +83,9 @@ AshTestHelper::AshTestHelper(AshTestEnvironment* ash_test_environment) |
AshTestHelper::~AshTestHelper() {} |
void AshTestHelper::SetUp(bool start_session) { |
+ if (config_ == Config::MUS) |
+ input_device_client_ = base::MakeUnique<ui::InputDeviceClient>(); |
+ |
display::ResetDisplayIdForTest(); |
if (config_ != Config::CLASSIC) |
aura::test::EnvTestHelper().SetAlwaysUseLastMouseLocation(true); |
@@ -212,7 +216,8 @@ void AshTestHelper::TearDown() { |
dbus_thread_manager_initialized_ = false; |
} |
- ui::TerminateContextFactoryForTests(); |
+ if (config_ == Config::CLASSIC) |
+ ui::TerminateContextFactoryForTests(); |
ui::ShutdownInputMethodForTesting(); |
zero_duration_mode_.reset(); |
@@ -220,6 +225,8 @@ void AshTestHelper::TearDown() { |
test_views_delegate_.reset(); |
wm_state_.reset(); |
+ input_device_client_.reset(); |
+ |
// WindowManager owns the CaptureController for mus/mash. |
CHECK(config_ != Config::CLASSIC || !::wm::CaptureController::Get()); |
} |
@@ -276,7 +283,7 @@ void AshTestHelper::UpdateDisplayForMash(const std::string& display_spec) { |
} |
display::Display AshTestHelper::GetSecondaryDisplay() { |
- if (config_ == Config::CLASSIC) |
+ if (config_ != Config::MASH) |
return Shell::Get()->display_manager()->GetSecondaryDisplay(); |
std::vector<RootWindowController*> roots = GetRootsOrderedByDisplayId(); |
@@ -287,10 +294,12 @@ display::Display AshTestHelper::GetSecondaryDisplay() { |
void AshTestHelper::CreateMashWindowManager() { |
CHECK(config_ != Config::CLASSIC); |
- window_manager_app_ = base::MakeUnique<mus::WindowManagerApplication>(); |
+ const bool show_primary_root_on_connect = false; |
+ window_manager_app_ = base::MakeUnique<mus::WindowManagerApplication>( |
+ show_primary_root_on_connect); |
window_manager_app_->window_manager_.reset( |
- new mus::WindowManager(nullptr, config_)); |
+ new mus::WindowManager(nullptr, config_, show_primary_root_on_connect)); |
window_manager_app_->window_manager()->shell_delegate_.reset( |
test_shell_delegate_); |
window_manager_app_->window_manager() |
@@ -313,8 +322,12 @@ void AshTestHelper::CreateMashWindowManager() { |
window_manager_app_->window_manager()->window_tree_client(); |
window_tree_client_private_ = |
base::MakeUnique<aura::WindowTreeClientPrivate>(window_tree_client); |
- int next_x = 0; |
- CreateRootWindowController("800x600", &next_x); |
+ if (config_ == Config::MUS) { |
+ window_tree_client_private_->CallOnConnect(); |
+ } else { |
+ int next_x = 0; |
+ CreateRootWindowController("800x600", &next_x); |
+ } |
// Make sure the NetworkHandler didn't get turned on, see above comment as to |
// why the NetworkHandler should not be running. |