Commit 78c0580e authored by Ted Choc's avatar Ted Choc Committed by Commit Bot

Attempt to deflake UrlBarIntegrationTest.testAutocompleteUpdatedOnDefocus

From the failed screenshots, it appears the omnibox is not fully visible
before attempting to focus the URL bar.  This waits to ensure the
URL bar is shown before attempting focus.

BUG=1030246

Change-Id: I9f2c4659eca6b70d4d66b73f4abc40a6e2474d85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1949562Reviewed-by: default avatarEnder <ender@google.com>
Commit-Queue: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721590}
parent efe278fa
......@@ -267,10 +267,15 @@ public class OmniboxTestUtils {
if (gainFocus) {
// During early startup (before completion of its first onDraw), the UrlBar
// is not focusable. Tests have to wait for that to happen before trying to focus it.
CriteriaHelper.pollUiThread(new Criteria("UrlBar was not focusable") {
CriteriaHelper.pollUiThread(new Criteria() {
@Override
public boolean isSatisfied() {
return urlBar.isFocusable();
boolean shown = urlBar.isShown();
boolean focusable = urlBar.isFocusable();
updateFailureReason(String.format(Locale.US,
"UrlBar is invalid state - shown: %b, focusable: %b", shown,
focusable));
return shown && focusable;
}
});
......
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