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

Unified Diff: ui/base/ime/remote_input_method_win_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/remote_input_method_win.cc ('k') | ui/keyboard/keyboard_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/remote_input_method_win_unittest.cc
diff --git a/ui/base/ime/remote_input_method_win_unittest.cc b/ui/base/ime/remote_input_method_win_unittest.cc
index 39490b9a246928efd4356f4c546d8172ea9cc4ad..c0dbf1d9231df1cefda0183d39ece8580a5097be 100644
--- a/ui/base/ime/remote_input_method_win_unittest.cc
+++ b/ui/base/ime/remote_input_method_win_unittest.cc
@@ -168,7 +168,6 @@ class MockInputMethodObserver : public InputMethodObserver {
MockInputMethodObserver()
: on_text_input_type_changed_(0),
on_caret_bounds_changed_(0),
- on_input_locale_changed_(0),
on_text_input_state_changed_(0),
on_input_method_destroyed_changed_(0) {
}
@@ -177,7 +176,6 @@ class MockInputMethodObserver : public InputMethodObserver {
void Reset() {
on_text_input_type_changed_ = 0;
on_caret_bounds_changed_ = 0;
- on_input_locale_changed_ = 0;
on_text_input_state_changed_ = 0;
on_input_method_destroyed_changed_ = 0;
}
@@ -187,9 +185,6 @@ class MockInputMethodObserver : 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_;
- }
size_t on_text_input_state_changed() const {
return on_text_input_state_changed_;
}
@@ -206,15 +201,9 @@ class MockInputMethodObserver : 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 {
++on_text_input_state_changed_;
}
@@ -224,7 +213,6 @@ class MockInputMethodObserver : public InputMethodObserver {
size_t on_text_input_type_changed_;
size_t on_caret_bounds_changed_;
- size_t on_input_locale_changed_;
size_t on_text_input_state_changed_;
size_t on_input_method_destroyed_changed_;
DISALLOW_COPY_AND_ASSIGN(MockInputMethodObserver);
@@ -722,32 +710,6 @@ TEST(RemoteInputMethodWinTest, OnCaretBoundsChanged_Observer) {
}
}
-TEST(RemoteInputMethodWinTest, OnInputLocaleChanged_Observer) {
- DummyTextInputClient text_input_client;
-
- MockInputMethodObserver input_method_observer;
-
- MockInputMethodDelegate delegate_;
- scoped_ptr<InputMethod> input_method(CreateRemoteInputMethodWin(&delegate_));
- InputMethodScopedObserver scoped_observer(&input_method_observer);
- scoped_observer.Add(input_method.get());
-
- {
- 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());
- }
-}
-
TEST(RemoteInputMethodWinTest, OnInputMethodDestroyed_Observer) {
DummyTextInputClient text_input_client;
DummyTextInputClient text_input_client_the_other;
« no previous file with comments | « ui/base/ime/remote_input_method_win.cc ('k') | ui/keyboard/keyboard_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698