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

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

Issue 2728803002: Handles users rotating screen too early (Closed)
Patch Set: Make ScreenRotationAnimator handle its own internal states. 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
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 namespace test {
15
16 class DisplayConfigurationControllerTest : public AshTestBase {
bruthig 2017/03/10 22:34:07 Thanks for adding this missing test fixture!!
wutao 2017/03/14 16:46:37 Acknowledged.
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.
bruthig 2017/03/10 22:34:07 nit: Any chance you can include a bug number here?
kylechar 2017/03/13 14:17:22 You can include crbug.com/686839 here. We need dis
wutao 2017/03/14 16:46:37 Done.
27 if (WmShell::Get()->IsRunningInMash())
28 return;
bruthig 2017/03/10 22:34:07 FYI I've proposed a change to the mus+ash team abo
wutao 2017/03/14 16:46:37 As discussed offline and in the proposal thread, I
29
30 display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay();
31 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 test
47 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698