Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(995)

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/infobar/InfoBarTest.java

Issue 2621983003: Fix flaky Android Search Geolocation Disclosure tests. (Closed)
Patch Set: Make function common Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/javatests/src/org/chromium/chrome/browser/infobar/InfoBarTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/infobar/InfoBarTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/infobar/InfoBarTest.java
index 7e5ea3d42c1ee75fe4ba46add2cc25152e347105..2fd48a11ac1f5d82eaa4b0148dea123981fd7f69 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/infobar/InfoBarTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/infobar/InfoBarTest.java
@@ -57,15 +57,6 @@ public class InfoBarTest extends ChromeActivityTestCaseBase<ChromeActivity> {
private EmbeddedTestServer mTestServer;
private InfoBarTestAnimationListener mListener;
- private void waitUntilNoInfoBarsExist() {
- CriteriaHelper.pollUiThread(new Criteria() {
- @Override
- public boolean isSatisfied() {
- return getInfoBars().isEmpty();
- }
- });
- }
-
private void waitUntilDataReductionPromoInfoBarAppears() {
CriteriaHelper.pollUiThread(new Criteria() {
@Override
@@ -186,14 +177,7 @@ public class InfoBarTest extends ChromeActivityTestCaseBase<ChromeActivity> {
getActivity().getActivityTab().goBack();
}
});
- CriteriaHelper.pollInstrumentationThread(
benwells 2017/01/13 05:01:26 Note this is a different thread, and the test fail
- new Criteria() {
- @Override
- public boolean isSatisfied() {
- return getInfoBars().isEmpty();
- }
- },
- MAX_TIMEOUT, CHECK_INTERVAL);
+ InfoBarUtil.waitUntilNoInfoBarsExist(getInfoBars());
mListener.removeInfoBarAnimationFinished("InfoBar not removed.");
}
@@ -239,7 +223,7 @@ public class InfoBarTest extends ChromeActivityTestCaseBase<ChromeActivity> {
});
// The renderer should have been killed and the infobar removed.
- waitUntilNoInfoBarsExist();
+ InfoBarUtil.waitUntilNoInfoBarsExist(getInfoBars());
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
@@ -300,7 +284,7 @@ public class InfoBarTest extends ChromeActivityTestCaseBase<ChromeActivity> {
});
// The renderer should have been killed and the infobar removed.
- waitUntilNoInfoBarsExist();
+ InfoBarUtil.waitUntilNoInfoBarsExist(getInfoBars());
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override

Powered by Google App Engine
This is Rietveld 408576698