Skip to content

Commit

Permalink
Fix VR in-session permission request test flakiness
Browse files Browse the repository at this point in the history
Fixes flakiness in WebXrVrInputTest#testInSessionPermissionRequests*,
which was particularly prevalent on Vega. The cause of this was
not waiting for the UI to be quiescent before attempting to input the
first click, which sometimes resulted in the click not being registered
due to the element still transitioning in.

TBR=billorr@chromium.org

Bug: 876946
Change-Id: Ifa9aa73f85af0fd628c7ba0411ea8cd13bf6859d
Reviewed-on: https://chromium-review.googlesource.com/c/1399448
Reviewed-by: Brian Sheedy <bsheedy@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#620522}
  • Loading branch information
bsheedy authored and Commit Bot committed Jan 7, 2019
1 parent a1636e3 commit da0a2cb
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -838,11 +838,13 @@ private void testInSessionPermissionRequestsImpl() throws InterruptedException {
"generic_webxr_permission_page")),
PAGE_LOAD_TIMEOUT_S);
mWebXrVrTestFramework.enterSessionWithUserGestureOrFail(mTestRule.getWebContents());
NativeUiUtils.enableMockedInput();
NativeUiUtils.performActionAndWaitForVisibilityStatus(
UserFriendlyElementName.WEB_XR_HOSTED_CONTENT, true /* visible */, () -> {
WebXrVrTestFramework.runJavaScriptOrFail("requestPermission({audio:true})",
POLL_TIMEOUT_SHORT_MS, mTestRule.getWebContents());
});
NativeUiUtils.waitForUiQuiescence();
// Click outside the prompt and ensure that it gets dismissed.
NativeUiUtils.clickElement(
UserFriendlyElementName.WEB_XR_HOSTED_CONTENT, new PointF(0.55f, 0.0f));
Expand Down

0 comments on commit da0a2cb

Please sign in to comment.