Commit 4a7a6504 authored by Dave Tapuska's avatar Dave Tapuska Committed by Commit Bot

Fix flaky SyntheticMouseEventTest.MouseEventAck

Devtools was not correctly handling input that is not generated by itself
and invoking callbacks when the input wasn't actually processed.

Add a modifier indicating content was injected using the debugger so that
we can then query for that to determine if we should release the event.
This is a stop gap solution until we can actually bind callbacks into the
sending of events and devtools wouldn't need its own queues of callbacks.

BUG=789869

Change-Id: I2b56e8ebf4921b48bd4d35dee2226d7cb780cb94
Reviewed-on: https://chromium-review.googlesource.com/804357
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarPavel Feldman <pfeldman@chromium.org>
Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521454}
parent a7ebbe69
...@@ -582,7 +582,7 @@ IN_PROC_BROWSER_TEST_F(SyntheticKeyEventTest, KeyboardEventAck) { ...@@ -582,7 +582,7 @@ IN_PROC_BROWSER_TEST_F(SyntheticKeyEventTest, KeyboardEventAck) {
EXPECT_EQ(3u, result_ids_.size()); EXPECT_EQ(3u, result_ids_.size());
} }
IN_PROC_BROWSER_TEST_F(SyntheticMouseEventTest, DISABLED_MouseEventAck) { IN_PROC_BROWSER_TEST_F(SyntheticMouseEventTest, MouseEventAck) {
NavigateToURLBlockUntilNavigationsComplete(shell(), GURL("about:blank"), 1); NavigateToURLBlockUntilNavigationsComplete(shell(), GURL("about:blank"), 1);
Attach(); Attach();
ASSERT_TRUE(content::ExecuteScript( ASSERT_TRUE(content::ExecuteScript(
......
...@@ -66,7 +66,7 @@ int GetEventModifiers(int modifiers, ...@@ -66,7 +66,7 @@ int GetEventModifiers(int modifiers,
bool auto_repeat, bool auto_repeat,
bool is_keypad, bool is_keypad,
int location) { int location) {
int result = 0; int result = blink::WebInputEvent::kFromDebugger;
if (auto_repeat) if (auto_repeat)
result |= blink::WebInputEvent::kIsAutoRepeat; result |= blink::WebInputEvent::kIsAutoRepeat;
if (is_keypad) if (is_keypad)
...@@ -293,6 +293,9 @@ void InputHandler::OnInputEvent(const blink::WebInputEvent& event) { ...@@ -293,6 +293,9 @@ void InputHandler::OnInputEvent(const blink::WebInputEvent& event) {
void InputHandler::OnInputEventAck(InputEventAckSource source, void InputHandler::OnInputEventAck(InputEventAckSource source,
InputEventAckState state, InputEventAckState state,
const blink::WebInputEvent& event) { const blink::WebInputEvent& event) {
if ((event.GetModifiers() & blink::WebInputEvent::kFromDebugger) == 0)
return;
if (blink::WebInputEvent::IsKeyboardEventType(event.GetType()) && if (blink::WebInputEvent::IsKeyboardEventType(event.GetType()) &&
!pending_key_callbacks_.empty()) { !pending_key_callbacks_.empty()) {
pending_key_callbacks_.front()->sendSuccess(); pending_key_callbacks_.front()->sendSuccess();
......
...@@ -246,6 +246,11 @@ class WebInputEvent { ...@@ -246,6 +246,11 @@ class WebInputEvent {
// not actual physical movement of the pointer // not actual physical movement of the pointer
kRelativeMotionEvent = 1 << 22, kRelativeMotionEvent = 1 << 22,
// Indication this event was injected by the devtools.
// TODO(dtapuska): Remove this flag once we are able to bind callbacks
// in event sending.
kFromDebugger = 1 << 23,
// The set of non-stateful modifiers that specifically change the // The set of non-stateful modifiers that specifically change the
// interpretation of the key being pressed. For example; IsLeft, // interpretation of the key being pressed. For example; IsLeft,
// IsRight, IsComposing don't change the meaning of the key // IsRight, IsComposing don't change the meaning of the key
......
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