| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/base/ime/input_method_base.h" | 5 #include "ui/base/ime/input_method_base.h" |
| 6 | 6 |
| 7 #include "base/gtest_prod_util.h" | 7 #include "base/gtest_prod_util.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 private: | 186 private: |
| 187 void OnTextInputTypeChanged(const TextInputClient* client) override {} | 187 void OnTextInputTypeChanged(const TextInputClient* client) override {} |
| 188 void OnFocus() override {} | 188 void OnFocus() override {} |
| 189 void OnBlur() override {} | 189 void OnBlur() override {} |
| 190 void OnCaretBoundsChanged(const TextInputClient* client) override {} | 190 void OnCaretBoundsChanged(const TextInputClient* client) override {} |
| 191 void OnTextInputStateChanged(const TextInputClient* client) override { | 191 void OnTextInputStateChanged(const TextInputClient* client) override { |
| 192 verifier_->OnTextInputStateChanged(client); | 192 verifier_->OnTextInputStateChanged(client); |
| 193 } | 193 } |
| 194 void OnShowImeIfNeeded() override {} | 194 void OnShowImeIfNeeded() override {} |
| 195 void OnInputMethodDestroyed(const InputMethod* client) override {} | 195 void OnInputMethodDestroyed(const InputMethod* client) override {} |
| 196 void OnKeyboardBoundsUnchanged() override {} |
| 196 | 197 |
| 197 ClientChangeVerifier* verifier_; | 198 ClientChangeVerifier* verifier_; |
| 198 DISALLOW_COPY_AND_ASSIGN(MockInputMethodObserver); | 199 DISALLOW_COPY_AND_ASSIGN(MockInputMethodObserver); |
| 199 }; | 200 }; |
| 200 | 201 |
| 201 class MockTextInputClient : public DummyTextInputClient { | 202 class MockTextInputClient : public DummyTextInputClient { |
| 202 public: | 203 public: |
| 203 MockTextInputClient() | 204 MockTextInputClient() |
| 204 : shown_event_count_(0), updated_event_count_(0), hidden_event_count_(0) { | 205 : shown_event_count_(0), updated_event_count_(0), hidden_event_count_(0) { |
| 205 } | 206 } |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 // If InputMethod is deleted immediately after an event happens, but before | 381 // If InputMethod is deleted immediately after an event happens, but before |
| 381 // its callback is invoked, the callback will be cancelled. | 382 // its callback is invoked, the callback will be cancelled. |
| 382 base::RunLoop().RunUntilIdle(); | 383 base::RunLoop().RunUntilIdle(); |
| 383 EXPECT_EQ(1, text_input_client.shown_event_count()); | 384 EXPECT_EQ(1, text_input_client.shown_event_count()); |
| 384 EXPECT_EQ(1, text_input_client.updated_event_count()); | 385 EXPECT_EQ(1, text_input_client.updated_event_count()); |
| 385 EXPECT_EQ(1, text_input_client.hidden_event_count()); | 386 EXPECT_EQ(1, text_input_client.hidden_event_count()); |
| 386 } | 387 } |
| 387 | 388 |
| 388 } // namespace | 389 } // namespace |
| 389 } // namespace ui | 390 } // namespace ui |
| OLD | NEW |