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

Side by Side Diff: chromeos/ime/mock_ime_engine_handler.h

Issue 23822002: Adding new mock classes for input method handlers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROMEOS_IME_MOCK_IME_ENGINE_HANDLER_H_
6 #define CHROMEOS_IME_MOCK_IME_ENGINE_HANDLER_H_
7
8 #include "chromeos/ime/ibus_bridge.h"
9
10 namespace chromeos {
11
12 class MockIMEEngineHandler : public IBusEngineHandlerInterface {
13 public:
14 MockIMEEngineHandler();
15 virtual ~MockIMEEngineHandler();
16
17 virtual void FocusIn() OVERRIDE;
18 virtual void FocusOut() OVERRIDE;
19 virtual void Enable() OVERRIDE;
20 virtual void Disable() OVERRIDE;
21 virtual void PropertyActivate(
22 const std::string& property_name,
23 ibus::IBusPropertyState property_state) OVERRIDE;
24 virtual void PropertyShow(const std::string& property_name) OVERRIDE;
25 virtual void PropertyHide(const std::string& property_name) OVERRIDE;
26 virtual void SetCapability(IBusCapability capability) OVERRIDE;
27 virtual void Reset() OVERRIDE;
28 virtual void ProcessKeyEvent(uint32 keysym, uint32 keycode, uint32 state,
29 const KeyEventDoneCallback& callback) OVERRIDE;
30 virtual void CandidateClicked(uint32 index, ibus::IBusMouseButton button,
31 uint32 state) OVERRIDE;
32 virtual void SetSurroundingText(const std::string& text, uint32 cursor_pos,
33 uint32 anchor_pos) OVERRIDE;
34
35 int focus_in_call_count() const { return focus_in_call_count_; }
36 int focus_out_call_count() const { return focus_out_call_count_; }
37 int reset_call_count() const { return reset_call_count_; }
38 int set_surrounding_text_call_count() const {
39 return set_surrounding_text_call_count_;
40 }
41 int process_key_event_call_count() const {
42 return process_key_event_call_count_;
43 }
44
45 std::string last_set_surrounding_text() const {
46 return last_set_surrounding_text_;
47 }
48
49 uint32 last_set_surrounding_cursor_pos() const {
50 return last_set_surrounding_cursor_pos_;
51 }
52
53 uint32 last_set_surrounding_anchor_pos() const {
54 return last_set_surrounding_anchor_pos_;
55 }
56
57 uint32 last_processed_keysym() const {
58 return last_processed_keysym_;
59 }
60
61 uint32 last_processed_keycode() const {
62 return last_processed_keycode_;
63 }
64
65 uint32 last_processed_state() const {
66 return last_processed_state_;
67 }
68
69 const KeyEventDoneCallback& last_passed_callback() const {
70 return last_passed_callback_;
71 }
72
73 private:
74 int focus_in_call_count_;
75 int focus_out_call_count_;
76 int set_surrounding_text_call_count_;
77 int process_key_event_call_count_;
78 int reset_call_count_;
79 std::string last_set_surrounding_text_;
80 uint32 last_set_surrounding_cursor_pos_;
81 uint32 last_set_surrounding_anchor_pos_;
82 uint32 last_processed_keysym_;
83 uint32 last_processed_keycode_;
84 uint32 last_processed_state_;
85 KeyEventDoneCallback last_passed_callback_;
86 };
87
88 } // namespace chromeos
89
90 #endif // CHROMEOS_IME_MOCK_IME_ENGINE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698