Commit bf0fe2c9 authored by bsheedy's avatar bsheedy Committed by Commit Bot

Fix select tag test race condition on Vega

Fixes a race condition in VrBrowserWebInputEditingTest#testSelectTag
on Vega (and probably other fast devices) where the click meant for the
modal dialog could happen so fast that it registered on the web contents
instead of the dialog, causing the dialog to be dismissed.

Bug: 876946
Change-Id: I043e19d49ce02e76de4b2447619f365e8dc90244
Reviewed-on: https://chromium-review.googlesource.com/c/1456940Reviewed-by: default avatarBill Orr <billorr@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630022}
parent f5a9e0d7
...@@ -146,6 +146,11 @@ public class VrBrowserWebInputEditingTest { ...@@ -146,6 +146,11 @@ public class VrBrowserWebInputEditingTest {
DOMUtils.clickNode(mVrBrowserTestFramework.getFirstTabWebContents(), "selectbox", DOMUtils.clickNode(mVrBrowserTestFramework.getFirstTabWebContents(), "selectbox",
false /* goThroughRootAndroidView */); false /* goThroughRootAndroidView */);
NativeUiUtils.waitForModalDialogStatus(true /* shouldBeShown */, mVrTestRule.getActivity()); NativeUiUtils.waitForModalDialogStatus(true /* shouldBeShown */, mVrTestRule.getActivity());
// On fast devices such as the Vega, it's possible to send the first click before the modal
// dialog starts accepting any input, causing the click to be registered on the web contents
// and causing the dialog to be dismissed. So, ensure that the dialog is at least done
// rendering before trying to send input.
NativeUiUtils.waitForUiQuiescence();
// Click on whichever option is near the center of the screen. We don't care which, as long // Click on whichever option is near the center of the screen. We don't care which, as long
// as it's not the initial selection, which should be at the top. Clicking in the exact // as it's not the initial selection, which should be at the top. Clicking in the exact
// center can sometimes click in the area between two options, so offset slightly to prevent // center can sometimes click in the area between two options, so offset slightly to prevent
......
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