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

Unified Diff: chromeos/ime/mock_ime_candidate_window_handler.cc

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, 4 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: chromeos/ime/mock_ime_candidate_window_handler.cc
diff --git a/chromeos/ime/mock_ime_candidate_window_handler.cc b/chromeos/ime/mock_ime_candidate_window_handler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f32e65d41a0e469c99189a945116f3d9e08ab4b7
--- /dev/null
+++ b/chromeos/ime/mock_ime_candidate_window_handler.cc
@@ -0,0 +1,60 @@
+// Copyright 2013 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 "chromeos/ime/mock_ime_candidate_window_handler.h"
+
+namespace chromeos {
+
+MockIMECandidateWindowHandler::MockIMECandidateWindowHandler()
+ : set_cursor_location_call_count_(0),
+ update_lookup_table_call_count_(0),
+ update_auxiliary_text_call_count_(0) {
+}
+
+MockIMECandidateWindowHandler::~MockIMECandidateWindowHandler() {
+
+}
+
+void MockIMECandidateWindowHandler::UpdateLookupTable(
+ const IBusLookupTable& table,
+ bool visible) {
+ ++update_lookup_table_call_count_;
+ last_update_lookup_table_arg_.lookup_table.CopyFrom(table);
+ last_update_lookup_table_arg_.is_visible = visible;
+}
+
+void MockIMECandidateWindowHandler::HideLookupTable() {
+}
+
+void MockIMECandidateWindowHandler::UpdateAuxiliaryText(const std::string& text,
+ bool visible) {
+ ++update_auxiliary_text_call_count_;
+ last_update_auxiliary_text_arg_.text = text;
+ last_update_auxiliary_text_arg_.is_visible = visible;
+}
+
+void MockIMECandidateWindowHandler::HideAuxiliaryText() {
+}
+
+void MockIMECandidateWindowHandler::UpdatePreeditText(const std::string& text,
+ uint32 cursor_pos,
+ bool visible) {
+}
+
+void MockIMECandidateWindowHandler::HidePreeditText() {
+}
+
+void MockIMECandidateWindowHandler::SetCursorLocation(
+ const ibus::Rect& cursor_location,
+ const ibus::Rect& composition_head) {
+ set_cursor_location_call_count_++;
satorux1 2013/09/02 01:45:40 nit: ++set_cursor_location_call_count_; pre-incre
Seigo Nonaka 2013/09/02 03:03:10 Done.
+}
+
+void MockIMECandidateWindowHandler::Reset() {
+ set_cursor_location_call_count_ = 0;
+ update_lookup_table_call_count_ = 0;
+ update_auxiliary_text_call_count_ = 0;
+}
+
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698