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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java

Issue 2331533002: Mark flaky chrome_public tests with @RetryOnFailure Batch 2 (Closed)
Patch Set: Created 4 years, 3 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/customtabs/CustomTabActivityTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
index 43680796f087516b5c48c1bb603803b44097d2c8..6f8fa1d257c50f88d4f81bdcc6e6b6588a5c6401 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
@@ -46,6 +46,7 @@ import org.chromium.base.library_loader.LibraryLoader;
import org.chromium.base.library_loader.LibraryProcessType;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Restriction;
+import org.chromium.base.test.util.RetryOnFailure;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.ChromeFeatureList;
@@ -246,6 +247,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
* Test the entries in the context menu shown when long clicking an image.
*/
@SmallTest
+ @RetryOnFailure
public void testContextMenuEntriesForImage() throws InterruptedException, TimeoutException {
startCustomTabActivityWithIntent(createMinimalCustomTabIntent());
@@ -278,6 +280,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
* Test the entries in the context menu shown when long clicking an link.
*/
@SmallTest
+ @RetryOnFailure
public void testContextMenuEntriesForLink() throws InterruptedException, TimeoutException {
startCustomTabActivityWithIntent(createMinimalCustomTabIntent());
@@ -311,6 +314,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
* Test the entries in the app menu.
*/
@SmallTest
+ @RetryOnFailure
public void testAppMenu() throws InterruptedException {
Intent intent = createMinimalCustomTabIntent();
int numMenuEntries = 1;
@@ -339,6 +343,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
* Tests if the default share item can be shown in the app menu.
*/
@SmallTest
+ @RetryOnFailure
public void testShareMenuItem() throws InterruptedException {
Intent intent = createMinimalCustomTabIntent();
intent.putExtra(CustomTabsIntent.EXTRA_DEFAULT_SHARE_MENU_ITEM, true);
@@ -355,6 +360,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
* Test that only up to 5 entries are added to the custom menu.
*/
@SmallTest
+ @RetryOnFailure
public void testMaxMenuItems() throws InterruptedException {
Intent intent = createMinimalCustomTabIntent();
int numMenuEntries = 7;
@@ -375,6 +381,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
* {@link PendingIntent}.
*/
@SmallTest
+ @RetryOnFailure
public void testCustomMenuEntry() throws InterruptedException {
Intent intent = createMinimalCustomTabIntent();
final PendingIntent pi = addMenuEntriesToIntent(intent, 1);
@@ -406,6 +413,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
* Test whether clicking "Open in Chrome" takes us to a chrome normal tab, loading the same url.
*/
@SmallTest
+ @RetryOnFailure
public void testOpenInBrowser() throws InterruptedException {
startCustomTabActivityWithIntent(createMinimalCustomTabIntent());
openAppMenuAndAssertMenuShown();
@@ -439,6 +447,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
* Test whether a custom tab can be reparented to a new activity.
*/
@SmallTest
+ @RetryOnFailure
public void testTabReparentingBasic() throws InterruptedException {
startCustomTabActivityWithIntent(createMinimalCustomTabIntent());
reparentAndVerifyTab();
@@ -448,6 +457,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
* Test whether a custom tab can be reparented to a new activity while showing an infobar.
*/
@SmallTest
+ @RetryOnFailure
public void testTabReparentingInfoBar() throws InterruptedException {
LocationSettingsTestUtil.setSystemLocationSettingEnabled(true);
startCustomTabActivityWithIntent(CustomTabsTestUtils.createMinimalCustomTabIntent(
@@ -478,6 +488,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
* Test whether a custom tab can be reparented to a new activity while showing a select popup.
*/
@SmallTest
+ @RetryOnFailure
public void testTabReparentingSelectPopup() throws InterruptedException {
LocationSettingsTestUtil.setSystemLocationSettingEnabled(true);
startCustomTabActivityWithIntent(CustomTabsTestUtils.createMinimalCustomTabIntent(
@@ -520,6 +531,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
* status bar color is also tested.
*/
@SmallTest
+ @RetryOnFailure
public void testToolbarColor() throws InterruptedException {
Intent intent = createMinimalCustomTabIntent();
final int expectedColor = Color.RED;
@@ -541,6 +553,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
* correct {@link PendingIntent}.
*/
@SmallTest
+ @RetryOnFailure
public void testActionButton() throws InterruptedException {
Bitmap expectedIcon = createTestBitmap(96, 48);
Intent intent = createMinimalCustomTabIntent();
@@ -583,6 +596,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
* height/width ratio.
*/
@SmallTest
+ @RetryOnFailure
public void testActionButtonBadRatio() throws InterruptedException {
Bitmap expectedIcon = createTestBitmap(60, 20);
Intent intent = createMinimalCustomTabIntent();
@@ -603,6 +617,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
}
@SmallTest
+ @RetryOnFailure
public void testBottomBar() throws InterruptedException {
final int numItems = 3;
final Bitmap expectedIcon = createTestBitmap(48, 24);
@@ -639,12 +654,14 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
}
@SmallTest
+ @RetryOnFailure
public void testLaunchWithSession() throws InterruptedException {
CustomTabsSessionToken session = warmUpAndLaunchUrlWithSession();
assertEquals(mActivity.getIntentDataProvider().getSession(), session);
}
@SmallTest
+ @RetryOnFailure
public void testLoadNewUrlWithSession() throws InterruptedException {
final Context context = getInstrumentation().getTargetContext();
final Intent intent = CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage);
@@ -697,6 +714,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
}
@SmallTest
+ @RetryOnFailure
public void testCreateNewTab() throws InterruptedException, TimeoutException {
final String testUrl = mTestServer.getURL(
"/chrome/test/data/android/customtabs/test_window_open.html");
@@ -724,6 +742,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
}
@SmallTest
+ @RetryOnFailure
public void testReferrerAddedAutomatically() throws InterruptedException {
final Context context = getInstrumentation().getTargetContext().getApplicationContext();
final Intent intent = CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage2);
@@ -766,6 +785,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
* Tests that the navigation callbacks are sent.
*/
@SmallTest
+ @RetryOnFailure
public void testCallbacksAreSent() {
final ArrayList<Integer> navigationEvents = new ArrayList<>();
CustomTabsSession session = bindWithCallback(new CustomTabsCallback() {
@@ -805,6 +825,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
* Tests that Time To First Contentful Paint is sent.
*/
@SmallTest
+ @RetryOnFailure
public void testPageLoadMetricIsSent() {
Context context = getInstrumentation().getTargetContext().getApplicationContext();
CustomTabsConnection connection = CustomTabsConnection.getInstance((Application) context);
@@ -846,6 +867,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
* only one in the navigation history.
*/
@SmallTest
+ @RetryOnFailure
public void testPrecreatedRenderer() throws InterruptedException {
CustomTabsConnection connection = warmUpAndWait();
Context context = getInstrumentation().getTargetContext();
@@ -872,12 +894,14 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
/** Tests that calling mayLaunchUrl() without warmup() succeeds. */
@SmallTest
+ @RetryOnFailure
public void testMayLaunchUrlWithoutWarmup() {
mayLaunchUrlWithoutWarmup(false);
}
/** Tests that calling warmup() is optional without prerendering. */
@SmallTest
+ @RetryOnFailure
public void testMayLaunchUrlWithoutWarmupNoPrerendering() {
mayLaunchUrlWithoutWarmup(true);
}
@@ -936,6 +960,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
*/
@SmallTest
@Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
+ @RetryOnFailure
public void testPrerenderingAndChangingFragmentIgnoreFragments() throws Exception {
prerenderAndChangeFragment(true, true);
}
@@ -943,6 +968,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
/** Same as above, but the prerender matching should not ignore the fragment. */
@SmallTest
@Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
+ @RetryOnFailure
public void testPrerenderingAndChangingFragmentDontIgnoreFragments() throws Exception {
prerenderAndChangeFragment(false, true);
}
@@ -950,6 +976,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
/** Same as above, prerender matching ignores the fragment, don't wait. */
@SmallTest
@Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
+ @RetryOnFailure
public void testPrerenderingAndChangingFragmentDontWait() throws Exception {
prerenderAndChangeFragment(true, false);
}
@@ -957,6 +984,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
/** Same as above, prerender matching doesn't ignore the fragment, don't wait. */
@SmallTest
@Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
+ @RetryOnFailure
public void testPrerenderingAndChangingFragmentDontWaitDrop() throws Exception {
prerenderAndChangeFragment(false, false);
}
@@ -1026,6 +1054,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
*/
@SmallTest
@Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
+ @RetryOnFailure
public void testPrerenderingCorrectUrl() throws Exception {
Context context = getInstrumentation().getTargetContext().getApplicationContext();
final CustomTabsConnection connection = warmUpAndWait();
@@ -1050,6 +1079,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
*/
@SmallTest
@Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
+ @RetryOnFailure
public void testAllocateChildConnectionWithWarmup() throws Exception {
Context context = getInstrumentation().getTargetContext().getApplicationContext();
final CustomTabsConnection connection = warmUpAndWait();
@@ -1075,6 +1105,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
*/
@SmallTest
@Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
+ @RetryOnFailure
public void testAllocateChildConnectionNoWarmup() throws Exception {
Context context = getInstrumentation().getTargetContext().getApplicationContext();
final CustomTabsConnection connection =
@@ -1102,6 +1133,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
*/
@SmallTest
@Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
+ @RetryOnFailure
public void testAllocateChildConnectionWithPrerender() throws Exception {
Context context = getInstrumentation().getTargetContext().getApplicationContext();
final CustomTabsConnection connection = warmUpAndWait();
@@ -1129,6 +1161,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
*/
@SmallTest
@Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
+ @RetryOnFailure
public void testPrerenderingWithReferrer() throws Exception {
String referrer = "android-app://com.foo.me/";
maybePrerenderAndLaunchWithReferrers(
@@ -1149,6 +1182,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
*/
@SmallTest
@Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
+ @RetryOnFailure
public void testPrerenderingWithMismatchedReferrers() throws Exception {
String prerenderReferrer = "android-app://com.foo.me/";
String launchReferrer = "android-app://com.foo.me.i.changed.my.mind/";
@@ -1167,6 +1201,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
/** Tests that a client can set a referrer, without prerendering. */
@SmallTest
@Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
+ @RetryOnFailure
public void testClientCanSetReferrer() throws Exception {
String referrerUrl = "android-app://com.foo.me/";
maybePrerenderAndLaunchWithReferrers(mTestPage, false, null, referrerUrl);
@@ -1184,6 +1219,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
@SmallTest
@CommandLineFlags.Add({"enable-spdy-proxy-auth", "data-reduction-proxy-lo-fi=always-on",
"enable-data-reduction-proxy-lo-fi-preview"})
+ @RetryOnFailure
public void testLaunchWebLiteURL() throws Exception {
final String testUrl = WEBLITE_PREFIX + mTestPage;
startCustomTabActivityWithIntent(CustomTabsTestUtils.createMinimalCustomTabIntent(
@@ -1198,6 +1234,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
*/
@SmallTest
@CommandLineFlags.Add({"enable-spdy-proxy-auth", "data-reduction-proxy-lo-fi=always-on"})
+ @RetryOnFailure
public void testLaunchWebLiteURLNoPreviews() throws Exception {
final String testUrl = WEBLITE_PREFIX + mTestPage;
startCustomTabActivityWithIntent(CustomTabsTestUtils.createMinimalCustomTabIntent(
@@ -1212,6 +1249,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
*/
@SmallTest
@CommandLineFlags.Add({"enable-spdy-proxy-auth", "enable-data-reduction-proxy-lo-fi-preview"})
+ @RetryOnFailure
public void testLaunchWebLiteURLNoLoFi() throws Exception {
final String testUrl = WEBLITE_PREFIX + mTestPage;
startCustomTabActivityWithIntent(CustomTabsTestUtils.createMinimalCustomTabIntent(
@@ -1227,6 +1265,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
@SmallTest
@CommandLineFlags.Add({"data-reduction-proxy-lo-fi=always-on",
"enable-data-reduction-proxy-lo-fi-preview"})
+ @RetryOnFailure
public void testLaunchWebLiteURLNoDataReductionProxy() throws Exception {
final String testUrl = WEBLITE_PREFIX + mTestPage;
startCustomTabActivityWithIntent(CustomTabsTestUtils.createMinimalCustomTabIntent(
@@ -1242,6 +1281,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
@SmallTest
@CommandLineFlags.Add({"enable-spdy-proxy-auth", "data-reduction-proxy-lo-fi=always-on",
"enable-data-reduction-proxy-lo-fi-preview"})
+ @RetryOnFailure
public void testLaunchHttpsWebLiteURL() throws Exception {
final String testUrl = WEBLITE_PREFIX + mTestPage.replaceFirst("http", "https");
startCustomTabActivityWithIntent(CustomTabsTestUtils.createMinimalCustomTabIntent(
@@ -1257,6 +1297,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
@SmallTest
@CommandLineFlags.Add({"enable-spdy-proxy-auth", "data-reduction-proxy-lo-fi=always-on",
"enable-data-reduction-proxy-lo-fi-preview"})
+ @RetryOnFailure
public void testLaunchNonWebLiteURL() throws Exception {
final String testUrl = mTestPage2 + "/?lite_url=" + mTestPage;
startCustomTabActivityWithIntent(CustomTabsTestUtils.createMinimalCustomTabIntent(

Powered by Google App Engine
This is Rietveld 408576698