| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ash/common/wm_shell.h" |
| 6 #include "ash/rotator/screen_rotation_animator.h" |
| 7 #include "ash/shell.h" |
| 8 #include "ash/test/ash_test_base.h" |
| 9 #include "ash/test/display_configuration_controller_test_api.h" |
| 10 #include "base/macros.h" |
| 11 #include "ui/display/manager/display_manager.h" |
| 12 |
| 13 namespace ash { |
| 14 |
| 15 class DisplayConfigurationControllerTest : public test::AshTestBase { |
| 16 public: |
| 17 DisplayConfigurationControllerTest() {} |
| 18 ~DisplayConfigurationControllerTest() override {} |
| 19 |
| 20 private: |
| 21 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurationControllerTest); |
| 22 }; |
| 23 |
| 24 TEST_F(DisplayConfigurationControllerTest, ErasesAnimatorOnAnimationEnded) { |
| 25 // TODO(wutao): needs display_configuration_controller |
| 26 // http://crbug.com/686839. |
| 27 if (WmShell::Get()->IsRunningInMash()) |
| 28 return; |
| 29 |
| 30 display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay(); |
| 31 test::DisplayConfigurationControllerTestApi testapi( |
| 32 Shell::GetInstance()->display_configuration_controller()); |
| 33 ScreenRotationAnimator* screen_rotation_animator = |
| 34 testapi.GetScreenRotationAnimatorForDisplay(display.id()); |
| 35 EXPECT_EQ(1, testapi.DisplayScreenRotationAnimatorMapSize()); |
| 36 |
| 37 Shell::GetInstance()->display_manager()->SetDisplayRotation( |
| 38 display.id(), display::Display::ROTATE_0, |
| 39 display::Display::RotationSource::ROTATION_SOURCE_USER); |
| 40 screen_rotation_animator->Rotate( |
| 41 display::Display::ROTATE_90, |
| 42 display::Display::RotationSource::ROTATION_SOURCE_USER); |
| 43 EXPECT_EQ(0, testapi.DisplayScreenRotationAnimatorMapSize()); |
| 44 } |
| 45 |
| 46 } // namespace ash |
| OLD | NEW |