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( |