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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBarTest.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/SearchGeolocationDisclosureInfoBarTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBarTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBarTest.java
index a8d2502971b8e11f6a7ed59536b6022247835f10..e8502dd81c96123f63c4fae59aeba615576aae5a 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBarTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBarTest.java
@@ -8,7 +8,6 @@ import android.support.test.filters.SmallTest;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Feature;
-import org.chromium.base.test.util.FlakyTest;
import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.SearchGeolocationDisclosureTabHelper;
import org.chromium.chrome.test.ChromeActivityTestCaseBase;
@@ -50,7 +49,6 @@ public class SearchGeolocationDisclosureInfoBarTest
super.tearDown();
}
- @FlakyTest(message = "https://crbug.com/678210")
@SmallTest
@Feature({"Browser", "Main"})
@CommandLineFlags.Add(ENABLE_NEW_DISCLOSURE_FEATURE)
@@ -74,6 +72,9 @@ public class SearchGeolocationDisclosureInfoBarTest
// Infobar should not appear again on the same day.
loadUrl(mTestServer.getURL(SEARCH_PAGE));
+ // There can be a delay from infobars being removed in the native InfobarManager and them
+ // being removed in the Java container, so wait until the infobar has really gone.
+ InfoBarUtil.waitUntilNoInfoBarsExist(getInfoBars());
assertEquals("Wrong infobar count after search", 0, getInfoBars().size());
// Infobar should appear again the next day.
@@ -86,6 +87,7 @@ public class SearchGeolocationDisclosureInfoBarTest
// Infobar should not appear again on the same day.
loadUrl(mTestServer.getURL(SEARCH_PAGE));
+ InfoBarUtil.waitUntilNoInfoBarsExist(getInfoBars());
assertEquals("Wrong infobar count after search", 0, getInfoBars().size());
// Infobar should appear again the next day.
@@ -98,6 +100,7 @@ public class SearchGeolocationDisclosureInfoBarTest
// Infobar should not appear again on the same day.
loadUrl(mTestServer.getURL(SEARCH_PAGE));
+ InfoBarUtil.waitUntilNoInfoBarsExist(getInfoBars());
assertEquals("Wrong infobar count after search", 0, getInfoBars().size());
// Infobar has appeared three times now, it should not appear again.
@@ -126,6 +129,7 @@ public class SearchGeolocationDisclosureInfoBarTest
// Infobar should not appear again on the same day.
loadUrl(mTestServer.getURL(SEARCH_PAGE));
+ InfoBarUtil.waitUntilNoInfoBarsExist(getInfoBars());
assertEquals("Wrong infobar count after search", 0, getInfoBars().size());
// Infobar should not appear the next day either, as it has been dismissed.

Powered by Google App Engine
This is Rietveld 408576698