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

Unified Diff: chrome/test/remoting/remote_desktop_browsertest.cc

Issue 2048533002: Add code and key into the browser test key simulation methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix chromeos build Created 4 years, 6 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 | « chrome/test/remoting/remote_desktop_browsertest.h ('k') | content/public/test/browser_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/remoting/remote_desktop_browsertest.cc
diff --git a/chrome/test/remoting/remote_desktop_browsertest.cc b/chrome/test/remoting/remote_desktop_browsertest.cc
index 203dcc6971c3d783adf249f2c7f369ae17b5dd1d..c2bda60c989a752243f229a3aebb5340a06c88e6 100644
--- a/chrome/test/remoting/remote_desktop_browsertest.cc
+++ b/chrome/test/remoting/remote_desktop_browsertest.cc
@@ -30,6 +30,7 @@
#include "extensions/common/extension_set.h"
#include "extensions/common/switches.h"
#include "ui/base/window_open_disposition.h"
+#include "ui/events/keycodes/dom/keycode_converter.h"
namespace remoting {
@@ -405,34 +406,34 @@ void RemoteDesktopBrowserTest::DisconnectMe2Me() {
void RemoteDesktopBrowserTest::SimulateKeyPressWithCode(
ui::KeyboardCode keyCode,
- const std::string& code) {
- SimulateKeyPressWithCode(keyCode, code, false, false, false, false);
+ const std::string& codeStr) {
+ ui::DomCode code = ui::KeycodeConverter::CodeStringToDomCode(codeStr);
+ SimulateKeyPressWithCode(ui::DomKey(), code, keyCode, false, false, false,
+ false);
}
void RemoteDesktopBrowserTest::SimulateKeyPressWithCode(
+ ui::DomKey key,
+ ui::DomCode code,
ui::KeyboardCode keyCode,
- const std::string& code,
bool control,
bool shift,
bool alt,
bool command) {
- content::SimulateKeyPressWithCode(
- active_web_contents(),
- keyCode,
- code,
- control,
- shift,
- alt,
- command);
+ content::SimulateKeyPress(active_web_contents(), key, code, keyCode, control,
+ shift, alt, command);
}
void RemoteDesktopBrowserTest::SimulateCharInput(char c) {
- const char* code;
+ const char* codeStr;
ui::KeyboardCode keyboard_code;
bool shift;
- GetKeyValuesFromChar(c, &code, &keyboard_code, &shift);
- ASSERT_TRUE(code != NULL);
- SimulateKeyPressWithCode(keyboard_code, code, false, shift, false, false);
+ GetKeyValuesFromChar(c, &codeStr, &keyboard_code, &shift);
+ ui::DomKey key = ui::DomKey::FromCharacter(c);
+ ASSERT_TRUE(codeStr != NULL);
+ ui::DomCode code = ui::KeycodeConverter::CodeStringToDomCode(codeStr);
+ SimulateKeyPressWithCode(key, code, keyboard_code, false, shift, false,
+ false);
}
void RemoteDesktopBrowserTest::SimulateStringInput(const std::string& input) {
« no previous file with comments | « chrome/test/remoting/remote_desktop_browsertest.h ('k') | content/public/test/browser_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698