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

Unified Diff: ui/keyboard/keyboard_controller_unittest.cc

Issue 2629233003: Revert of Change the keyboard bounds when moving to another display. (Closed)
Patch Set: Created 3 years, 11 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 | « ui/keyboard/keyboard_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/keyboard/keyboard_controller_unittest.cc
diff --git a/ui/keyboard/keyboard_controller_unittest.cc b/ui/keyboard/keyboard_controller_unittest.cc
index 6357440a8cf411381af6f32cf408305e8dcbecf3..c2b47f3cb5f35a59aa2ea5b94a90539fdaa06fe5 100644
--- a/ui/keyboard/keyboard_controller_unittest.cc
+++ b/ui/keyboard/keyboard_controller_unittest.cc
@@ -299,8 +299,7 @@
const gfx::Rect& initial_bounds = container->bounds();
// The container should be positioned at the bottom of screen and has 0
// height.
- ASSERT_EQ(0, initial_bounds.height());
- ASSERT_EQ(screen_bounds.height(), initial_bounds.y());
+ ASSERT_EQ(gfx::Rect(), initial_bounds);
VerifyKeyboardWindowSize(container, keyboard);
// In FULL_WIDTH mode, attempt to change window width or move window up from
@@ -338,38 +337,6 @@
gfx::Rect new_bounds(0, 50, 50, 50);
keyboard->SetBounds(new_bounds);
ASSERT_EQ(new_bounds, container->bounds());
- VerifyKeyboardWindowSize(container, keyboard);
-}
-
-TEST_F(KeyboardControllerTest, KeyboardSizeMultiRootWindow) {
- aura::Window* container(controller()->GetContainerWindow());
- aura::Window* keyboard(ui()->GetKeyboardWindow());
- gfx::Rect screen_bounds = root_window()->bounds();
- root_window()->AddChild(container);
- container->AddChild(keyboard);
- const gfx::Rect& initial_bounds = container->bounds();
- // The container should be positioned at the bottom of screen and has 0
- // height.
- ASSERT_EQ(0, initial_bounds.height());
- ASSERT_EQ(screen_bounds.height(), initial_bounds.y());
- VerifyKeyboardWindowSize(container, keyboard);
-
- // Adding new root window.
- std::unique_ptr<aura::WindowTreeHost> secondary_tree_host =
- base::WrapUnique<aura::WindowTreeHost>(
- aura::WindowTreeHost::Create(gfx::Rect(0, 0, 1000, 500)));
- secondary_tree_host->InitHost();
- EXPECT_EQ(1000, secondary_tree_host->window()->bounds().width());
- EXPECT_EQ(500, secondary_tree_host->window()->bounds().height());
-
- // Move the keyboard into the secondary root window.
- controller()->HideKeyboard(
- KeyboardController::HideReason::HIDE_REASON_AUTOMATIC);
- root_window()->RemoveChild(container);
- secondary_tree_host->window()->AddChild(container);
-
- const gfx::Rect& new_bounds = container->bounds();
- EXPECT_EQ(500, new_bounds.y());
VerifyKeyboardWindowSize(container, keyboard);
}
« no previous file with comments | « ui/keyboard/keyboard_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698