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

Unified Diff: ui/keyboard/keyboard_controller_unittest.cc

Issue 1138873003: Restore virtual keyboard after switch back to FULL_WIDTH mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test 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 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 8b6ece581d776953028f0d4c40b40d9718a08707..640e7f7536a6c19e30ddf1733bcc109506253273 100644
--- a/ui/keyboard/keyboard_controller_unittest.cc
+++ b/ui/keyboard/keyboard_controller_unittest.cc
@@ -463,6 +463,29 @@ TEST_F(KeyboardControllerTest, FloatingKeyboardDontOverscrollOrResize) {
EXPECT_EQ(gfx::Rect(), controller()->current_keyboard_bounds());
}
+// Verify switch to FULL_WIDTH mode will move virtual keyboard to the right
+// place and sets the correct overscroll.
+TEST_F(KeyboardControllerTest, SwitchToFullWidthVirtualKeyboard) {
+ ui::DummyTextInputClient input_client(ui::TEXT_INPUT_TYPE_TEXT);
+
+ aura::Window* container(controller()->GetContainerWindow());
+ root_window()->AddChild(container);
+ gfx::Rect screen_bounds = root_window()->bounds();
+ keyboard::SetTouchKeyboardEnabled(true);
+ SetFocus(&input_client);
+
+ controller()->SetKeyboardMode(FLOATING);
+ EXPECT_EQ(gfx::Rect(), notified_bounds());
+ EXPECT_EQ(gfx::Rect(), controller()->current_keyboard_bounds());
+
+ controller()->SetKeyboardMode(FULL_WIDTH);
+ gfx::Rect expected_bounds(
+ 0, screen_bounds.height() - kDefaultVirtualKeyboardHeight,
+ screen_bounds.width(), kDefaultVirtualKeyboardHeight);
+ EXPECT_EQ(expected_bounds, notified_bounds());
+ EXPECT_EQ(expected_bounds, controller()->current_keyboard_bounds());
+}
+
TEST_F(KeyboardControllerTest, AlwaysVisibleWhenLocked) {
ui::DummyTextInputClient input_client_0(ui::TEXT_INPUT_TYPE_TEXT);
ui::DummyTextInputClient input_client_1(ui::TEXT_INPUT_TYPE_TEXT);
« 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