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

Unified Diff: ash/wm/lock_layout_manager_unittest.cc

Issue 495923002: Fix stale keyboard bounds on login screen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cl Created 6 years, 4 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 | « no previous file | ash/wm/lock_window_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/lock_layout_manager_unittest.cc
diff --git a/ash/wm/lock_layout_manager_unittest.cc b/ash/wm/lock_layout_manager_unittest.cc
index 70984c49f9f1990b787b3b26c5e3ab01644fe36b..a51b26c024406863d2f9b294eaa8e3cb561d32eb 100644
--- a/ash/wm/lock_layout_manager_unittest.cc
+++ b/ash/wm/lock_layout_manager_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "ash/display/display_manager.h"
#include "ash/root_window_controller.h"
#include "ash/screen_util.h"
#include "ash/shell.h"
@@ -187,7 +188,8 @@ TEST_F(LockLayoutManagerTest, MaximizedFullscreenWindowBoundsAreEqualToScreen) {
}
TEST_F(LockLayoutManagerTest, KeyboardBounds) {
- gfx::Rect screen_bounds = Shell::GetScreen()->GetPrimaryDisplay().bounds();
+ gfx::Display primary_display = Shell::GetScreen()->GetPrimaryDisplay();
+ gfx::Rect screen_bounds = primary_display.bounds();
views::Widget::InitParams widget_params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
@@ -203,7 +205,30 @@ TEST_F(LockLayoutManagerTest, KeyboardBounds) {
keyboard::KEYBOARD_OVERSCROLL_OVERRIDE_ENABLED);
ShowKeyboard(true);
EXPECT_EQ(screen_bounds.ToString(), window->GetBoundsInScreen().ToString());
+ gfx::Rect keyboard_bounds =
+ keyboard::KeyboardController::GetInstance()->current_keyboard_bounds();
+ EXPECT_NE(keyboard_bounds, gfx::Rect());
+ ShowKeyboard(false);
+
+ // When keyboard is hidden make sure that rotating the screen gives 100% of
+ // screen size to window.
+ keyboard::SetKeyboardOverscrollOverride(
+ keyboard::KEYBOARD_OVERSCROLL_OVERRIDE_DISABLED);
+ ShowKeyboard(true);
ShowKeyboard(false);
oshima 2014/08/21 15:32:50 why turning on and off?
Nikita (slow) 2014/08/21 16:00:41 This is the way to reproduce this bug before the f
oshima 2014/08/21 16:32:39 Can you mention that this is to repro a bug (with
Nikita (slow) 2014/08/21 16:38:27 Done.
+ ash::DisplayManager* display_manager =
+ Shell::GetInstance()->display_manager();
+ display_manager->SetDisplayRotation(primary_display.id(),
+ gfx::Display::ROTATE_90);
+ screen_bounds = primary_display.bounds();
oshima 2014/08/21 16:32:39 screen_bounds = Shell::GetScreen()->GetPrimaryDisp
Nikita (slow) 2014/08/21 16:38:27 Done.
+
+ // We can't rely on screen_bounds.ToString() here since rotation doesn't
+ // affect how bounds are stored.
oshima 2014/08/21 15:32:50 rotation should update the display bounds. Have yo
Nikita (slow) 2014/08/21 16:00:41 I'm getting updated screen bounds: screen_bounds =
+ EXPECT_EQ(screen_bounds.origin(), window->GetBoundsInScreen().origin());
+ EXPECT_EQ(screen_bounds.width(), window->GetBoundsInScreen().height());
+ EXPECT_EQ(screen_bounds.height(), window->GetBoundsInScreen().width());
+ display_manager->SetDisplayRotation(primary_display.id(),
+ gfx::Display::ROTATE_0);
// When virtual keyboard overscroll is disabled keyboard bounds do
// affect window bounds.
« no previous file with comments | « no previous file | ash/wm/lock_window_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698