| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/input_method/mock_ibus_controller.h" | 5 #include "chrome/browser/chromeos/input_method/mock_ibus_controller.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/input_method/input_method_config.h" | 7 #include "chrome/browser/chromeos/input_method/input_method_config.h" |
| 8 #include "chrome/browser/chromeos/input_method/input_method_property.h" | 8 #include "chrome/browser/chromeos/input_method/input_method_property.h" |
| 9 | 9 |
| 10 namespace chromeos { | 10 namespace chromeos { |
| 11 namespace input_method { | 11 namespace input_method { |
| 12 | 12 |
| 13 MockIBusController::MockIBusController() | 13 MockIBusController::MockIBusController() |
| 14 : start_count_(0), | 14 : start_count_(0), |
| 15 start_return_(true), | 15 start_return_(true), |
| 16 reset_count_(0), |
| 16 stop_count_(0), | 17 stop_count_(0), |
| 17 stop_return_(true), | 18 stop_return_(true), |
| 18 change_input_method_count_(0), | 19 change_input_method_count_(0), |
| 19 change_input_method_return_(true), | 20 change_input_method_return_(true), |
| 20 activate_input_method_property_count_(0), | 21 activate_input_method_property_count_(0), |
| 21 activate_input_method_property_return_(true), | 22 activate_input_method_property_return_(true), |
| 22 set_input_method_config_internal_count_(0), | 23 set_input_method_config_internal_count_(0), |
| 23 set_input_method_config_internal_return_(true) { | 24 set_input_method_config_internal_return_(true) { |
| 24 } | 25 } |
| 25 | 26 |
| 26 MockIBusController::~MockIBusController() { | 27 MockIBusController::~MockIBusController() { |
| 27 } | 28 } |
| 28 | 29 |
| 29 bool MockIBusController::Start() { | 30 bool MockIBusController::Start() { |
| 30 ++start_count_; | 31 ++start_count_; |
| 31 return start_return_; | 32 return start_return_; |
| 32 } | 33 } |
| 33 | 34 |
| 35 void MockIBusController::Reset() { |
| 36 ++reset_count_; |
| 37 } |
| 38 |
| 34 bool MockIBusController::Stop() { | 39 bool MockIBusController::Stop() { |
| 35 ++stop_count_; | 40 ++stop_count_; |
| 36 return stop_return_; | 41 return stop_return_; |
| 37 } | 42 } |
| 38 | 43 |
| 39 bool MockIBusController::ChangeInputMethod(const std::string& id) { | 44 bool MockIBusController::ChangeInputMethod(const std::string& id) { |
| 40 ++change_input_method_count_; | 45 ++change_input_method_count_; |
| 41 | 46 |
| 42 // Emulate IBusController's behavior. | 47 // Emulate IBusController's behavior. |
| 43 if (id != change_input_method_id_) { | 48 if (id != change_input_method_id_) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 59 const ConfigKeyType& key, | 64 const ConfigKeyType& key, |
| 60 const InputMethodConfigValue& value) { | 65 const InputMethodConfigValue& value) { |
| 61 ++set_input_method_config_internal_count_; | 66 ++set_input_method_config_internal_count_; |
| 62 set_input_method_config_internal_key_ = key; | 67 set_input_method_config_internal_key_ = key; |
| 63 set_input_method_config_internal_value_ = value; | 68 set_input_method_config_internal_value_ = value; |
| 64 return set_input_method_config_internal_return_; | 69 return set_input_method_config_internal_return_; |
| 65 } | 70 } |
| 66 | 71 |
| 67 } // namespace input_method | 72 } // namespace input_method |
| 68 } // namespace chromeos | 73 } // namespace chromeos |
| OLD | NEW |