Chromium Code Reviews

Unified Diff: ui/views/controls/textfield/textfield_unittest.cc

Issue 1236923003: Makes DesktopWindowTreeHostXxx to dispatch key event to InputMethod. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add TODO. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « ui/events/event_source.h ('k') | ui/views/widget/desktop_aura/desktop_window_tree_host_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield_unittest.cc
diff --git a/ui/views/controls/textfield/textfield_unittest.cc b/ui/views/controls/textfield/textfield_unittest.cc
index 371ac1d0b9057497c9eb59159577d44489646c2e..d9b2db554e0c310daa03b3d5c05f997f66244847 100644
--- a/ui/views/controls/textfield/textfield_unittest.cc
+++ b/ui/views/controls/textfield/textfield_unittest.cc
@@ -27,7 +27,6 @@
#include "ui/events/event_processor.h"
#include "ui/events/event_utils.h"
#include "ui/events/keycodes/keyboard_codes.h"
-#include "ui/events/test/event_generator.h"
#include "ui/gfx/render_text.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/controls/textfield/textfield_controller.h"
@@ -433,9 +432,6 @@ class TextfieldTest : public ViewsTestBase, public TextfieldController {
#if defined(OS_MACOSX) && !defined(USE_AURA)
fake_activation_ = test::WidgetTest::FakeWidgetIsActiveAlways();
#endif
-
- event_generator_.reset(
- new ui::test::EventGenerator(GetContext(), widget_->GetNativeWindow()));
}
ui::MenuModel* GetContextMenuModel() {
@@ -471,7 +467,10 @@ class TextfieldTest : public ViewsTestBase, public TextfieldController {
(command ? ui::EF_COMMAND_DOWN : 0) |
(caps_lock ? ui::EF_CAPS_LOCK_DOWN : 0);
- event_generator_->PressKey(key_code, flags);
+ // TODO(shuchen): making EventGenerator support input method and using
+ // EventGenerator here. crbug.com/512315.
+ ui::KeyEvent event(ui::ET_KEY_PRESSED, key_code, flags);
+ input_method_->DispatchKeyEvent(event);
}
void SendKeyEvent(ui::KeyboardCode key_code,
@@ -642,7 +641,6 @@ class TextfieldTest : public ViewsTestBase, public TextfieldController {
private:
ui::ClipboardType copied_to_clipboard_;
scoped_ptr<test::WidgetTest::FakeActivation> fake_activation_;
- scoped_ptr<ui::test::EventGenerator> event_generator_;
DISALLOW_COPY_AND_ASSIGN(TextfieldTest);
};
« no previous file with comments | « ui/events/event_source.h ('k') | ui/views/widget/desktop_aura/desktop_window_tree_host_win.h » ('j') | no next file with comments »

Powered by Google App Engine