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

Unified Diff: chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc

Issue 2645203002: Fix synchronization in SitePerProcessTextInputManagerTest.SubframeKeyboardEditCommands. (Closed)
Patch Set: Created 3 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc
diff --git a/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc b/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc
index bf14dac20475f4f7df68553de9e5cce34ea7091f..d666f55523490c149a0491eebb8b0fc2475f2c3f 100644
--- a/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc
+++ b/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc
@@ -1115,16 +1115,28 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest,
content::RenderFrameHost* child =
ChildFrameAt(web_contents->GetMainFrame(), 0);
std::string result;
+ std::string script =
+ "function onInput(e) {"
+ " domAutomationController.setAutomationId(0);"
+ " domAutomationController.send(getInputFieldText());"
+ "}"
+ "inputField = document.getElementById('text-field');"
+ "inputField.addEventListener('input', onInput, false);";
+ EXPECT_TRUE(ExecuteScript(child, script));
EXPECT_TRUE(ExecuteScriptAndExtractString(
child, "window.focus(); focusInputField();", &result));
EXPECT_EQ("input-focus", result);
EXPECT_EQ(child, web_contents->GetFocusedFrame());
// Generate a couple of keystrokes, which will be routed to the subframe.
+ content::DOMMessageQueue msg_queue;
+ std::string reply;
SimulateKeyPress(web_contents, ui::DomKey::FromCharacter('1'),
ui::DomCode::DIGIT1, ui::VKEY_1, false, false, false, false);
+ EXPECT_TRUE(msg_queue.WaitForMessage(&reply));
SimulateKeyPress(web_contents, ui::DomKey::FromCharacter('2'),
ui::DomCode::DIGIT2, ui::VKEY_2, false, false, false, false);
+ EXPECT_TRUE(msg_queue.WaitForMessage(&reply));
// Verify that the input field in the subframe received the keystrokes.
EXPECT_TRUE(ExecuteScriptAndExtractString(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698