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.
5 #include "chromeos/ime/mock_ime_engine_handler.h"
9 MockIMEEngineHandler::MockIMEEngineHandler()
10 : focus_in_call_count_(0),
11 focus_out_call_count_(0),
12 set_surrounding_text_call_count_(0),
13 process_key_event_call_count_(0),
15 last_set_surrounding_cursor_pos_(0),
16 last_set_surrounding_anchor_pos_(0),
17 last_processed_keysym_(0),
18 last_processed_keycode_(0),
19 last_processed_state_(0) {
22 MockIMEEngineHandler::~MockIMEEngineHandler() {
25 void MockIMEEngineHandler::FocusIn() {
26 ++focus_in_call_count_
;
29 void MockIMEEngineHandler::FocusOut() {
30 ++focus_out_call_count_
;
33 void MockIMEEngineHandler::Enable() {
36 void MockIMEEngineHandler::Disable() {
39 void MockIMEEngineHandler::PropertyActivate(const std::string
& property_name
) {
42 void MockIMEEngineHandler::PropertyShow(const std::string
& property_name
) {
45 void MockIMEEngineHandler::PropertyHide(const std::string
& property_name
) {
48 void MockIMEEngineHandler::SetCapability(IBusCapability capability
) {
51 void MockIMEEngineHandler::Reset() {
55 void MockIMEEngineHandler::ProcessKeyEvent(
59 const KeyEventDoneCallback
& callback
) {
60 ++process_key_event_call_count_
;
61 last_processed_keysym_
= keysym
;
62 last_processed_keycode_
= keycode
;
63 last_processed_state_
= state
;
64 last_passed_callback_
= callback
;
67 void MockIMEEngineHandler::CandidateClicked(uint32 index
,
68 ibus::IBusMouseButton button
,
72 void MockIMEEngineHandler::SetSurroundingText(const std::string
& text
,
75 ++set_surrounding_text_call_count_
;
76 last_set_surrounding_text_
= text
;
77 last_set_surrounding_cursor_pos_
= cursor_pos
;
78 last_set_surrounding_anchor_pos_
= anchor_pos
;
81 } // namespace chromeos