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

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: Created 5 years, 5 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: 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 2df3dd2800f2e6a10b647b5a1fa7636a6d40f830..8a81815df4b973cbcc8379ad271fc4e3971a2104 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"
@@ -438,9 +437,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() {
@@ -476,7 +472,8 @@ 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);
+ ui::KeyEvent event(ui::ET_KEY_PRESSED, key_code, flags);
+ input_method_->DispatchKeyEvent(event);
sadrul 2015/07/19 01:07:30 Hm. It may not be obvious for someone unfamiliar w
Shu Chen 2015/07/20 05:46:09 I've reverted the change here and made EventGenera
Shu Chen 2015/07/21 03:05:52 Sadrul, I changed this back in the latest patchset
}
void SendKeyEvent(ui::KeyboardCode key_code,
@@ -647,7 +644,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);
};

Powered by Google App Engine
This is Rietveld 408576698