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 /ui/base/ime/input_method_factory.cc | |
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
Diffstat (limited to 'ui/base/ime/input_method_factory.cc')
-rw-r--r-- | ui/base/ime/input_method_factory.cc | 15 |
1 files changed, 13 insertions, 2 deletions
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 |