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

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

Issue 2790583004: Add second copy request after screen rotation to flatten the layers in animation. (Closed)
Patch Set: Separate the two test sets for slow/smooth animation. Created 3 years, 8 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
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, ErasesAnimatorOnAnimationEnded) { 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* screen_rotation_animator =
27 testapi.GetScreenRotationAnimatorForDisplay(display.id()); 27 testapi.GetScreenRotationAnimatorForDisplay(display.id());
28 EXPECT_EQ(1, testapi.DisplayScreenRotationAnimatorMapSize()); 28 EXPECT_EQ(1, testapi.DisplayScreenRotationAnimatorMapSize());
29 29
30 Shell::Get()->display_manager()->SetDisplayRotation( 30 Shell::Get()->display_manager()->SetDisplayRotation(
31 display.id(), display::Display::ROTATE_0, 31 display.id(), display::Display::ROTATE_0,
32 display::Display::RotationSource::ROTATION_SOURCE_USER); 32 display::Display::RotationSource::ROTATION_SOURCE_USER);
33 screen_rotation_animator->Rotate( 33 screen_rotation_animator->Rotate(
34 display::Display::ROTATE_90, 34 display::Display::ROTATE_90,
35 display::Display::RotationSource::ROTATION_SOURCE_USER); 35 display::Display::RotationSource::ROTATION_SOURCE_USER);
36 EXPECT_EQ(0, testapi.DisplayScreenRotationAnimatorMapSize()); 36 EXPECT_EQ(1, testapi.DisplayScreenRotationAnimatorMapSize());
37
38 screen_rotation_animator =
39 testapi.GetScreenRotationAnimatorForDisplay(display.id());
40 screen_rotation_animator->Rotate(
41 display::Display::ROTATE_180,
42 display::Display::RotationSource::ROTATION_SOURCE_USER);
43 EXPECT_EQ(1, testapi.DisplayScreenRotationAnimatorMapSize());
37 } 44 }
38 45
39 } // namespace ash 46 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_configuration_controller.cc ('k') | ash/display/root_window_transformers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698