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

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

Issue 1163603004: Remove candidate show/hide/update related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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/base/ime/input_method_base.cc ('k') | ui/base/ime/input_method_win.cc » ('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 129d3c531e74d2c53bc3d544826d7e58b49e9944..55db6f9d19fcd1017746eeef1331e1075579e603 100644
--- a/ui/base/ime/input_method_base_unittest.cc
+++ b/ui/base/ime/input_method_base_unittest.cc
@@ -198,27 +198,6 @@ class MockInputMethodObserver : public InputMethodObserver {
DISALLOW_COPY_AND_ASSIGN(MockInputMethodObserver);
};
-class MockTextInputClient : public DummyTextInputClient {
- public:
- MockTextInputClient()
- : shown_event_count_(0), updated_event_count_(0), hidden_event_count_(0) {
- }
- ~MockTextInputClient() override {}
-
- void OnCandidateWindowShown() override { ++shown_event_count_; }
- void OnCandidateWindowUpdated() override { ++updated_event_count_; }
- void OnCandidateWindowHidden() override { ++hidden_event_count_; }
-
- int shown_event_count() const { return shown_event_count_; }
- int updated_event_count() const { return updated_event_count_; }
- int hidden_event_count() const { return hidden_event_count_; }
-
- private:
- int shown_event_count_;
- int updated_event_count_;
- int hidden_event_count_;
-};
-
typedef ScopedObserver<InputMethod, InputMethodObserver>
InputMethodScopedObserver;
@@ -338,52 +317,5 @@ TEST_F(InputMethodBaseTest, DetachTextInputClient) {
}
}
-TEST_F(InputMethodBaseTest, CandidateWindowEvents) {
- MockTextInputClient text_input_client;
-
- {
- ClientChangeVerifier verifier;
- MockInputMethodBase input_method_base(&verifier);
- input_method_base.OnFocus();
-
- verifier.ExpectClientChange(NULL, &text_input_client);
- SetFocusedTextInputClient(&input_method_base, &text_input_client);
-
- EXPECT_EQ(0, text_input_client.shown_event_count());
- EXPECT_EQ(0, text_input_client.updated_event_count());
- EXPECT_EQ(0, text_input_client.hidden_event_count());
-
- input_method_base.OnCandidateWindowShown();
- base::RunLoop().RunUntilIdle();
-
- EXPECT_EQ(1, text_input_client.shown_event_count());
- EXPECT_EQ(0, text_input_client.updated_event_count());
- EXPECT_EQ(0, text_input_client.hidden_event_count());
-
- input_method_base.OnCandidateWindowUpdated();
- base::RunLoop().RunUntilIdle();
-
- EXPECT_EQ(1, text_input_client.shown_event_count());
- EXPECT_EQ(1, text_input_client.updated_event_count());
- EXPECT_EQ(0, text_input_client.hidden_event_count());
-
- input_method_base.OnCandidateWindowHidden();
- base::RunLoop().RunUntilIdle();
-
- EXPECT_EQ(1, text_input_client.shown_event_count());
- EXPECT_EQ(1, text_input_client.updated_event_count());
- EXPECT_EQ(1, text_input_client.hidden_event_count());
-
- input_method_base.OnCandidateWindowShown();
- }
-
- // If InputMethod is deleted immediately after an event happens, but before
- // its callback is invoked, the callback will be cancelled.
- base::RunLoop().RunUntilIdle();
- EXPECT_EQ(1, text_input_client.shown_event_count());
- EXPECT_EQ(1, text_input_client.updated_event_count());
- EXPECT_EQ(1, text_input_client.hidden_event_count());
-}
-
} // namespace
} // namespace ui
« no previous file with comments | « ui/base/ime/input_method_base.cc ('k') | ui/base/ime/input_method_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698