OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/display/manager/display_manager.h" | 5 #include "ui/display/manager/display_manager.h" |
6 | 6 |
7 #include "ash/accelerators/accelerator_commands_aura.h" | 7 #include "ash/accelerators/accelerator_commands_aura.h" |
8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
9 #include "ash/display/display_configuration_controller.h" | 9 #include "ash/display/display_configuration_controller.h" |
10 #include "ash/display/display_util.h" | 10 #include "ash/display/display_util.h" |
(...skipping 3195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3206 EXPECT_EQ(blink::kWebScreenOrientationLockPortraitPrimary, | 3206 EXPECT_EQ(blink::kWebScreenOrientationLockPortraitPrimary, |
3207 test_api.GetCurrentOrientation()); | 3207 test_api.GetCurrentOrientation()); |
3208 | 3208 |
3209 // The orientation has alraedy been locked to secondary once, so | 3209 // The orientation has alraedy been locked to secondary once, so |
3210 // it should swtich back to the portrait secondary. | 3210 // it should swtich back to the portrait secondary. |
3211 wm::ActivateWindow(window_ps); | 3211 wm::ActivateWindow(window_ps); |
3212 EXPECT_EQ(blink::kWebScreenOrientationLockPortraitSecondary, | 3212 EXPECT_EQ(blink::kWebScreenOrientationLockPortraitSecondary, |
3213 test_api.GetCurrentOrientation()); | 3213 test_api.GetCurrentOrientation()); |
3214 } | 3214 } |
3215 | 3215 |
| 3216 // crbug.com/734107 |
| 3217 TEST_F(DisplayManagerOrientationTest, DisplayChangeShouldNotSaveUserRotation) { |
| 3218 Shell* shell = Shell::Get(); |
| 3219 display::DisplayManager* display_manager = shell->display_manager(); |
| 3220 display::test::DisplayManagerTestApi test_api(display_manager); |
| 3221 test_api.SetFirstDisplayAsInternalDisplay(); |
| 3222 display::Screen* screen = display::Screen::GetScreen(); |
| 3223 |
| 3224 Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
| 3225 true); |
| 3226 // Emulate that Animator is calling this async when animation is completed. |
| 3227 display_manager->SetDisplayRotation( |
| 3228 screen->GetPrimaryDisplay().id(), display::Display::ROTATE_90, |
| 3229 display::Display::ROTATION_SOURCE_ACCELEROMETER); |
| 3230 EXPECT_EQ(display::Display::ROTATE_90, |
| 3231 screen->GetPrimaryDisplay().rotation()); |
| 3232 |
| 3233 Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( |
| 3234 false); |
| 3235 EXPECT_EQ(display::Display::ROTATE_0, screen->GetPrimaryDisplay().rotation()); |
| 3236 } |
| 3237 |
3216 } // namespace ash | 3238 } // namespace ash |
OLD | NEW |