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

Unified Diff: ui/keyboard/keyboard_controller_unittest.cc

Issue 578653004: Overscroll for keyboard disabled while keyboard is hiding. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 6 years, 3 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 9688a2f51d1347a2da9adf7c11a765cf402e81cd..d3fddd00daf57104659a49a7437d7b404e791b1b 100644
--- a/ui/keyboard/keyboard_controller_unittest.cc
+++ b/ui/keyboard/keyboard_controller_unittest.cc
@@ -228,6 +228,10 @@ class KeyboardControllerTest : public testing::Test {
return controller_->WillHideKeyboard();
}
+ bool ShouldEnableInsets(aura::Window* window) {
+ return controller_->ShouldEnableInsets(window);
+ }
+
base::MessageLoopForUI message_loop_;
scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_;
scoped_ptr<TestFocusController> focus_controller_;
@@ -421,6 +425,31 @@ TEST_F(KeyboardControllerTest, VisibilityChangeWithTextInputTypeChange) {
EXPECT_TRUE(keyboard_container->IsVisible());
}
bshe 2014/09/18 18:26:07 nit: Do you mind to add a link to the bug that you
Peter Wen 2014/09/18 18:41:47 Done.
+TEST_F(KeyboardControllerTest, CheckOverscrollInsetDuringVisibilityChange) {
+ const gfx::Rect& root_bounds = root_window()->bounds();
+
+ ui::DummyTextInputClient input_client(ui::TEXT_INPUT_TYPE_TEXT);
+ ui::DummyTextInputClient no_input_client(ui::TEXT_INPUT_TYPE_NONE);
+
+ aura::Window* keyboard_container(controller()->GetContainerWindow());
+ keyboard_container->SetBounds(root_bounds);
+ root_window()->AddChild(keyboard_container);
+
+ // Enable touch keyboard / overscroll mode to test insets.
+ keyboard::SetTouchKeyboardEnabled(true);
+ EXPECT_TRUE(keyboard::IsKeyboardOverscrollEnabled());
+
+ SetFocus(&input_client);
+ SetFocus(&no_input_client);
+ // Insets should not be enabled for new windows while keyboard is in the
+ // process of hiding when overscroll is enabled.
+ EXPECT_FALSE(ShouldEnableInsets(proxy()->GetKeyboardWindow()));
+ // Cancel keyboard hide.
+ SetFocus(&input_client);
+ // Insets should be enabled for new windows as hide was cancelled.
+ EXPECT_TRUE(ShouldEnableInsets(proxy()->GetKeyboardWindow()));
+}
+
TEST_F(KeyboardControllerTest, AlwaysVisibleWhenLocked) {
const gfx::Rect& root_bounds = root_window()->bounds();
« 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