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

Unified Diff: ash/display/display_manager_unittest.cc

Issue 2951773002: Don't lock and save the orientation change made not through ScreenOrientationController (Closed)
Patch Set: removed tests that no longer makes sense 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 side-by-side diff with in-line comments
Download patch
Index: ash/display/display_manager_unittest.cc
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc
index 924f2148278ae1bfc63eb93cb8839471249b2212..9f338937017a18bb960fae9047e8b7214a034a68 100644
--- a/ash/display/display_manager_unittest.cc
+++ b/ash/display/display_manager_unittest.cc
@@ -3213,4 +3213,26 @@ TEST_F(DisplayManagerOrientationTest, LockToSpecificOrientation) {
test_api.GetCurrentOrientation());
}
+// crbug.com/734107
+TEST_F(DisplayManagerOrientationTest, DisplayChangeShouldNotSaveUserRotation) {
+ Shell* shell = Shell::Get();
+ display::DisplayManager* display_manager = shell->display_manager();
+ display::test::DisplayManagerTestApi test_api(display_manager);
+ test_api.SetFirstDisplayAsInternalDisplay();
+ display::Screen* screen = display::Screen::GetScreen();
+
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ true);
+ // Emulate that Animator is calling this async when animation is completed.
+ display_manager->SetDisplayRotation(
+ screen->GetPrimaryDisplay().id(), display::Display::ROTATE_90,
+ display::Display::ROTATION_SOURCE_ACCELEROMETER);
+ EXPECT_EQ(display::Display::ROTATE_90,
+ screen->GetPrimaryDisplay().rotation());
+
+ Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
+ false);
+ EXPECT_EQ(display::Display::ROTATE_0, screen->GetPrimaryDisplay().rotation());
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698