Commit 14ea57a3 authored by Stephen Chenney's avatar Stephen Chenney Committed by Commit Bot

Wait on hit test data in TouchActionBrowserTest

The test was waiting on a compositor frame, but not hit test
data. This change converts it to use the HitTestRegionObserver
to directly detect hit test region availability.

Bug: 876323

Change-Id: I394b333da42acaa36cb957037ff60907dcc8a7bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1707168
Auto-Submit: Stephen Chenney <schenney@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#678430}
parent 2fc4e1ba
......@@ -31,6 +31,7 @@
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
#include "content/public/test/hit_test_region_observer.h"
#include "content/public/test/test_utils.h"
#include "content/shell/browser/shell.h"
#include "third_party/blink/public/platform/web_input_event.h"
......@@ -167,11 +168,12 @@ class TouchActionBrowserTest : public ContentBrowserTest,
TitleWatcher watcher(shell()->web_contents(), ready_title);
ignore_result(watcher.WaitAndGetTitle());
// We need to wait until at least one frame has been composited
// otherwise the injection of the synthetic gestures may get
// dropped because of MainThread/Impl thread sync of touch event
// regions.
frame_observer_->WaitForAnyFrameSubmission();
// We need to wait until hit test data is available. We use our own
// HitTestRegionObserver here, rather than
// WaitForHitTestDataOrChildSurfaceReady, because we have the
// RenderWidgetHostImpl available.
HitTestRegionObserver observer(host->GetFrameSinkId());
observer.WaitForHitTestData();
}
// ContentBrowserTest:
......
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