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

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

Issue 2919393002: [merge to m60] cros: Do not cache |root_window| in ScreenRotationAnimator. (Closed)
Patch Set: Created 3 years, 6 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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/public/cpp/config.h" 5 #include "ash/public/cpp/config.h"
6 #include "ash/rotator/screen_rotation_animator.h" 6 #include "ash/rotator/screen_rotation_animator.h"
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/test/ash_test_base.h" 8 #include "ash/test/ash_test_base.h"
9 #include "ash/test/display_configuration_controller_test_api.h" 9 #include "ash/test/display_configuration_controller_test_api.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "ui/display/manager/display_manager.h" 11 #include "ui/display/manager/display_manager.h"
12 12
13 namespace ash { 13 namespace ash {
14 14
15 using DisplayConfigurationControllerTest = test::AshTestBase; 15 using DisplayConfigurationControllerTest = test::AshTestBase;
16 16
17 TEST_F(DisplayConfigurationControllerTest, OnlyHasOneAnimator) { 17 TEST_F(DisplayConfigurationControllerTest, OnlyHasOneAnimator) {
18 // TODO(wutao): needs display_configuration_controller 18 // TODO(wutao): needs display_configuration_controller
19 // http://crbug.com/686839. 19 // http://crbug.com/686839.
20 if (Shell::GetAshConfig() == Config::MASH) 20 if (Shell::GetAshConfig() == Config::MASH)
21 return; 21 return;
22 22
23 display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay(); 23 display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay();
24 test::DisplayConfigurationControllerTestApi testapi( 24 test::DisplayConfigurationControllerTestApi testapi(
25 Shell::Get()->display_configuration_controller()); 25 Shell::Get()->display_configuration_controller());
26 ScreenRotationAnimator* screen_rotation_animator = 26 ScreenRotationAnimator* old_screen_rotation_animator =
27 testapi.GetScreenRotationAnimatorForDisplay(display.id()); 27 testapi.GetScreenRotationAnimatorForDisplay(display.id());
28 EXPECT_EQ(1, testapi.DisplayScreenRotationAnimatorMapSize());
29 28
30 Shell::Get()->display_manager()->SetDisplayRotation( 29 Shell::Get()->display_manager()->SetDisplayRotation(
31 display.id(), display::Display::ROTATE_0, 30 display.id(), display::Display::ROTATE_0,
32 display::Display::RotationSource::ROTATION_SOURCE_USER); 31 display::Display::RotationSource::ROTATION_SOURCE_USER);
33 screen_rotation_animator->Rotate( 32 old_screen_rotation_animator->Rotate(
34 display::Display::ROTATE_90, 33 display::Display::ROTATE_90,
35 display::Display::RotationSource::ROTATION_SOURCE_USER); 34 display::Display::RotationSource::ROTATION_SOURCE_USER);
36 EXPECT_EQ(1, testapi.DisplayScreenRotationAnimatorMapSize());
37 35
38 screen_rotation_animator = 36 ScreenRotationAnimator* new_screen_rotation_animator =
39 testapi.GetScreenRotationAnimatorForDisplay(display.id()); 37 testapi.GetScreenRotationAnimatorForDisplay(display.id());
40 screen_rotation_animator->Rotate( 38 new_screen_rotation_animator->Rotate(
41 display::Display::ROTATE_180, 39 display::Display::ROTATE_180,
42 display::Display::RotationSource::ROTATION_SOURCE_USER); 40 display::Display::RotationSource::ROTATION_SOURCE_USER);
43 EXPECT_EQ(1, testapi.DisplayScreenRotationAnimatorMapSize()); 41 EXPECT_EQ(old_screen_rotation_animator, new_screen_rotation_animator);
44 } 42 }
45 43
46 } // namespace ash 44 } // 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