Commit 351da3a5 authored by Brian Sheedy's avatar Brian Sheedy Committed by Commit Bot

Fix VR browser suggestion tests

Changes the VR browser tests that click on suggestions to ensure
navigation works to click on the bottom suggestion instead of the
middle one. This is because either the top or middle suggestion can be
the "search on the web" suggestion depending on if the
OmniboxGroupSuggestionsBySearchVsUrl feature is enabled or not.

Bug: 995943
Change-Id: Ic1ee49f8ef95a6b13c65117065bc08c882bbb615
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764756
Auto-Submit: Brian Sheedy <bsheedy@chromium.org>
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: default avatarAlexander Cooper <alcooper@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689509}
parent 40be6fa4
......@@ -804,9 +804,11 @@ public class VrBrowserNavigationTest {
NativeUiUtils.performActionAndWaitForVisibilityStatus(
UserFriendlyElementName.SUGGESTION_BOX, true /* visible */,
() -> { NativeUiUtils.inputString("chrome://"); });
// Blindly clicking in the center of the suggestion box should end up clicking the middle
// suggestion, which for "chrome://" should be a valid chrome:// URL.
NativeUiUtils.clickElement(UserFriendlyElementName.SUGGESTION_BOX, new PointF());
// Click near the bottom of the suggestion box to get the last suggestion, which for
// "chrome://" should be a valid chrome:// URL. The suggestion that triggers a search can
// be in either the middle or top spot depending on whether the
// OmniboxGroupSuggestionsBySearchVsUrl feature is enabled or not.
NativeUiUtils.clickElement(UserFriendlyElementName.SUGGESTION_BOX, new PointF(0.0f, -0.4f));
ChromeTabUtils.waitForTabPageLoaded(
mTestRule.getActivity().getActivityTab(), (String) null);
// We can't just wait for navigation to finish and then check because waitForTabPageLoaded
......
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