| 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/display/display_configuration_controller.h" |
| 6 |
| 7 #include "ash/common/wm_shell.h" |
| 8 #include "ash/shell.h" |
| 9 #include "ash/test/ash_test_base.h" |
| 10 #include "ash/test/shell_test_api.h" |
| 11 #include "base/memory/ptr_util.h" |
| 12 #include "ui/display/display.h" |
| 13 #include "ui/display/screen.h" |
| 14 |
| 15 namespace ash { |
| 16 namespace test { |
| 17 |
| 18 class DisplayConfigurationControllerTest : public AshTestBase { |
| 19 public: |
| 20 DisplayConfigurationControllerTest() {} |
| 21 ~DisplayConfigurationControllerTest() override {} |
| 22 |
| 23 private: |
| 24 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurationControllerTest); |
| 25 }; |
| 26 |
| 27 TEST_F(DisplayConfigurationControllerTest, ErasesAnimatorOnAnimationEnded) { |
| 28 // TODO(wutao): needs display_configuration_controller. |
| 29 if (WmShell::Get()->IsRunningInMash()) |
| 30 return; |
| 31 |
| 32 display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay(); |
| 33 ShellTestApi testapi(Shell::GetInstance()); |
| 34 ScreenRotationAnimator* screen_rotation_animator = |
| 35 testapi.GetOrMakeAnimatorByDisplayId(display.id()); |
| 36 EXPECT_EQ(1, testapi.DisplayIdAnimatorMapSize()); |
| 37 |
| 38 display.set_rotation(display::Display::ROTATE_0); |
| 39 screen_rotation_animator->Rotate( |
| 40 display::Display::ROTATE_90, |
| 41 display::Display::RotationSource::ROTATION_SOURCE_USER); |
| 42 EXPECT_EQ(0, testapi.DisplayIdAnimatorMapSize()); |
| 43 } |
| 44 |
| 45 } // namespace test |
| 46 } // namespace ash |
| OLD | NEW |