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

Unified Diff: ash/wm/workspace/workspace_layout_manager_unittest.cc

Issue 468923002: Restore window size after accessbility keyboard hides. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per reviewer. 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
Index: ash/wm/workspace/workspace_layout_manager_unittest.cc
diff --git a/ash/wm/workspace/workspace_layout_manager_unittest.cc b/ash/wm/workspace/workspace_layout_manager_unittest.cc
index 76c7b241d8f38b4407839e1e3a827b38b03b43c1..a5fa688c4cd009eb53c4fb7b106738ae61a952d5 100644
--- a/ash/wm/workspace/workspace_layout_manager_unittest.cc
+++ b/ash/wm/workspace/workspace_layout_manager_unittest.cc
@@ -992,12 +992,12 @@ class WorkspaceLayoutManagerKeyboardTest : public test::AshTestBase {
}
void ShowKeyboard() {
+ layout_manager_->OnKeyboardBoundsChanging(keyboard_bounds_);
restore_work_area_insets_ = Shell::GetScreen()->GetPrimaryDisplay().
GetWorkAreaInsets();
Shell::GetInstance()->SetDisplayWorkAreaInsets(
Shell::GetPrimaryRootWindow(),
gfx::Insets(0, 0, keyboard_bounds_.height(), 0));
- layout_manager_->OnKeyboardBoundsChanging(keyboard_bounds_);
}
void HideKeyboard() {
@@ -1043,8 +1043,10 @@ TEST_F(WorkspaceLayoutManagerKeyboardTest, AdjustWindowForA11yKeyboard) {
work_area.height() / 2);
SetKeyboardBounds(keyboard_bounds);
- scoped_ptr<aura::Window> window(
- CreateTestWindowInShellWithBounds(work_area));
+
+ aura::test::TestWindowDelegate delegate;
+ scoped_ptr<aura::Window> window(CreateTestWindowInShellWithDelegate(
+ &delegate, -1, work_area));
aura::Window* root_window = ash::Shell::GetInstance()->GetPrimaryRootWindow();
FakeTextInputClient text_input_client(window.get());
@@ -1061,20 +1063,23 @@ TEST_F(WorkspaceLayoutManagerKeyboardTest, AdjustWindowForA11yKeyboard) {
Shell::GetScreen()->GetPrimaryDisplay().bounds().height() -
keyboard_bounds.height();
- EXPECT_EQ(gfx::Rect(work_area).ToString(),
- window->bounds().ToString());
+ EXPECT_EQ(gfx::Rect(work_area).ToString(), window->bounds().ToString());
ShowKeyboard();
EXPECT_EQ(gfx::Rect(work_area.origin(),
gfx::Size(work_area.width(), available_height)).ToString(),
window->bounds().ToString());
HideKeyboard();
+ EXPECT_EQ(gfx::Rect(work_area).ToString(), window->bounds().ToString());
- window->SetBounds(gfx::Rect(50, 50, 100, 500));
- EXPECT_EQ("50,50 100x500", window->bounds().ToString());
+ gfx::Rect small_window_bound(50, 50, 100, 500);
+ window->SetBounds(small_window_bound);
+ EXPECT_EQ(small_window_bound.ToString(), window->bounds().ToString());
ShowKeyboard();
EXPECT_EQ(gfx::Rect(50, 0, 100, available_height).ToString(),
window->bounds().ToString());
HideKeyboard();
+ EXPECT_EQ(small_window_bound.ToString(), window->bounds().ToString());
+
if (switches::IsTextInputFocusManagerEnabled()) {
ui::TextInputFocusManager::GetInstance()->BlurTextInputClient(
&text_input_client);
« ash/wm/workspace/workspace_layout_manager.cc ('K') | « ash/wm/workspace/workspace_layout_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698