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

Side by Side Diff: ash/wm/lock_layout_manager_unittest.cc

Issue 1108343002: Revert of Merge Prevent DisplayPreferences from saving incorrect rotations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2357
Patch Set: Created 5 years, 7 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
« no previous file with comments | « ash/test/ash_test_base.cc ('k') | ash/wm/maximize_mode/maximize_mode_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/display/display_manager.h" 5 #include "ash/display/display_manager.h"
6 #include "ash/root_window_controller.h" 6 #include "ash/root_window_controller.h"
7 #include "ash/screen_util.h" 7 #include "ash/screen_util.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/test/ash_test_base.h" 10 #include "ash/test/ash_test_base.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 // Repro steps for http://crbug.com/401667: 205 // Repro steps for http://crbug.com/401667:
206 // 1. Set up login screen defaults: VK override disabled 206 // 1. Set up login screen defaults: VK override disabled
207 // 2. Show/hide keyboard, make sure that no stale keyboard bounds are cached. 207 // 2. Show/hide keyboard, make sure that no stale keyboard bounds are cached.
208 keyboard::SetKeyboardOverscrollOverride( 208 keyboard::SetKeyboardOverscrollOverride(
209 keyboard::KEYBOARD_OVERSCROLL_OVERRIDE_DISABLED); 209 keyboard::KEYBOARD_OVERSCROLL_OVERRIDE_DISABLED);
210 ShowKeyboard(true); 210 ShowKeyboard(true);
211 ShowKeyboard(false); 211 ShowKeyboard(false);
212 ash::DisplayManager* display_manager = 212 ash::DisplayManager* display_manager =
213 Shell::GetInstance()->display_manager(); 213 Shell::GetInstance()->display_manager();
214 display_manager->SetDisplayRotation(primary_display.id(), 214 display_manager->SetDisplayRotation(primary_display.id(),
215 gfx::Display::ROTATE_90, 215 gfx::Display::ROTATE_90);
216 gfx::Display::ROTATION_SOURCE_ACTIVE);
217 primary_display = Shell::GetScreen()->GetPrimaryDisplay(); 216 primary_display = Shell::GetScreen()->GetPrimaryDisplay();
218 screen_bounds = primary_display.bounds(); 217 screen_bounds = primary_display.bounds();
219 EXPECT_EQ(screen_bounds.ToString(), window->GetBoundsInScreen().ToString()); 218 EXPECT_EQ(screen_bounds.ToString(), window->GetBoundsInScreen().ToString());
220 display_manager->SetDisplayRotation(primary_display.id(), 219 display_manager->SetDisplayRotation(primary_display.id(),
221 gfx::Display::ROTATE_0, 220 gfx::Display::ROTATE_0);
222 gfx::Display::ROTATION_SOURCE_ACTIVE);
223 221
224 // When virtual keyboard overscroll is disabled keyboard bounds do 222 // When virtual keyboard overscroll is disabled keyboard bounds do
225 // affect window bounds. 223 // affect window bounds.
226 keyboard::SetKeyboardOverscrollOverride( 224 keyboard::SetKeyboardOverscrollOverride(
227 keyboard::KEYBOARD_OVERSCROLL_OVERRIDE_DISABLED); 225 keyboard::KEYBOARD_OVERSCROLL_OVERRIDE_DISABLED);
228 ShowKeyboard(true); 226 ShowKeyboard(true);
229 keyboard::KeyboardController* keyboard = 227 keyboard::KeyboardController* keyboard =
230 keyboard::KeyboardController::GetInstance(); 228 keyboard::KeyboardController::GetInstance();
231 primary_display = Shell::GetScreen()->GetPrimaryDisplay(); 229 primary_display = Shell::GetScreen()->GetPrimaryDisplay();
232 screen_bounds = primary_display.bounds(); 230 screen_bounds = primary_display.bounds();
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 ScreenUtil::GetDisplayWorkAreaBoundsInParent(window.get()); 283 ScreenUtil::GetDisplayWorkAreaBoundsInParent(window.get());
286 window->SetBounds(work_area); 284 window->SetBounds(work_area);
287 // Usually work_area takes Shelf into account but that doesn't affect 285 // Usually work_area takes Shelf into account but that doesn't affect
288 // LockScreen container windows. 286 // LockScreen container windows.
289 EXPECT_NE(work_area.ToString(), window->GetBoundsInScreen().ToString()); 287 EXPECT_NE(work_area.ToString(), window->GetBoundsInScreen().ToString());
290 EXPECT_EQ(screen_bounds.ToString(), window->GetBoundsInScreen().ToString()); 288 EXPECT_EQ(screen_bounds.ToString(), window->GetBoundsInScreen().ToString());
291 } 289 }
292 290
293 } // namespace test 291 } // namespace test
294 } // namespace ash 292 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/ash_test_base.cc ('k') | ash/wm/maximize_mode/maximize_mode_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698