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

Unified Diff: ash/display/display_manager_unittest.cc

Issue 2837773003: Flip the flag to enable smooth screen rotation by default. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_manager_unittest.cc
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc
index b82d3cca84e0a6f07d59f605e317e9e043c93b33..1af5a8800da9b319079fe2d9b0ce5cd2ebdab583 100644
--- a/ash/display/display_manager_unittest.cc
+++ b/ash/display/display_manager_unittest.cc
@@ -16,6 +16,7 @@
#include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/test/ash_test_base.h"
+#include "ash/test/display_configuration_controller_test_api.h"
#include "ash/test/mirror_window_test_api.h"
#include "ash/test/screen_orientation_controller_test_api.h"
#include "ash/wm/maximize_mode/maximize_mode_controller.h"
@@ -3018,6 +3019,10 @@ TEST_F(DisplayManagerOrientationTest, SaveRestoreUserRotationLock) {
DisplayConfigurationController* configuration_controller =
shell->display_configuration_controller();
display::Screen* screen = display::Screen::GetScreen();
+ test::DisplayConfigurationControllerTestApi display_config_controller_testapi(
+ configuration_controller);
+ display_config_controller_testapi.SetEnableScreenRotationAnimator(
+ screen->GetPrimaryDisplay().id(), false);
// Rotate to portrait in clamshell.
configuration_controller->SetDisplayRotation(
@@ -3108,6 +3113,8 @@ TEST_F(DisplayManagerOrientationTest, SaveRestoreUserRotationLock) {
screen->GetPrimaryDisplay().rotation());
orientation_controller->RemoveObserver(&test_observer);
+ display_config_controller_testapi.SetEnableScreenRotationAnimator(
+ screen->GetPrimaryDisplay().id(), true);
oshima 2017/04/25 17:52:18 is this necessary?
}
TEST_F(DisplayManagerOrientationTest, UserRotationLockReverse) {
@@ -3123,6 +3130,10 @@ TEST_F(DisplayManagerOrientationTest, UserRotationLockReverse) {
WmWindow* wm_window = WmWindow::Get(window);
wm_window->SetAppType(static_cast<int>(AppType::CHROME_APP));
display::Screen* screen = display::Screen::GetScreen();
+ test::DisplayConfigurationControllerTestApi display_config_controller_testapi(
+ shell->display_configuration_controller());
+ display_config_controller_testapi.SetEnableScreenRotationAnimator(
+ screen->GetPrimaryDisplay().id(), false);
// Just enabling will not save the lock.
Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
@@ -3153,6 +3164,9 @@ TEST_F(DisplayManagerOrientationTest, UserRotationLockReverse) {
EXPECT_EQ(display::Display::ROTATE_90,
screen->GetPrimaryDisplay().rotation());
+
+ display_config_controller_testapi.SetEnableScreenRotationAnimator(
+ screen->GetPrimaryDisplay().id(), true);
}
TEST_F(DisplayManagerOrientationTest, LockToSpecificOrientation) {
@@ -3160,6 +3174,10 @@ TEST_F(DisplayManagerOrientationTest, LockToSpecificOrientation) {
display::DisplayManager* display_manager = shell->display_manager();
display::test::DisplayManagerTestApi(display_manager)
.SetFirstDisplayAsInternalDisplay();
+ test::DisplayConfigurationControllerTestApi display_config_controller_testapi(
+ Shell::Get()->display_configuration_controller());
+ display_config_controller_testapi.SetEnableScreenRotationAnimator(
+ display_manager->GetDisplayAt(0).id(), false);
ScreenOrientationController* orientation_controller =
shell->screen_orientation_controller();
test::ScreenOrientationControllerTestApi test_api(orientation_controller);
@@ -3213,6 +3231,8 @@ TEST_F(DisplayManagerOrientationTest, LockToSpecificOrientation) {
wm::ActivateWindow(window_ps);
EXPECT_EQ(blink::kWebScreenOrientationLockPortraitSecondary,
test_api.GetCurrentOrientation());
+ display_config_controller_testapi.SetEnableScreenRotationAnimator(
+ display_manager->GetDisplayAt(0).id(), true);
}
} // namespace ash
« 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