Commit 994f9e8c authored by rob's avatar rob Committed by Commit bot

event_sender: Keep keyIdentifier in keypress event

Blink's actual implementation preserves keyIdentifier='Enter'
when Enter is pressed. To make sure that the test framework
behaves like the actual implementation, this CL makes sure that
keyIdentifier is set to 'Enter' when the Enter key is simulated.

BUG=423270

Review URL: https://codereview.chromium.org/649343002

Cr-Commit-Position: refs/heads/master@{#302403}
parent f937e1da
......@@ -1361,7 +1361,11 @@ void EventSender::KeyDown(const std::string& code_str,
if (generate_char) {
WebKeyboardEvent event_char = event_up;
event_char.type = WebInputEvent::Char;
event_char.keyIdentifier[0] = '\0';
// keyIdentifier is an empty string, unless the Enter key was pressed.
// This behavior is not standard (keyIdentifier itself is not even a
// standard any more), but it matches the actual behavior in Blink.
if (code != ui::VKEY_RETURN)
event_char.keyIdentifier[0] = '\0';
view_->handleInputEvent(event_char);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment