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

Unified Diff: chrome/browser/site_per_process_interactive_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
Index: chrome/browser/site_per_process_interactive_browsertest.cc
diff --git a/chrome/browser/site_per_process_interactive_browsertest.cc b/chrome/browser/site_per_process_interactive_browsertest.cc
index dd2c5230e747423e021a76d708936aace1fa732c..590ef78e297781f362b1805d3e88878c118df792 100644
--- a/chrome/browser/site_per_process_interactive_browsertest.cc
+++ b/chrome/browser/site_per_process_interactive_browsertest.cc
@@ -150,9 +150,12 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessInteractiveBrowserTest,
EXPECT_EQ(child, web_contents->GetFocusedFrame());
// Generate a few keyboard events and route them to currently focused frame.
- SimulateKeyPress(web_contents, ui::VKEY_F, false, false, false, false);
- SimulateKeyPress(web_contents, ui::VKEY_O, false, false, false, false);
- SimulateKeyPress(web_contents, ui::VKEY_O, false, false, false, false);
+ SimulateKeyPress(web_contents, ui::DomKey::FromCharacter('f'),
+ ui::DomCode::US_F, ui::VKEY_F, false, false, false, false);
+ SimulateKeyPress(web_contents, ui::DomKey::FromCharacter('O'),
+ ui::DomCode::US_O, ui::VKEY_O, false, false, false, false);
+ SimulateKeyPress(web_contents, ui::DomKey::FromCharacter('O'),
+ ui::DomCode::US_O, ui::VKEY_O, false, false, false, false);
// Verify that the input field in the subframe received the keystrokes.
EXPECT_TRUE(ExecuteScriptAndExtractString(
@@ -220,8 +223,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessInteractiveBrowserTest,
auto press_tab_and_wait_for_message = [web_contents](bool reverse) {
content::DOMMessageQueue msg_queue;
std::string reply;
- SimulateKeyPress(web_contents, ui::VKEY_TAB, false, reverse /* shift */,
- false, false);
+ SimulateKeyPress(web_contents, ui::DomKey::TAB, ui::DomCode::TAB,
+ ui::VKEY_TAB, false, reverse /* shift */, false, false);
EXPECT_TRUE(msg_queue.WaitForMessage(&reply));
return reply;
};

Powered by Google App Engine
This is Rietveld 408576698