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

Unified Diff: webkit/tools/test_shell/keyboard_unittest.cc

Issue 27332: Fixing WebKeyboardEvent. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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
« no previous file with comments | « webkit/tools/test_shell/event_sending_controller.cc ('k') | webkit/tools/test_shell/mac/webwidget_host.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/keyboard_unittest.cc
===================================================================
--- webkit/tools/test_shell/keyboard_unittest.cc (revision 10793)
+++ webkit/tools/test_shell/keyboard_unittest.cc (working copy)
@@ -14,9 +14,11 @@
#undef LOG
+#include "base/string_util.h"
#include "webkit/glue/editor_client_impl.h"
#include "webkit/glue/event_conversion.h"
#include "webkit/glue/webinputevent.h"
+#include "webkit/glue/webinputevent_util.h"
#include "testing/gtest/include/gtest/gtest.h"
using WebCore::PlatformKeyboardEvent;
@@ -46,15 +48,14 @@
void SetupKeyDownEvent(WebKeyboardEvent* keyboard_event,
char key_code,
int modifiers) {
- keyboard_event->key_code = key_code;
+ keyboard_event->windows_key_code = key_code;
keyboard_event->modifiers = modifiers;
keyboard_event->type = WebInputEvent::KEY_DOWN;
-#if defined(OS_LINUX)
- keyboard_event->text = key_code;
-#elif defined(OS_MACOSX)
- keyboard_event->text.clear();
- keyboard_event->text.push_back(key_code);
-#endif
+ keyboard_event->text[0] = key_code;
+ std::string key_identifier_str =
+ webkit_glue::GetKeyIdentifierForWindowsKeyCode(key_code);
+ base::strlcpy(keyboard_event->key_identifier, key_identifier_str.c_str(),
+ kIdentifierLengthCap);
}
// Like InterpretKeyEvent, but with pressing down OSModifier+|key_code|.
« no previous file with comments | « webkit/tools/test_shell/event_sending_controller.cc ('k') | webkit/tools/test_shell/mac/webwidget_host.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698