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

Unified Diff: ui/base/ime/input_method_base_unittest.cc

Issue 82603002: Get rid of unused callbacks from ui::InputMethodObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revise obsolete code comment Created 7 years, 1 month 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/base/ime/input_method_base.cc ('k') | ui/base/ime/input_method_ibus.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/input_method_base_unittest.cc
diff --git a/ui/base/ime/input_method_base_unittest.cc b/ui/base/ime/input_method_base_unittest.cc
index 0841a3e8234f870c09bfddae514d7b121ede1a3e..52d2de6b681276a421676fe1b6abba0f5752def9 100644
--- a/ui/base/ime/input_method_base_unittest.cc
+++ b/ui/base/ime/input_method_base_unittest.cc
@@ -129,6 +129,8 @@ class SimpleMockInputMethodBase : public InputMethodBase {
}
virtual void CancelComposition(const TextInputClient* client) OVERRIDE {
}
+ virtual void OnInputLocaleChanged() OVERRIDE {
+ }
virtual std::string GetInputLocale() OVERRIDE{
return "";
}
@@ -184,9 +186,6 @@ class SimpleMockInputMethodObserver : public InputMethodObserver {
size_t on_caret_bounds_changed() const {
return on_caret_bounds_changed_;
}
- size_t on_input_locale_changed() const {
- return on_input_locale_changed_;
- }
private:
// Overriden from InputMethodObserver.
@@ -196,15 +195,9 @@ class SimpleMockInputMethodObserver : public InputMethodObserver {
}
virtual void OnBlur() OVERRIDE{
}
- virtual void OnUntranslatedIMEMessage(
- const base::NativeEvent& event) OVERRIDE{
- }
virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE{
++on_caret_bounds_changed_;
}
- virtual void OnInputLocaleChanged() OVERRIDE{
- ++on_input_locale_changed_;
- }
virtual void OnTextInputStateChanged(const TextInputClient* client) OVERRIDE{
}
virtual void OnInputMethodDestroyed(const InputMethod* client) OVERRIDE{
@@ -387,32 +380,5 @@ TEST(InputMethodBaseTest, OnCaretBoundsChanged) {
}
}
-TEST(InputMethodBaseTest, OnInputLocaleChanged) {
- DummyTextInputClient text_input_client;
-
- SimpleMockInputMethodBase input_method;
- SimpleMockInputMethodObserver input_method_observer;
- InputMethodScopedObserver scoped_observer(&input_method_observer);
- scoped_observer.Add(&input_method);
-
- // Assume that the top-level-widget gains focus.
- input_method.OnFocus();
-
- {
- SCOPED_TRACE("OnInputLocaleChanged callback can be fired even when no text "
- "input client is focused");
- ASSERT_EQ(NULL, input_method.GetTextInputClient());
-
- input_method_observer.Reset();
- input_method.OnInputLocaleChanged();
- EXPECT_EQ(1u, input_method_observer.on_input_locale_changed());
-
- input_method.SetFocusedTextInputClient(&text_input_client);
- input_method_observer.Reset();
- input_method.OnInputLocaleChanged();
- EXPECT_EQ(1u, input_method_observer.on_input_locale_changed());
- }
-}
-
} // namespace
} // namespace ui
« no previous file with comments | « ui/base/ime/input_method_base.cc ('k') | ui/base/ime/input_method_ibus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698