| 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/remote_input_method_win.h" | 5 #include "ui/base/ime/remote_input_method_win.h" |
| 6 | 6 |
| 7 #include <InputScope.h> | 7 #include <InputScope.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 MockInputMethodDelegate() {} | 152 MockInputMethodDelegate() {} |
| 153 | 153 |
| 154 const std::vector<ui::KeyboardCode>& fabricated_key_events() const { | 154 const std::vector<ui::KeyboardCode>& fabricated_key_events() const { |
| 155 return fabricated_key_events_; | 155 return fabricated_key_events_; |
| 156 } | 156 } |
| 157 void Reset() { | 157 void Reset() { |
| 158 fabricated_key_events_.clear(); | 158 fabricated_key_events_.clear(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 private: | 161 private: |
| 162 virtual bool DispatchKeyEventPostIME( | 162 virtual bool DispatchKeyEventPostIME(const ui::KeyEvent& event) OVERRIDE { |
| 163 const base::NativeEvent& native_key_event) OVERRIDE { | 163 EXPECT_FALSE(event.HasNativeEvent()); |
| 164 EXPECT_TRUE(false) << "Not reach here"; | 164 fabricated_key_events_.push_back(event.key_code()); |
| 165 return true; | |
| 166 } | |
| 167 virtual bool DispatchFabricatedKeyEventPostIME(ui::EventType type, | |
| 168 ui::KeyboardCode key_code, | |
| 169 int flags) OVERRIDE { | |
| 170 fabricated_key_events_.push_back(key_code); | |
| 171 return true; | 165 return true; |
| 172 } | 166 } |
| 173 | 167 |
| 174 std::vector<ui::KeyboardCode> fabricated_key_events_; | 168 std::vector<ui::KeyboardCode> fabricated_key_events_; |
| 175 DISALLOW_COPY_AND_ASSIGN(MockInputMethodDelegate); | 169 DISALLOW_COPY_AND_ASSIGN(MockInputMethodDelegate); |
| 176 }; | 170 }; |
| 177 | 171 |
| 178 class MockRemoteInputMethodDelegateWin | 172 class MockRemoteInputMethodDelegateWin |
| 179 : public internal::RemoteInputMethodDelegateWin { | 173 : public internal::RemoteInputMethodDelegateWin { |
| 180 public: | 174 public: |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 scoped_ptr<InputMethod> input_method(CreateRemoteInputMethodWin(&delegate_)); | 838 scoped_ptr<InputMethod> input_method(CreateRemoteInputMethodWin(&delegate_)); |
| 845 input_method->AddObserver(&input_method_observer); | 839 input_method->AddObserver(&input_method_observer); |
| 846 | 840 |
| 847 EXPECT_EQ(0u, input_method_observer.on_input_method_destroyed_changed()); | 841 EXPECT_EQ(0u, input_method_observer.on_input_method_destroyed_changed()); |
| 848 input_method.reset(); | 842 input_method.reset(); |
| 849 EXPECT_EQ(1u, input_method_observer.on_input_method_destroyed_changed()); | 843 EXPECT_EQ(1u, input_method_observer.on_input_method_destroyed_changed()); |
| 850 } | 844 } |
| 851 | 845 |
| 852 } // namespace | 846 } // namespace |
| 853 } // namespace ui | 847 } // namespace ui |
| OLD | NEW |