Commit 48e72962 authored by Adithya Srinivasan's avatar Adithya Srinivasan Committed by Commit Bot

Portals: Deflake TouchInputTransferAcrossReactivation

The sequence of events causing the flake is as follows:

1) when flushing the touch event queue, we ack a touch event and
   generate a scroll update gesture event.
2) Before dispatching the GSU, we prepend a touch event
   (kTouchScrollStarted) which is non-blocking and gets acked
   immediately, causing us to run AckCompletedEvents.
3) AckCompletedEvents acks the remaining touch events in the queue, and
   in this test, acks a touch cancel event which generates and
   dispatches a scroll end gesture event.
4) The initial scroll update event is actually dispatched after the
   scroll end event (which is an invalid ordering).

To fix this, we prevent AckCompletedEvents from being called while
we're flushing the queue to prevent it from affecting gesture event
ordering.

Bug: 1010675
Change-Id: I00d102ccde0b4bd458d86737a660f5fb777a3c6e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1849430Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarKevin McNee <mcnee@chromium.org>
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705156}
parent cb2b11bd
......@@ -1190,11 +1190,10 @@ IN_PROC_BROWSER_TEST_F(PortalBrowserTest, TouchInputTransferAcrossActivation) {
}
#endif
// TODO(crbug.com/1010675): Test fails flakily.
// Touch input transfer is only implemented in the content layer for Aura.
#if defined(USE_AURA)
IN_PROC_BROWSER_TEST_F(PortalBrowserTest,
DISABLED_TouchInputTransferAcrossReactivation) {
TouchInputTransferAcrossReactivation) {
EXPECT_TRUE(NavigateToURL(
shell(), embedded_test_server()->GetURL(
"portal.test",
......
......@@ -207,6 +207,9 @@ bool PassthroughTouchEventQueue::Empty() const {
}
void PassthroughTouchEventQueue::FlushQueue() {
// Don't allow acks to be processed in AckCompletedEvents as that can
// interfere with gesture event dispatch ordering.
base::AutoReset<bool> process_acks(&processing_acks_, true);
drop_remaining_touches_in_sequence_ = true;
client_->FlushDeferredGestureQueue();
while (!outstanding_touches_.empty()) {
......
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