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

Side by Side Diff: ui/base/ime/remote_input_method_win_unittest.cc

Issue 142043006: Refactors ui::internal::InputMethodDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed an issue of unsigned/signed comparison. Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/ime/remote_input_method_win.cc ('k') | ui/events/event.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/base/ime/remote_input_method_win.cc ('k') | ui/events/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698