Chromium Code Reviews| 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 namespace test { | |
|
oshima
2017/03/16 20:13:09
test namespace is for test utilities. test body sh
wutao
2017/03/17 00:01:03
Done.
| |
| 15 | |
| 16 class DisplayConfigurationControllerTest : public AshTestBase { | |
| 17 public: | |
| 18 DisplayConfigurationControllerTest() {} | |
| 19 ~DisplayConfigurationControllerTest() override {} | |
| 20 | |
| 21 private: | |
| 22 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurationControllerTest); | |
| 23 }; | |
| 24 | |
| 25 TEST_F(DisplayConfigurationControllerTest, ErasesAnimatorOnAnimationEnded) { | |
| 26 // TODO(wutao): needs display_configuration_controller | |
| 27 // http://crbug.com/686839. | |
| 28 if (WmShell::Get()->IsRunningInMash()) | |
| 29 return; | |
| 30 | |
| 31 display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay(); | |
| 32 DisplayConfigurationControllerTestApi testapi( | |
| 33 Shell::GetInstance()->display_configuration_controller()); | |
| 34 ScreenRotationAnimator* screen_rotation_animator = | |
| 35 testapi.GetScreenRotationAnimatorForDisplay(display.id()); | |
| 36 EXPECT_EQ(1, testapi.DisplayScreenRotationAnimatorMapSize()); | |
| 37 | |
| 38 Shell::GetInstance()->display_manager()->SetDisplayRotation( | |
| 39 display.id(), display::Display::ROTATE_0, | |
| 40 display::Display::RotationSource::ROTATION_SOURCE_USER); | |
| 41 screen_rotation_animator->Rotate( | |
| 42 display::Display::ROTATE_90, | |
| 43 display::Display::RotationSource::ROTATION_SOURCE_USER); | |
| 44 EXPECT_EQ(0, testapi.DisplayScreenRotationAnimatorMapSize()); | |
| 45 } | |
| 46 | |
| 47 } // namespace test | |
| 48 } // namespace ash | |
| OLD | NEW |