OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/rotator/screen_rotation_animator.h" | 5 #include "ash/rotator/screen_rotation_animator.h" |
6 #include "ash/shell.h" | 6 #include "ash/shell.h" |
| 7 #include "ash/shell_port.h" |
7 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
8 #include "ash/test/display_configuration_controller_test_api.h" | 9 #include "ash/test/display_configuration_controller_test_api.h" |
9 #include "ash/wm_shell.h" | |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "ui/display/manager/display_manager.h" | 11 #include "ui/display/manager/display_manager.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 | 14 |
15 using DisplayConfigurationControllerTest = test::AshTestBase; | 15 using DisplayConfigurationControllerTest = test::AshTestBase; |
16 | 16 |
17 TEST_F(DisplayConfigurationControllerTest, ErasesAnimatorOnAnimationEnded) { | 17 TEST_F(DisplayConfigurationControllerTest, ErasesAnimatorOnAnimationEnded) { |
18 // TODO(wutao): needs display_configuration_controller | 18 // TODO(wutao): needs display_configuration_controller |
19 // http://crbug.com/686839. | 19 // http://crbug.com/686839. |
20 if (WmShell::Get()->IsRunningInMash()) | 20 if (ShellPort::Get()->IsRunningInMash()) |
21 return; | 21 return; |
22 | 22 |
23 display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay(); | 23 display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay(); |
24 test::DisplayConfigurationControllerTestApi testapi( | 24 test::DisplayConfigurationControllerTestApi testapi( |
25 Shell::Get()->display_configuration_controller()); | 25 Shell::Get()->display_configuration_controller()); |
26 ScreenRotationAnimator* screen_rotation_animator = | 26 ScreenRotationAnimator* screen_rotation_animator = |
27 testapi.GetScreenRotationAnimatorForDisplay(display.id()); | 27 testapi.GetScreenRotationAnimatorForDisplay(display.id()); |
28 EXPECT_EQ(1, testapi.DisplayScreenRotationAnimatorMapSize()); | 28 EXPECT_EQ(1, testapi.DisplayScreenRotationAnimatorMapSize()); |
29 | 29 |
30 Shell::Get()->display_manager()->SetDisplayRotation( | 30 Shell::Get()->display_manager()->SetDisplayRotation( |
31 display.id(), display::Display::ROTATE_0, | 31 display.id(), display::Display::ROTATE_0, |
32 display::Display::RotationSource::ROTATION_SOURCE_USER); | 32 display::Display::RotationSource::ROTATION_SOURCE_USER); |
33 screen_rotation_animator->Rotate( | 33 screen_rotation_animator->Rotate( |
34 display::Display::ROTATE_90, | 34 display::Display::ROTATE_90, |
35 display::Display::RotationSource::ROTATION_SOURCE_USER); | 35 display::Display::RotationSource::ROTATION_SOURCE_USER); |
36 EXPECT_EQ(0, testapi.DisplayScreenRotationAnimatorMapSize()); | 36 EXPECT_EQ(0, testapi.DisplayScreenRotationAnimatorMapSize()); |
37 } | 37 } |
38 | 38 |
39 } // namespace ash | 39 } // namespace ash |
OLD | NEW |