Chromium Code Reviews| 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 |