| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/mus/test/wm_test_base.h" | 5 #include "ash/mus/test/wm_test_base.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/common/session/session_controller.h" | 10 #include "ash/common/session/session_controller.h" |
| 11 #include "ash/common/wm_shell.h" | 11 #include "ash/common/wm_shell.h" |
| 12 #include "ash/mus/root_window_controller.h" | 12 #include "ash/mus/root_window_controller.h" |
| 13 #include "ash/mus/test/wm_test_helper.h" | 13 #include "ash/mus/test/wm_test_helper.h" |
| 14 #include "ash/mus/window_manager.h" | 14 #include "ash/mus/window_manager.h" |
| 15 #include "ash/mus/window_manager_application.h" | 15 #include "ash/mus/window_manager_application.h" |
| 16 #include "ash/public/cpp/session_types.h" | 16 #include "ash/public/cpp/session_types.h" |
| 17 #include "ash/public/interfaces/session_controller.mojom.h" | 17 #include "ash/public/interfaces/session_controller.mojom.h" |
| 18 #include "ash/test/wm_window_aura_test_api.h" | 18 #include "ash/test/wm_window_test_api.h" |
| 19 #include "base/memory/ptr_util.h" | 19 #include "base/memory/ptr_util.h" |
| 20 #include "services/ui/public/cpp/property_type_converters.h" | 20 #include "services/ui/public/cpp/property_type_converters.h" |
| 21 #include "ui/aura/mus/property_converter.h" | 21 #include "ui/aura/mus/property_converter.h" |
| 22 #include "ui/aura/mus/window_tree_client.h" | 22 #include "ui/aura/mus/window_tree_client.h" |
| 23 #include "ui/aura/window.h" | 23 #include "ui/aura/window.h" |
| 24 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 24 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| 25 #include "ui/display/display.h" | 25 #include "ui/display/display.h" |
| 26 | 26 |
| 27 namespace ash { | 27 namespace ash { |
| 28 namespace mus { | 28 namespace mus { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 return window; | 159 return window; |
| 160 } | 160 } |
| 161 | 161 |
| 162 void WmTestBase::SetUp() { | 162 void WmTestBase::SetUp() { |
| 163 setup_called_ = true; | 163 setup_called_ = true; |
| 164 // Disable animations during tests. | 164 // Disable animations during tests. |
| 165 zero_duration_mode_ = base::MakeUnique<ui::ScopedAnimationDurationScaleMode>( | 165 zero_duration_mode_ = base::MakeUnique<ui::ScopedAnimationDurationScaleMode>( |
| 166 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION); | 166 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION); |
| 167 // Most tests expect a minimum size of 0x0. | 167 // Most tests expect a minimum size of 0x0. |
| 168 minimum_size_lock_ = | 168 minimum_size_lock_ = |
| 169 base::MakeUnique<WmWindowAuraTestApi::GlobalMinimumSizeLock>(); | 169 base::MakeUnique<WmWindowTestApi::GlobalMinimumSizeLock>(); |
| 170 test_helper_.reset(new WmTestHelper); | 170 test_helper_.reset(new WmTestHelper); |
| 171 test_helper_->Init(); | 171 test_helper_->Init(); |
| 172 | 172 |
| 173 // Most tests assume the user is logged in (and hence the shelf is created). | 173 // Most tests assume the user is logged in (and hence the shelf is created). |
| 174 SimulateUserLogin(); | 174 SimulateUserLogin(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void WmTestBase::TearDown() { | 177 void WmTestBase::TearDown() { |
| 178 teardown_called_ = true; | 178 teardown_called_ = true; |
| 179 test_helper_.reset(); | 179 test_helper_.reset(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 200 info->can_lock_screen = true; | 200 info->can_lock_screen = true; |
| 201 info->should_lock_screen_automatically = false; | 201 info->should_lock_screen_automatically = false; |
| 202 info->add_user_session_policy = AddUserSessionPolicy::ALLOWED; | 202 info->add_user_session_policy = AddUserSessionPolicy::ALLOWED; |
| 203 info->state = session_manager::SessionState::ACTIVE; | 203 info->state = session_manager::SessionState::ACTIVE; |
| 204 session_controller->SetSessionInfo(std::move(info)); | 204 session_controller->SetSessionInfo(std::move(info)); |
| 205 } | 205 } |
| 206 | 206 |
| 207 | 207 |
| 208 } // namespace mus | 208 } // namespace mus |
| 209 } // namespace ash | 209 } // namespace ash |
| OLD | NEW |