Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Side by Side Diff: ash/display/display_configuration_controller_unittest.cc

Issue 2728803002: Handles users rotating screen too early (Closed)
Patch Set: Rebased to commit. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/display/display_configuration_controller.cc ('k') | ash/rotator/screen_rotation_animator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « ash/display/display_configuration_controller.cc ('k') | ash/rotator/screen_rotation_animator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698