Commit 72e7440d authored by Wei-Yin Chen (陳威尹)'s avatar Wei-Yin Chen (陳威尹) Committed by Commit Bot

Specify TabToGTSAnimation in StartSurfaceLayoutTest

Make sure all TabToGTSAnimation annotations in StartSurfaceLayoutTest
are correct.

Bug: 964406
Change-Id: I437040b668b1e9a397c90863d9142dadc2c0eabf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2114209Reviewed-by: default avatarMei Liang <meiliang@chromium.org>
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752623}
parent 8ad69166
...@@ -20,6 +20,7 @@ import static android.support.test.espresso.matcher.ViewMatchers.withText; ...@@ -20,6 +20,7 @@ import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.core.AllOf.allOf; import static org.hamcrest.core.AllOf.allOf;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
...@@ -124,8 +125,9 @@ import java.util.concurrent.atomic.AtomicReference; ...@@ -124,8 +125,9 @@ import java.util.concurrent.atomic.AtomicReference;
/** Tests for the {@link StartSurfaceLayout} */ /** Tests for the {@link StartSurfaceLayout} */
@RunWith(ChromeJUnit4ClassRunner.class) @RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
"enable-features=" + ChromeFeatureList.TAB_GRID_LAYOUT_ANDROID + "<Study",
"force-fieldtrials=Study/Group"}) "force-fieldtrials=Study/Group"})
@Features.EnableFeatures({ChromeFeatureList.TAB_GRID_LAYOUT_ANDROID + "<Study",
ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study"})
@Restriction( @Restriction(
{UiRestriction.RESTRICTION_TYPE_PHONE, Restriction.RESTRICTION_TYPE_NON_LOW_END_DEVICE}) {UiRestriction.RESTRICTION_TYPE_PHONE, Restriction.RESTRICTION_TYPE_NON_LOW_END_DEVICE})
public class StartSurfaceLayoutTest { public class StartSurfaceLayoutTest {
...@@ -260,6 +262,7 @@ public class StartSurfaceLayoutTest { ...@@ -260,6 +262,7 @@ public class StartSurfaceLayoutTest {
@CommandLineFlags.Add({BASE_PARAMS}) @CommandLineFlags.Add({BASE_PARAMS})
public void testRenderGrid_3NativeTabs() throws InterruptedException, IOException { public void testRenderGrid_3NativeTabs() throws InterruptedException, IOException {
// clang-format on // clang-format on
assertTrue(TabFeatureUtilities.isTabToGtsAnimationEnabled());
// Prepare some incognito native tabs and enter tab switcher. // Prepare some incognito native tabs and enter tab switcher.
// NTP in incognito mode is chosen for its consistency in look, and we don't have to mock // NTP in incognito mode is chosen for its consistency in look, and we don't have to mock
// away the MV tiles, login promo, feed, etc. // away the MV tiles, login promo, feed, etc.
...@@ -276,10 +279,11 @@ public class StartSurfaceLayoutTest { ...@@ -276,10 +279,11 @@ public class StartSurfaceLayoutTest {
@Test @Test
@MediumTest @MediumTest
// clang-format off // clang-format off
@Features.DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION) @Features.DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study")
@CommandLineFlags.Add({BASE_PARAMS}) @CommandLineFlags.Add({BASE_PARAMS})
public void testTabToGridFromLiveTab() throws InterruptedException { public void testTabToGridFromLiveTab() throws InterruptedException {
// clang-format on // clang-format on
assertFalse(TabFeatureUtilities.isTabToGtsAnimationEnabled());
assertEquals(0, mTabListDelegate.getSoftCleanupDelayForTesting()); assertEquals(0, mTabListDelegate.getSoftCleanupDelayForTesting());
assertEquals(0, mTabListDelegate.getCleanupDelayForTesting()); assertEquals(0, mTabListDelegate.getCleanupDelayForTesting());
...@@ -305,10 +309,11 @@ public class StartSurfaceLayoutTest { ...@@ -305,10 +309,11 @@ public class StartSurfaceLayoutTest {
@Test @Test
@MediumTest @MediumTest
// clang-format off // clang-format off
@Features.DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION) @Features.DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study")
@CommandLineFlags.Add({BASE_PARAMS + "/soft-cleanup-delay/2000/cleanup-delay/10000"}) @CommandLineFlags.Add({BASE_PARAMS + "/soft-cleanup-delay/2000/cleanup-delay/10000"})
public void testTabToGridFromLiveTabWarm() throws InterruptedException { public void testTabToGridFromLiveTabWarm() throws InterruptedException {
// clang-format on // clang-format on
assertFalse(TabFeatureUtilities.isTabToGtsAnimationEnabled());
assertEquals(2000, mTabListDelegate.getSoftCleanupDelayForTesting()); assertEquals(2000, mTabListDelegate.getSoftCleanupDelayForTesting());
assertEquals(10000, mTabListDelegate.getCleanupDelayForTesting()); assertEquals(10000, mTabListDelegate.getCleanupDelayForTesting());
...@@ -324,6 +329,7 @@ public class StartSurfaceLayoutTest { ...@@ -324,6 +329,7 @@ public class StartSurfaceLayoutTest {
@MinAndroidSdkLevel(Build.VERSION_CODES.M) // TODO(crbug.com/997065#c8): remove SDK restriction. @MinAndroidSdkLevel(Build.VERSION_CODES.M) // TODO(crbug.com/997065#c8): remove SDK restriction.
public void testTabToGridFromLiveTabWarmAnimation() throws InterruptedException { public void testTabToGridFromLiveTabWarmAnimation() throws InterruptedException {
// clang-format on // clang-format on
assertTrue(TabFeatureUtilities.isTabToGtsAnimationEnabled());
prepareTabs(2, 0, NTP_URL); prepareTabs(2, 0, NTP_URL);
testTabToGrid(mUrl); testTabToGrid(mUrl);
} }
...@@ -331,10 +337,11 @@ public class StartSurfaceLayoutTest { ...@@ -331,10 +337,11 @@ public class StartSurfaceLayoutTest {
@Test @Test
@MediumTest @MediumTest
// clang-format off // clang-format off
@Features.DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION) @Features.DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study")
@CommandLineFlags.Add({BASE_PARAMS + "/cleanup-delay/10000"}) @CommandLineFlags.Add({BASE_PARAMS + "/cleanup-delay/10000"})
public void testTabToGridFromLiveTabSoft() throws InterruptedException { public void testTabToGridFromLiveTabSoft() throws InterruptedException {
// clang-format on // clang-format on
assertFalse(TabFeatureUtilities.isTabToGtsAnimationEnabled());
assertEquals(0, mTabListDelegate.getSoftCleanupDelayForTesting()); assertEquals(0, mTabListDelegate.getSoftCleanupDelayForTesting());
assertEquals(10000, mTabListDelegate.getCleanupDelayForTesting()); assertEquals(10000, mTabListDelegate.getCleanupDelayForTesting());
...@@ -350,6 +357,7 @@ public class StartSurfaceLayoutTest { ...@@ -350,6 +357,7 @@ public class StartSurfaceLayoutTest {
@MinAndroidSdkLevel(Build.VERSION_CODES.M) // TODO(crbug.com/997065#c8): remove SDK restriction. @MinAndroidSdkLevel(Build.VERSION_CODES.M) // TODO(crbug.com/997065#c8): remove SDK restriction.
public void testTabToGridFromLiveTabSoftAnimation() throws InterruptedException { public void testTabToGridFromLiveTabSoftAnimation() throws InterruptedException {
// clang-format on // clang-format on
assertTrue(TabFeatureUtilities.isTabToGtsAnimationEnabled());
prepareTabs(2, 0, NTP_URL); prepareTabs(2, 0, NTP_URL);
testTabToGrid(mUrl); testTabToGrid(mUrl);
} }
...@@ -404,8 +412,9 @@ public class StartSurfaceLayoutTest { ...@@ -404,8 +412,9 @@ public class StartSurfaceLayoutTest {
@Test @Test
@MediumTest @MediumTest
@Features.DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION) @Features.DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study")
public void testGridToTabToCurrentLive() throws InterruptedException { public void testGridToTabToCurrentLive() throws InterruptedException {
assertFalse(TabFeatureUtilities.isTabToGtsAnimationEnabled());
prepareTabs(1, 0, mUrl); prepareTabs(1, 0, mUrl);
testGridToTab(false, false); testGridToTab(false, false);
} }
...@@ -426,8 +435,9 @@ public class StartSurfaceLayoutTest { ...@@ -426,8 +435,9 @@ public class StartSurfaceLayoutTest {
*/ */
@Test @Test
@MediumTest @MediumTest
@Features.DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION) @Features.DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study")
public void testGridToTabToCurrentLiveDetached() throws Exception { public void testGridToTabToCurrentLiveDetached() throws Exception {
assertFalse(TabFeatureUtilities.isTabToGtsAnimationEnabled());
// This works on emulators but not on real devices. See crbug.com/986047. // This works on emulators but not on real devices. See crbug.com/986047.
if (!isEmulator()) return; if (!isEmulator()) return;
...@@ -468,14 +478,16 @@ public class StartSurfaceLayoutTest { ...@@ -468,14 +478,16 @@ public class StartSurfaceLayoutTest {
@MinAndroidSdkLevel(Build.VERSION_CODES.LOLLIPOP) @MinAndroidSdkLevel(Build.VERSION_CODES.LOLLIPOP)
@DisabledTest(message = "crbug.com/993201 This test fails deterministically on Nexus 5X") @DisabledTest(message = "crbug.com/993201 This test fails deterministically on Nexus 5X")
public void testGridToTabToCurrentLiveWithAnimation() throws InterruptedException { public void testGridToTabToCurrentLiveWithAnimation() throws InterruptedException {
assertTrue(TabFeatureUtilities.isTabToGtsAnimationEnabled());
prepareTabs(1, 0, mUrl); prepareTabs(1, 0, mUrl);
testGridToTab(false, false); testGridToTab(false, false);
} }
@Test @Test
@MediumTest @MediumTest
@Features.DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION) @Features.DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study")
public void testGridToTabToOtherLive() throws InterruptedException { public void testGridToTabToOtherLive() throws InterruptedException {
assertFalse(TabFeatureUtilities.isTabToGtsAnimationEnabled());
prepareTabs(2, 0, mUrl); prepareTabs(2, 0, mUrl);
testGridToTab(true, false); testGridToTab(true, false);
} }
...@@ -486,14 +498,16 @@ public class StartSurfaceLayoutTest { ...@@ -486,14 +498,16 @@ public class StartSurfaceLayoutTest {
@MinAndroidSdkLevel(Build.VERSION_CODES.LOLLIPOP) @MinAndroidSdkLevel(Build.VERSION_CODES.LOLLIPOP)
@DisabledTest(message = "crbug.com/993201 This test fails deterministically on Nexus 5X") @DisabledTest(message = "crbug.com/993201 This test fails deterministically on Nexus 5X")
public void testGridToTabToOtherLiveWithAnimation() throws InterruptedException { public void testGridToTabToOtherLiveWithAnimation() throws InterruptedException {
assertTrue(TabFeatureUtilities.isTabToGtsAnimationEnabled());
prepareTabs(2, 0, mUrl); prepareTabs(2, 0, mUrl);
testGridToTab(true, false); testGridToTab(true, false);
} }
@Test @Test
@MediumTest @MediumTest
@Features.DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION) @Features.DisableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study")
public void testGridToTabToOtherFrozen() throws InterruptedException { public void testGridToTabToOtherFrozen() throws InterruptedException {
assertFalse(TabFeatureUtilities.isTabToGtsAnimationEnabled());
prepareTabs(2, 0, mUrl); prepareTabs(2, 0, mUrl);
testGridToTab(true, true); testGridToTab(true, true);
} }
...@@ -1020,7 +1034,7 @@ public class StartSurfaceLayoutTest { ...@@ -1020,7 +1034,7 @@ public class StartSurfaceLayoutTest {
@MediumTest @MediumTest
@Feature("NewTabTile") @Feature("NewTabTile")
// clang-format off // clang-format off
@Features.DisableFeatures({ChromeFeatureList.TAB_TO_GTS_ANIMATION, @Features.DisableFeatures({ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study",
ChromeFeatureList.CLOSE_TAB_SUGGESTIONS}) ChromeFeatureList.CLOSE_TAB_SUGGESTIONS})
@CommandLineFlags.Add({BASE_PARAMS + "/tab_grid_layout_android_new_tab_tile/false" @CommandLineFlags.Add({BASE_PARAMS + "/tab_grid_layout_android_new_tab_tile/false"
+ "/tab_grid_layout_android_new_tab/false"}) + "/tab_grid_layout_android_new_tab/false"})
...@@ -1042,7 +1056,6 @@ public class StartSurfaceLayoutTest { ...@@ -1042,7 +1056,6 @@ public class StartSurfaceLayoutTest {
@Test @Test
@MediumTest @MediumTest
// clang-format off // clang-format off
@Features.EnableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study")
@CommandLineFlags.Add({BASE_PARAMS}) @CommandLineFlags.Add({BASE_PARAMS})
public void testThumbnailAspectRatio_default() throws Exception { public void testThumbnailAspectRatio_default() throws Exception {
// clang-format on // clang-format on
...@@ -1055,7 +1068,6 @@ public class StartSurfaceLayoutTest { ...@@ -1055,7 +1068,6 @@ public class StartSurfaceLayoutTest {
@Test @Test
@MediumTest @MediumTest
// clang-format off // clang-format off
@Features.EnableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study")
@CommandLineFlags.Add({BASE_PARAMS + "/thumbnail_aspect_ratio/0.75"}) @CommandLineFlags.Add({BASE_PARAMS + "/thumbnail_aspect_ratio/0.75"})
public void testThumbnailAspectRatio_point75() throws Exception { public void testThumbnailAspectRatio_point75() throws Exception {
prepareTabs(2, 0, mUrl); prepareTabs(2, 0, mUrl);
...@@ -1075,7 +1087,6 @@ public class StartSurfaceLayoutTest { ...@@ -1075,7 +1087,6 @@ public class StartSurfaceLayoutTest {
@Test @Test
@MediumTest @MediumTest
// clang-format off // clang-format off
@Features.EnableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study")
@CommandLineFlags.Add({BASE_PARAMS + "/thumbnail_aspect_ratio/2.0/allow_to_refetch/true"}) @CommandLineFlags.Add({BASE_PARAMS + "/thumbnail_aspect_ratio/2.0/allow_to_refetch/true"})
public void testThumbnailAspectRatio_fromTwoToPoint75() throws Exception { public void testThumbnailAspectRatio_fromTwoToPoint75() throws Exception {
// clang-format on // clang-format on
...@@ -1102,7 +1113,6 @@ public class StartSurfaceLayoutTest { ...@@ -1102,7 +1113,6 @@ public class StartSurfaceLayoutTest {
@Test @Test
@MediumTest @MediumTest
// clang-format off // clang-format off
@Features.EnableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study")
@CommandLineFlags.Add({BASE_PARAMS}) @CommandLineFlags.Add({BASE_PARAMS})
public void testThumbnailFetchingResult_defaultAspectRatio() throws Exception { public void testThumbnailFetchingResult_defaultAspectRatio() throws Exception {
// clang-format on // clang-format on
...@@ -1180,7 +1190,6 @@ public class StartSurfaceLayoutTest { ...@@ -1180,7 +1190,6 @@ public class StartSurfaceLayoutTest {
@Test @Test
@MediumTest @MediumTest
// clang-format off // clang-format off
@Features.EnableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study")
@CommandLineFlags.Add({BASE_PARAMS + "/thumbnail_aspect_ratio/2.0/allow_to_refetch/true"}) @CommandLineFlags.Add({BASE_PARAMS + "/thumbnail_aspect_ratio/2.0/allow_to_refetch/true"})
public void testThumbnailFetchingResult_changingAspectRatio() throws Exception { public void testThumbnailFetchingResult_changingAspectRatio() throws Exception {
// clang-format on // clang-format on
...@@ -1264,7 +1273,6 @@ public class StartSurfaceLayoutTest { ...@@ -1264,7 +1273,6 @@ public class StartSurfaceLayoutTest {
@Test @Test
@MediumTest @MediumTest
// clang-format off // clang-format off
@Features.EnableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study")
@DisableIf.Build(sdk_is_less_than = Build.VERSION_CODES.M, @DisableIf.Build(sdk_is_less_than = Build.VERSION_CODES.M,
message = "https://crbug.com/1023833") message = "https://crbug.com/1023833")
@CommandLineFlags.Add({BASE_PARAMS}) @CommandLineFlags.Add({BASE_PARAMS})
...@@ -1279,7 +1287,6 @@ public class StartSurfaceLayoutTest { ...@@ -1279,7 +1287,6 @@ public class StartSurfaceLayoutTest {
@Test @Test
@MediumTest @MediumTest
// clang-format off // clang-format off
@Features.EnableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study")
@DisableIf.Build(sdk_is_less_than = Build.VERSION_CODES.M, @DisableIf.Build(sdk_is_less_than = Build.VERSION_CODES.M,
message = "https://crbug.com/1023833") message = "https://crbug.com/1023833")
@CommandLineFlags.Add({BASE_PARAMS + "/thumbnail_aspect_ratio/0.75"}) @CommandLineFlags.Add({BASE_PARAMS + "/thumbnail_aspect_ratio/0.75"})
...@@ -1294,7 +1301,6 @@ public class StartSurfaceLayoutTest { ...@@ -1294,7 +1301,6 @@ public class StartSurfaceLayoutTest {
@Test @Test
@MediumTest @MediumTest
// clang-format off // clang-format off
@Features.EnableFeatures(ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study")
@DisableIf.Build(sdk_is_less_than = Build.VERSION_CODES.M, @DisableIf.Build(sdk_is_less_than = Build.VERSION_CODES.M,
message = "https://crbug.com/1023833") message = "https://crbug.com/1023833")
@CommandLineFlags.Add({BASE_PARAMS + "/thumbnail_aspect_ratio/0.75"}) @CommandLineFlags.Add({BASE_PARAMS + "/thumbnail_aspect_ratio/0.75"})
...@@ -1309,7 +1315,7 @@ public class StartSurfaceLayoutTest { ...@@ -1309,7 +1315,7 @@ public class StartSurfaceLayoutTest {
@MediumTest @MediumTest
@Feature("NewTabVariation") @Feature("NewTabVariation")
// clang-format off // clang-format off
@Features.DisableFeatures({ChromeFeatureList.TAB_TO_GTS_ANIMATION, @Features.DisableFeatures({ChromeFeatureList.TAB_TO_GTS_ANIMATION + "<Study",
ChromeFeatureList.CLOSE_TAB_SUGGESTIONS}) ChromeFeatureList.CLOSE_TAB_SUGGESTIONS})
@CommandLineFlags.Add({BASE_PARAMS + "/tab_grid_layout_android_new_tab/NewTabVariation"}) @CommandLineFlags.Add({BASE_PARAMS + "/tab_grid_layout_android_new_tab/NewTabVariation"})
public void testNewTabVariation() throws InterruptedException { public void testNewTabVariation() throws InterruptedException {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment