Fix some ChromeTabModalPresenterTest flaky tests
When test scenario involves tab switching, the toolbar is animated into view. ChromeTabModalPresenter has a logic that prevents it from running enter animation when toolbar animation is not finished (browser controls are not fully visible). Because of this logic modal dialog view is not added to container view immediately in ModalDialogManager.showDialog call. On the other hand Espresso's onView(...).check() call verifies condition immediately and asserts if the condition is not met (descendant with a particular text is not present in container view). This causes occasional test failures. Semantically test should verify that a dialog with particular text is shown at some point. Container view visibility it closest approximation to a condition that modal dialog view is added to the container. In this CL I add helper that polls UI thread waiting for dialog container to become visible. BUG=1030683,1030903,1031092 R=twellington@chromium.org Change-Id: Id1a42aefa45ee50d26171ecbff662c44226ad056 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2134401Reviewed-by:Theresa <twellington@chromium.org> Commit-Queue: Pavel Yatsuk <pavely@chromium.org> Cr-Commit-Position: refs/heads/master@{#756468}
Showing
Please register or sign in to comment