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

Unified Diff: chrome/browser/chromeos/input_method/mock_ibus_controller.cc

Issue 9999018: chrome/browser/chromeos/input_method/ refactoring [part 6 of 6] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, remove preferences.h and language_preference.* from this CL Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/input_method/mock_ibus_controller.cc
diff --git a/chrome/browser/chromeos/input_method/mock_ibus_controller.cc b/chrome/browser/chromeos/input_method/mock_ibus_controller.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4a1389845e0427df11850e31a269229c6d0ddbfc
--- /dev/null
+++ b/chrome/browser/chromeos/input_method/mock_ibus_controller.cc
@@ -0,0 +1,67 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/input_method/mock_ibus_controller.h"
+
+#include "chrome/browser/chromeos/input_method/input_method_config.h"
+#include "chrome/browser/chromeos/input_method/input_method_property.h"
+
+namespace chromeos {
+namespace input_method {
+
+MockIBusController::MockIBusController()
+ : start_count_(0),
+ start_return_(true),
+ stop_count_(0),
+ stop_return_(true),
+ change_input_method_count_(0),
+ change_input_method_return_(true),
+ activate_input_method_property_count_(0),
+ activate_input_method_property_return_(true),
+ set_input_method_config_internal_count_(0),
+ set_input_method_config_internal_return_(true) {
+}
+
+MockIBusController::~MockIBusController() {
+}
+
+bool MockIBusController::Start(const std::vector<std::string>& ids) {
+ ++start_count_;
+ start_ids_ = ids;
+ return start_return_;
+}
+
+bool MockIBusController::Stop() {
+ ++stop_count_;
+ return stop_return_;
+}
+
+bool MockIBusController::ChangeInputMethod(const std::string& id) {
+ ++change_input_method_count_;
+ change_input_method_id_ = id;
+
+ // Emulate IBusController's behavior.
+ current_property_list_.clear();
+ NotifyPropertyChangedForTesting();
+
+ return change_input_method_return_;
+}
+
+bool MockIBusController::ActivateInputMethodProperty(const std::string& key) {
+ ++activate_input_method_property_count_;
+ activate_input_method_property_key_ = key;
+ return activate_input_method_property_return_;
+}
+
+bool MockIBusController::SetInputMethodConfigInternal(
+ const ConfigKeyType& key,
+ const InputMethodConfigValue& value) {
+ ++set_input_method_config_internal_count_;
+ set_input_method_config_internal_key_ = key;
+ set_input_method_config_internal_value_ = value;
+ return set_input_method_config_internal_return_;
+}
+
+} // namespace input_method
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698