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

Unified Diff: ui/keyboard/keyboard_controller_unittest.cc

Issue 2445293002: Make the virtual keyboard show up on the display with input focus. (Closed)
Patch Set: rebase & update Created 4 years, 2 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: ui/keyboard/keyboard_controller_unittest.cc
diff --git a/ui/keyboard/keyboard_controller_unittest.cc b/ui/keyboard/keyboard_controller_unittest.cc
index 0ca311d47305fabd0bfe8659d6f686821828c135..228e95a7d11fcedbb03006fb8d504c60aa79adfe 100644
--- a/ui/keyboard/keyboard_controller_unittest.cc
+++ b/ui/keyboard/keyboard_controller_unittest.cc
@@ -166,6 +166,19 @@ class KeyboardContainerObserver : public aura::WindowObserver {
DISALLOW_COPY_AND_ASSIGN(KeyboardContainerObserver);
};
+class TestKeyboardLayoutDelegate : public KeyboardLayoutDelegate {
+ public:
+ TestKeyboardLayoutDelegate() {}
+ ~TestKeyboardLayoutDelegate() override {}
+
+ // Overridden from keyboard::KeyboardLayoutDelegate
+ void MoveKeyboardToAnotherDisplayIfNeeded(int64_t /* display_id */) override {
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TestKeyboardLayoutDelegate);
+};
+
} // namespace
class KeyboardControllerTest : public testing::Test,
@@ -187,7 +200,8 @@ class KeyboardControllerTest : public testing::Test,
new wm::DefaultActivationClient(aura_test_helper_->root_window());
focus_controller_.reset(new TestFocusController(root_window()));
ui_ = new TestKeyboardUI(aura_test_helper_->host()->GetInputMethod());
- controller_.reset(new KeyboardController(ui_));
+ layout_delegate_.reset(new TestKeyboardLayoutDelegate());
+ controller_.reset(new KeyboardController(ui_, layout_delegate_.get()));
controller()->AddObserver(this);
}
@@ -266,6 +280,7 @@ class KeyboardControllerTest : public testing::Test,
int number_of_calls_;
gfx::Rect notified_bounds_;
KeyboardUI* ui_;
+ std::unique_ptr<KeyboardLayoutDelegate> layout_delegate_;
std::unique_ptr<KeyboardController> controller_;
std::unique_ptr<ui::TextInputClient> test_text_input_client_;
bool keyboard_closed_;

Powered by Google App Engine
This is Rietveld 408576698