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

Unified Diff: ui/views/ime/input_method_bridge_unittest.cc

Issue 23875014: Simplify InputMethodBridgeUnitTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary blank line at the end of file Created 7 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/base/ime/ime.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/ime/input_method_bridge_unittest.cc
diff --git a/ui/views/ime/input_method_bridge_unittest.cc b/ui/views/ime/input_method_bridge_unittest.cc
index f04615291f05b3318e10a8f38e230f64f8cc35b3..64a1247073165dd3032eafc6c22841fdc7195504 100644
--- a/ui/views/ime/input_method_bridge_unittest.cc
+++ b/ui/views/ime/input_method_bridge_unittest.cc
@@ -4,7 +4,8 @@
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
-#include "ui/base/ime/dummy_input_method.h"
+#include "ui/base/ime/dummy_input_method_delegate.h"
+#include "ui/base/ime/fake_input_method.h"
#include "ui/base/ime/text_input_client.h"
#include "ui/views/ime/input_method.h"
#include "ui/views/test/views_test_base.h"
@@ -16,41 +17,10 @@ namespace views {
typedef ViewsTestBase InputMethodBridgeTest;
-namespace {
-
-class TestInputMethod : public ui::DummyInputMethod {
- public:
- TestInputMethod();
- virtual ~TestInputMethod();
-
- virtual void SetFocusedTextInputClient(ui::TextInputClient* client) OVERRIDE;
- virtual ui::TextInputClient* GetTextInputClient() const OVERRIDE;
-
- private:
- ui::TextInputClient* text_input_client_;
-
- DISALLOW_COPY_AND_ASSIGN(TestInputMethod);
-};
-
-TestInputMethod::TestInputMethod() : text_input_client_(NULL) {}
-
-TestInputMethod::~TestInputMethod() {}
-
-void TestInputMethod::SetFocusedTextInputClient(ui::TextInputClient* client) {
- // This simulates what the real InputMethod implementation does.
- if (text_input_client_)
- text_input_client_->GetTextInputType();
- text_input_client_ = client;
-}
-
-ui::TextInputClient* TestInputMethod::GetTextInputClient() const {
- return text_input_client_;
-}
-
-} // namespace
-
TEST_F(InputMethodBridgeTest, DestructTest) {
- TestInputMethod input_method;
+ ui::internal::DummyInputMethodDelegate input_method_delegate;
+ ui::FakeInputMethod input_method(&input_method_delegate);
+
GetContext()->SetProperty(aura::client::kRootWindowInputMethodKey,
static_cast<ui::InputMethod*>(&input_method));
« no previous file with comments | « ui/base/ime/ime.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698