diff options
author | nona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-04 08:13:01 +0000 |
---|---|---|
committer | nona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-04 08:13:01 +0000 |
commit | 246879a95bc7273e14b080e0b51dde935c432548 (patch) | |
tree | 3a02f2622037a2fd529d06af2ba33cf0413f802e | |
parent | 81e361f411a6e7e434ab2f35515087744b912340 (diff) | |
download | chromium_src-246879a95bc7273e14b080e0b51dde935c432548.zip chromium_src-246879a95bc7273e14b080e0b51dde935c432548.tar.gz chromium_src-246879a95bc7273e14b080e0b51dde935c432548.tar.bz2 |
Introduce TextInputBrowsertest.
This test verifies that the TextInputType should change expected value when the focused node is changed by JavaScript.
This CL is a pilot change to check interactive_ui_tests can perform text input related testing.
We can't use browser_tests because text input related tests require unique focus and UI interaction.
If this patch works fine, I will introduce more tests to increase test coverage.
BUG=173951
TEST=try bots
Review URL: https://chromiumcodereview.appspot.com/12093105
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180360 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chromeos/input_method/DEPS | 4 | ||||
-rw-r--r-- | chrome/browser/chromeos/input_method/textinput_browsertest.cc | 74 | ||||
-rw-r--r-- | chrome/chrome_tests.gypi | 1 | ||||
-rw-r--r-- | chrome/test/data/textinput/ime_enable_disable_test.html | 31 | ||||
-rw-r--r-- | ui/base/ime/fake_input_method.cc | 124 | ||||
-rw-r--r-- | ui/base/ime/fake_input_method.h | 54 | ||||
-rw-r--r-- | ui/base/ime/ime.gypi | 2 | ||||
-rw-r--r-- | ui/base/ime/input_method_factory.cc | 15 | ||||
-rw-r--r-- | ui/base/ime/input_method_factory.h | 3 | ||||
-rw-r--r-- | ui/base/ime/mock_input_method.cc | 121 | ||||
-rw-r--r-- | ui/base/ime/mock_input_method.h | 71 |
11 files changed, 423 insertions, 77 deletions
diff --git a/chrome/browser/chromeos/input_method/DEPS b/chrome/browser/chromeos/input_method/DEPS index 0294033..323c9b8 100644 --- a/chrome/browser/chromeos/input_method/DEPS +++ b/chrome/browser/chromeos/input_method/DEPS @@ -6,8 +6,8 @@ include_rules = [ specific_include_rules = { # The configuration layer. - '(input_method_delegate_impl|input_method_persistence|browser_state_monitor)' - '(_unittest)?\.(h|cc)': [ + '(input_method_delegate_impl|input_method_persistence|browser_state_monitor|' + 'textinput)((_unit|_browser)test)?\.(h|cc)': [ "+chrome/common", "+chrome/browser", "+chrome/test", diff --git a/chrome/browser/chromeos/input_method/textinput_browsertest.cc b/chrome/browser/chromeos/input_method/textinput_browsertest.cc new file mode 100644 index 0000000..6822ba5 --- /dev/null +++ b/chrome/browser/chromeos/input_method/textinput_browsertest.cc @@ -0,0 +1,74 @@ +// 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 "ash/shell.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/tabs/tab_strip_model.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "chrome/test/base/interactive_test_utils.h" +#include "content/public/test/browser_test_utils.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/aura/client/aura_constants.h" +#include "ui/aura/root_window.h" +#include "ui/base/ime/input_method_factory.h" +#include "ui/base/ime/mock_input_method.h" + +namespace chromeos { + +class TextInputTest : public InProcessBrowserTest { + public: + TextInputTest() {} + virtual ~TextInputTest() {} + + protected: + virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { + ui::SetUpInputMethodFacotryForTesting(); + } + + ui::MockInputMethod* GetInputMethod() { + ui::MockInputMethod* input_method = + static_cast<ui::MockInputMethod*>( + ash::Shell::GetPrimaryRootWindow()->GetProperty( + aura::client::kRootWindowInputMethodKey)); + CHECK(input_method); + return input_method; + } +}; + +IN_PROC_BROWSER_TEST_F(TextInputTest, SwitchToPasswordFieldTest) { + GURL url = ui_test_utils::GetTestUrl( + FilePath("textinput"), + FilePath("ime_enable_disable_test.html")); + ui_test_utils::NavigateToURL(browser(), url); + + content::WebContents* tab = + browser()->tab_strip_model()->GetActiveWebContents(); + + bool worker_finished = false; + ASSERT_TRUE(content::ExecuteScriptAndExtractBool( + tab, + "window.domAutomationController.send(text01_focus());", + &worker_finished)); + EXPECT_TRUE(worker_finished); + content::WaitForLoadStop(tab); + content::RunAllPendingInMessageLoop(); + + EXPECT_EQ(GetInputMethod()->latest_text_input_type(), + ui::TEXT_INPUT_TYPE_TEXT); + + worker_finished = false; + ASSERT_TRUE(content::ExecuteScriptAndExtractBool( + tab, + "window.domAutomationController.send(password01_focus());", + &worker_finished)); + EXPECT_TRUE(worker_finished); + content::WaitForLoadStop(tab); + content::RunAllPendingInMessageLoop(); + + EXPECT_EQ(GetInputMethod()->latest_text_input_type(), + ui::TEXT_INPUT_TYPE_PASSWORD); + +} + +} // namespace chromeos diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 3c77ec9..2be582e 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -343,6 +343,7 @@ 'browser/chromeos/cros/cros_in_process_browser_test.h', 'browser/chromeos/cros/cros_mock.cc', 'browser/chromeos/cros/cros_mock.h', + 'browser/chromeos/input_method/textinput_browsertest.cc', 'browser/chromeos/login/login_browsertest.cc', 'browser/chromeos/login/mock_authenticator.cc', 'browser/chromeos/login/mock_authenticator.h', diff --git a/chrome/test/data/textinput/ime_enable_disable_test.html b/chrome/test/data/textinput/ime_enable_disable_test.html new file mode 100644 index 0000000..336e289 --- /dev/null +++ b/chrome/test/data/textinput/ime_enable_disable_test.html @@ -0,0 +1,31 @@ +<html> + <head> + <script type="text/javascript"> + function text01_focus() { + document.getElementById('text01_id').focus(); + return true; + } + function text02_focus() { + document.getElementById('text02_id').focus(); + return true; + } + function password01_focus() { + document.getElementById('password01_id').focus(); + return true; + } + function password02_focus() { + document.getElementById('password02_id').focus(); + return true; + } + function onLoad() { + document.activeElement.blur(); + } + </script> + </head> + <body onload="onLoad()"> + <input type="text" id="text01_id"> + <input type="text" id="text02_id"> + <input type="password" id="password01_id"> + <input type="password" id="password02_id"> + </body> +</html> diff --git a/ui/base/ime/fake_input_method.cc b/ui/base/ime/fake_input_method.cc new file mode 100644 index 0000000..ffc73b1 --- /dev/null +++ b/ui/base/ime/fake_input_method.cc @@ -0,0 +1,124 @@ +// 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 "ui/base/ime/fake_input_method.h" + +#include "base/logging.h" +#include "base/string16.h" +#include "ui/base/events/event.h" +#include "ui/base/events/event_constants.h" +#include "ui/base/events/event_utils.h" +#include "ui/base/glib/glib_integers.h" +#include "ui/base/ime/input_method_delegate.h" +#include "ui/base/ime/text_input_client.h" +#include "ui/base/keycodes/keyboard_code_conversion.h" + +#if defined(USE_X11) +#include <X11/X.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include "ui/base/keycodes/keyboard_code_conversion_x.h" +#endif + +namespace { + +#if defined(USE_X11) +uint32 EventFlagsFromXFlags(unsigned int flags) { + return (flags & LockMask ? ui::EF_CAPS_LOCK_DOWN : 0U) | + (flags & ControlMask ? ui::EF_CONTROL_DOWN : 0U) | + (flags & ShiftMask ? ui::EF_SHIFT_DOWN : 0U) | + (flags & Mod1Mask ? ui::EF_ALT_DOWN : 0U); +} +#endif + +} // namespace + +namespace ui { + +FakeInputMethod::FakeInputMethod(internal::InputMethodDelegate* delegate) + : delegate_(NULL), + text_input_client_(NULL) { + SetDelegate(delegate); +} + +FakeInputMethod::~FakeInputMethod() { +} + +void FakeInputMethod::SetDelegate(internal::InputMethodDelegate* delegate) { + delegate_ = delegate; +} + +void FakeInputMethod::SetFocusedTextInputClient(TextInputClient* client) { + text_input_client_ = client; +} + +TextInputClient* FakeInputMethod::GetTextInputClient() const { + return text_input_client_; +} + +void FakeInputMethod::DispatchKeyEvent(const base::NativeEvent& native_event) { +#if defined(OS_WIN) + if (native_event.message == WM_CHAR) { + if (text_input_client_) { + text_input_client_->InsertChar(ui::KeyboardCodeFromNative(native_event), + ui::EventFlagsFromNative(native_event)); + } + } else { + delegate_->DispatchKeyEventPostIME(native_event); + } +#elif defined(USE_X11) + DCHECK(native_event); + if (native_event->type == KeyRelease) { + // On key release, just dispatch it. + delegate_->DispatchKeyEventPostIME(native_event); + } else { + const uint32 state = EventFlagsFromXFlags(native_event->xkey.state); + // Send a RawKeyDown event first, + delegate_->DispatchKeyEventPostIME(native_event); + if (text_input_client_) { + // then send a Char event via ui::TextInputClient. + const KeyboardCode key_code = ui::KeyboardCodeFromNative(native_event); + uint16 ch = 0; + if (!(state & ui::EF_CONTROL_DOWN)) + ch = ui::GetCharacterFromXEvent(native_event); + if (!ch) + ch = ui::GetCharacterFromKeyCode(key_code, state); + if (ch) + text_input_client_->InsertChar(ch, state); + } + } +#else + // TODO(yusukes): Support other platforms. Call InsertChar() when necessary. + delegate_->DispatchKeyEventPostIME(native_event); +#endif +} + +void FakeInputMethod::Init(bool focused) {} +void FakeInputMethod::OnFocus() {} +void FakeInputMethod::OnBlur() {} +void FakeInputMethod::OnTextInputTypeChanged(const TextInputClient* client) {} +void FakeInputMethod::OnCaretBoundsChanged(const TextInputClient* client) {} +void FakeInputMethod::CancelComposition(const TextInputClient* client) {} + +std::string FakeInputMethod::GetInputLocale() { + return ""; +} + +base::i18n::TextDirection FakeInputMethod::GetInputTextDirection() { + return base::i18n::UNKNOWN_DIRECTION; +} + +bool FakeInputMethod::IsActive() { + return true; +} + +ui::TextInputType FakeInputMethod::GetTextInputType() const { + return ui::TEXT_INPUT_TYPE_NONE; +} + +bool FakeInputMethod::CanComposeInline() const { + return true; +} + +} // namespace ui diff --git a/ui/base/ime/fake_input_method.h b/ui/base/ime/fake_input_method.h new file mode 100644 index 0000000..596c4af --- /dev/null +++ b/ui/base/ime/fake_input_method.h @@ -0,0 +1,54 @@ +// 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. + +#ifndef UI_BASE_IME_FAKE_INPUT_METHOD_H_ +#define UI_BASE_IME_FAKE_INPUT_METHOD_H_ + +#include <string> + +#include "base/basictypes.h" +#include "base/compiler_specific.h" +#include "ui/base/ime/input_method.h" +#include "ui/base/ui_export.h" + +namespace ui { + +class KeyEvent; +class TextInputClient; + +// A fake ui::InputMethod implementation for minimum input support. +class UI_EXPORT FakeInputMethod : NON_EXPORTED_BASE(public InputMethod) { + public: + explicit FakeInputMethod(internal::InputMethodDelegate* delegate); + virtual ~FakeInputMethod(); + + // Overriden from InputMethod. + virtual void SetDelegate(internal::InputMethodDelegate* delegate) OVERRIDE; + virtual void Init(bool focused) OVERRIDE; + virtual void OnFocus() OVERRIDE; + virtual void OnBlur() OVERRIDE; + virtual void SetFocusedTextInputClient(TextInputClient* client) OVERRIDE; + virtual TextInputClient* GetTextInputClient() const OVERRIDE; + virtual void DispatchKeyEvent(const base::NativeEvent& native_event) OVERRIDE; + virtual void DispatchFabricatedKeyEvent(const ui::KeyEvent& event) OVERRIDE { + } + virtual void OnTextInputTypeChanged(const TextInputClient* client) OVERRIDE; + virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE; + virtual void CancelComposition(const TextInputClient* client) OVERRIDE; + virtual std::string GetInputLocale() OVERRIDE; + virtual base::i18n::TextDirection GetInputTextDirection() OVERRIDE; + virtual bool IsActive() OVERRIDE; + virtual ui::TextInputType GetTextInputType() const OVERRIDE; + virtual bool CanComposeInline() const OVERRIDE; + + private: + internal::InputMethodDelegate* delegate_; + TextInputClient* text_input_client_; + + DISALLOW_COPY_AND_ASSIGN(FakeInputMethod); +}; + +} // namespace ui + +#endif // UI_BASE_IME_FAKE_INPUT_METHOD_H_ diff --git a/ui/base/ime/ime.gypi b/ui/base/ime/ime.gypi index bd242b4..95ae3c4 100644 --- a/ui/base/ime/ime.gypi +++ b/ui/base/ime/ime.gypi @@ -22,6 +22,8 @@ 'input_method_win.h', 'mock_input_method.cc', 'mock_input_method.h', + 'fake_input_method.cc', + 'fake_input_method.h', 'text_input_client.cc', 'text_input_client.h', 'text_input_type.h', diff --git a/ui/base/ime/input_method_factory.cc b/ui/base/ime/input_method_factory.cc index 5bb5be0..ec97bbe 100644 --- a/ui/base/ime/input_method_factory.cc +++ b/ui/base/ime/input_method_factory.cc @@ -5,26 +5,37 @@ #include "ui/base/ime/input_method_factory.h" #include "ui/base/ime/input_method_delegate.h" +#include "ui/base/ime/mock_input_method.h" #if defined(OS_CHROMEOS) #include "ui/base/ime/input_method_ibus.h" #elif defined(OS_WIN) #include "ui/base/ime/input_method_win.h" #else -#include "ui/base/ime/mock_input_method.h" +#include "ui/base/ime/fake_input_method.h" #endif namespace ui { +namespace { +static bool g_input_method_set_for_testing = false; +} + InputMethod* CreateInputMethod(internal::InputMethodDelegate* delegate, gfx::AcceleratedWidget widget) { + if (g_input_method_set_for_testing) + return new MockInputMethod(delegate); #if defined(OS_CHROMEOS) return new InputMethodIBus(delegate); #elif defined(OS_WIN) return new InputMethodWin(delegate, widget); #else - return new MockInputMethod(delegate); + return new FakeInputMethod(delegate); #endif } +void SetUpInputMethodFacotryForTesting() { + g_input_method_set_for_testing = true; +} + } // namespace ui diff --git a/ui/base/ime/input_method_factory.h b/ui/base/ime/input_method_factory.h index db56bf74..0543edc 100644 --- a/ui/base/ime/input_method_factory.h +++ b/ui/base/ime/input_method_factory.h @@ -22,6 +22,9 @@ UI_EXPORT InputMethod* CreateInputMethod( internal::InputMethodDelegate* delegate, gfx::AcceleratedWidget widget); +// With calling this function, CreateInputMethod will return MockInputMethod. +UI_EXPORT void SetUpInputMethodFacotryForTesting(); + } // namespace ui; #endif // UI_BASE_IME_INPUT_METHOD_FACTORY_H_ diff --git a/ui/base/ime/mock_input_method.cc b/ui/base/ime/mock_input_method.cc index 62cd847..3a8e57e 100644 --- a/ui/base/ime/mock_input_method.cc +++ b/ui/base/ime/mock_input_method.cc @@ -4,41 +4,26 @@ #include "ui/base/ime/mock_input_method.h" -#include "base/logging.h" -#include "base/string16.h" -#include "ui/base/events/event.h" -#include "ui/base/events/event_constants.h" -#include "ui/base/events/event_utils.h" -#include "ui/base/glib/glib_integers.h" -#include "ui/base/ime/input_method_delegate.h" #include "ui/base/ime/text_input_client.h" -#include "ui/base/keycodes/keyboard_code_conversion.h" - -#if defined(USE_X11) -#include <X11/X.h> -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include "ui/base/keycodes/keyboard_code_conversion_x.h" -#endif - -namespace { - -#if defined(USE_X11) -uint32 EventFlagsFromXFlags(unsigned int flags) { - return (flags & LockMask ? ui::EF_CAPS_LOCK_DOWN : 0U) | - (flags & ControlMask ? ui::EF_CONTROL_DOWN : 0U) | - (flags & ShiftMask ? ui::EF_SHIFT_DOWN : 0U) | - (flags & Mod1Mask ? ui::EF_ALT_DOWN : 0U); -} -#endif - -} // namespace namespace ui { MockInputMethod::MockInputMethod(internal::InputMethodDelegate* delegate) : delegate_(NULL), - text_input_client_(NULL) { + text_input_client_(NULL), + init_callcount_(0), + on_focus_callcount_(0), + on_blur_callcaount_(0), + set_focused_text_input_client_callcount_(0), + dispatch_keyevent_callcount_(0), + dispatch_fabricated_keyevent_callcount_(0), + on_text_input_type_changed_callcount_(0), + on_caret_bounds_changed_callcount_(0), + cancel_composition_callcount_(0), + get_input_locale_callcount_(0), + get_input_text_direction_callcount_(0), + is_active_callcount_(0), + latest_text_input_type_(ui::TEXT_INPUT_TYPE_NONE) { SetDelegate(delegate); } @@ -51,6 +36,7 @@ void MockInputMethod::SetDelegate(internal::InputMethodDelegate* delegate) { void MockInputMethod::SetFocusedTextInputClient(TextInputClient* client) { text_input_client_ = client; + ++set_focused_text_input_client_callcount_; } TextInputClient* MockInputMethod::GetTextInputClient() const { @@ -58,58 +44,51 @@ TextInputClient* MockInputMethod::GetTextInputClient() const { } void MockInputMethod::DispatchKeyEvent(const base::NativeEvent& native_event) { -#if defined(OS_WIN) - if (native_event.message == WM_CHAR) { - if (text_input_client_) { - text_input_client_->InsertChar(ui::KeyboardCodeFromNative(native_event), - ui::EventFlagsFromNative(native_event)); - } - } else { - delegate_->DispatchKeyEventPostIME(native_event); - } -#elif defined(USE_X11) - DCHECK(native_event); - if (native_event->type == KeyRelease) { - // On key release, just dispatch it. - delegate_->DispatchKeyEventPostIME(native_event); - } else { - const uint32 state = EventFlagsFromXFlags(native_event->xkey.state); - // Send a RawKeyDown event first, - delegate_->DispatchKeyEventPostIME(native_event); - if (text_input_client_) { - // then send a Char event via ui::TextInputClient. - const KeyboardCode key_code = ui::KeyboardCodeFromNative(native_event); - uint16 ch = 0; - if (!(state & ui::EF_CONTROL_DOWN)) - ch = ui::GetCharacterFromXEvent(native_event); - if (!ch) - ch = ui::GetCharacterFromKeyCode(key_code, state); - if (ch) - text_input_client_->InsertChar(ch, state); - } - } -#else - // TODO(yusukes): Support other platforms. Call InsertChar() when necessary. - delegate_->DispatchKeyEventPostIME(native_event); -#endif -} - -void MockInputMethod::Init(bool focused) {} -void MockInputMethod::OnFocus() {} -void MockInputMethod::OnBlur() {} -void MockInputMethod::OnTextInputTypeChanged(const TextInputClient* client) {} -void MockInputMethod::OnCaretBoundsChanged(const TextInputClient* client) {} -void MockInputMethod::CancelComposition(const TextInputClient* client) {} + ++dispatch_keyevent_callcount_; +} + +void MockInputMethod::DispatchFabricatedKeyEvent(const ui::KeyEvent& event) { + ++dispatch_fabricated_keyevent_callcount_; +} + +void MockInputMethod::Init(bool focused) { + ++init_callcount_; +} + +void MockInputMethod::OnFocus() { + ++on_focus_callcount_; +} + +void MockInputMethod::OnBlur() { + ++on_blur_callcaount_; +} + +void MockInputMethod::OnTextInputTypeChanged(const TextInputClient* client) { + ++on_text_input_type_changed_callcount_; + latest_text_input_type_ = client->GetTextInputType(); +} + +void MockInputMethod::OnCaretBoundsChanged(const TextInputClient* client) { + ++on_caret_bounds_changed_callcount_; +} + +void MockInputMethod::CancelComposition(const TextInputClient* client) { + ++cancel_composition_callcount_; +} + std::string MockInputMethod::GetInputLocale() { + ++get_input_locale_callcount_; return ""; } base::i18n::TextDirection MockInputMethod::GetInputTextDirection() { + ++get_input_text_direction_callcount_; return base::i18n::UNKNOWN_DIRECTION; } bool MockInputMethod::IsActive() { + ++is_active_callcount_; return true; } diff --git a/ui/base/ime/mock_input_method.h b/ui/base/ime/mock_input_method.h index d9085b1..e34ffe0 100644 --- a/ui/base/ime/mock_input_method.h +++ b/ui/base/ime/mock_input_method.h @@ -31,8 +31,7 @@ class UI_EXPORT MockInputMethod : NON_EXPORTED_BASE(public InputMethod) { virtual void SetFocusedTextInputClient(TextInputClient* client) OVERRIDE; virtual TextInputClient* GetTextInputClient() const OVERRIDE; virtual void DispatchKeyEvent(const base::NativeEvent& native_event) OVERRIDE; - virtual void DispatchFabricatedKeyEvent(const ui::KeyEvent& event) OVERRIDE { - } + virtual void DispatchFabricatedKeyEvent(const ui::KeyEvent& event) OVERRIDE; virtual void OnTextInputTypeChanged(const TextInputClient* client) OVERRIDE; virtual void OnCaretBoundsChanged(const TextInputClient* client) OVERRIDE; virtual void CancelComposition(const TextInputClient* client) OVERRIDE; @@ -42,10 +41,78 @@ class UI_EXPORT MockInputMethod : NON_EXPORTED_BASE(public InputMethod) { virtual ui::TextInputType GetTextInputType() const OVERRIDE; virtual bool CanComposeInline() const OVERRIDE; + int init_callcount() const { + return init_callcount_; + } + + int on_focus_callcount() const { + return on_focus_callcount_; + } + + int on_blur_callcaount() const { + return on_blur_callcaount_; + } + + int set_focused_text_input_client_callcount() const { + return set_focused_text_input_client_callcount_; + } + + int dispatch_keyevent_callcount() const { + return dispatch_keyevent_callcount_; + } + + int dispatch_fabricated_keyevent_callcount() const { + return dispatch_fabricated_keyevent_callcount_; + } + + int on_text_input_type_changed_callcount() const { + return on_text_input_type_changed_callcount_; + } + + int on_caret_bounds_changed_callcount() const { + return on_caret_bounds_changed_callcount_; + } + + int cancel_composition_callcount() const { + return cancel_composition_callcount_; + } + + int get_input_locale_callcount() const { + return get_input_locale_callcount_; + } + + int get_input_text_direction_callcount() const { + return get_input_text_direction_callcount_; + } + + int is_active_callcount() const { + return is_active_callcount_; + } + + ui::TextInputType latest_text_input_type() const { + return latest_text_input_type_; + } + private: internal::InputMethodDelegate* delegate_; TextInputClient* text_input_client_; + int init_callcount_; + int on_focus_callcount_; + int on_blur_callcaount_; + int set_focused_text_input_client_callcount_; + int get_text_input_client_callcount_; + int dispatch_keyevent_callcount_; + int dispatch_fabricated_keyevent_callcount_; + int on_text_input_type_changed_callcount_; + int on_caret_bounds_changed_callcount_; + int cancel_composition_callcount_; + int get_input_locale_callcount_; + int get_input_text_direction_callcount_; + int is_active_callcount_; + + ui::TextInputType latest_text_input_type_; + DISALLOW_COPY_AND_ASSIGN(MockInputMethod); }; |