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

Unified Diff: chrome/test/chromedriver/chrome/web_view_impl.cc

Issue 2302803004: [chromedriver] Set |key| when calling Input.dispatchKeyEvent. (Closed)
Patch Set: dont set key if keycode conversion doesnt return anything (this happens for char events, for exampl… Created 4 years, 3 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 | « no previous file | chrome/test/chromedriver/client/chromedriver.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/chrome/web_view_impl.cc
diff --git a/chrome/test/chromedriver/chrome/web_view_impl.cc b/chrome/test/chromedriver/chrome/web_view_impl.cc
index 8dc01b002e2b19ee7a5ef7d1c0525e58e5675e16..aa7fe1ea71c3c81acd388b57a2dfb41ea4f1ea7d 100644
--- a/chrome/test/chromedriver/chrome/web_view_impl.cc
+++ b/chrome/test/chromedriver/chrome/web_view_impl.cc
@@ -33,6 +33,8 @@
#include "chrome/test/chromedriver/chrome/status.h"
#include "chrome/test/chromedriver/chrome/ui_events.h"
#include "chrome/test/chromedriver/net/timeout.h"
+#include "ui/events/keycodes/dom/keycode_converter.h"
+#include "ui/events/keycodes/keyboard_code_conversion.h"
namespace {
@@ -399,6 +401,10 @@ Status WebViewImpl::DispatchKeyEvents(const std::list<KeyEvent>& events) {
params.SetString("unmodifiedText", it->unmodified_text);
params.SetInteger("nativeVirtualKeyCode", it->key_code);
params.SetInteger("windowsVirtualKeyCode", it->key_code);
+ ui::DomCode dom_code = ui::UsLayoutKeyboardCodeToDomCode(it->key_code);
+ std::string key = ui::KeycodeConverter::DomCodeToCodeString(dom_code);
+ if (!key.empty())
+ params.SetString("key", key);
Status status = client_->SendCommand("Input.dispatchKeyEvent", params);
if (status.IsError())
return status;
« no previous file with comments | « no previous file | chrome/test/chromedriver/client/chromedriver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698