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

Side by Side 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698