Commit 7482ae16 authored by James MacLean's avatar James MacLean Committed by Commit Bot

Revert "Add RenderTests in StartSurfaceLayoutTest for native tab"

This reverts commit ac0e2c90.

Reason for revert: New test is flakey, see https://bugs.chromium.org/p/chromium/issues/detail?id=1023698

Original change's description:
> Add RenderTests in StartSurfaceLayoutTest for native tab
> 
> Add one more RenderTest for native tab. Choose NTP in incognito mode
> for its consistency.
> 
> Also fix the issue about thumbnails being not freed in
> http://crrev.com/c/1903402.
> 
> Bug: 983170
> Change-Id: I68d3f08184cb4b9504935a53f893bb7ea9473ba6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1903620
> Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
> Reviewed-by: Yue Zhang <yuezhanggg@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#713961}

TBR=wychen@chromium.org,yuezhanggg@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 983170
Change-Id: Iee4a534ad7782848e391953aff168dbbb4aff563
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1911605Reviewed-by: default avatarJames MacLean <wjmaclean@chromium.org>
Commit-Queue: James MacLean <wjmaclean@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714574}
parent f85404fe
......@@ -137,7 +137,9 @@ public class StartSurfaceLayoutTest {
.getCurrentTabModelFilter()::isTabModelRestored));
assertEquals(0, mTabListDelegate.getBitmapFetchCountForTesting());
// Only skip thumbnail releasing assertion when "warm" (large soft-cleanup-delay).
// Only skip thumbnail releasing assertion when "warm" (large soft-cleanup-delay) or in
// RenderTest.
// TODO(wychen): figure out why thumbnails are not released in RenderTest.
mSkipAssertThumbnailsAreReleased = false;
}
......@@ -151,14 +153,16 @@ public class StartSurfaceLayoutTest {
@Feature({"RenderTest"})
@CommandLineFlags.Add({BASE_PARAMS})
public void testRenderGrid_3WebTabs() throws InterruptedException, IOException {
mSkipAssertThumbnailsAreReleased = true;
prepareTabs(3, 0, mUrl);
TabUiTestHelper.enterTabSwitcher(mActivityTestRule.getActivity());
TabUiTestHelper.clickFirstCardFromTabSwitcher(mActivityTestRule.getActivity());
enterGTS();
mRenderTestRule.render(
mActivityTestRule.getActivity().findViewById(R.id.tab_list_view), "3_web_tabs");
leaveGTS();
mRenderTestRule.render(mActivityTestRule.getActivity().findViewById(
org.chromium.chrome.tab_ui.R.id.tab_list_view),
"3_web_tabs");
}
@Test
......@@ -166,14 +170,16 @@ public class StartSurfaceLayoutTest {
@Feature({"RenderTest"})
@CommandLineFlags.Add({BASE_PARAMS})
public void testRenderGrid_10WebTabs() throws InterruptedException, IOException {
mSkipAssertThumbnailsAreReleased = true;
prepareTabs(10, 0, mUrl);
TabUiTestHelper.enterTabSwitcher(mActivityTestRule.getActivity());
TabUiTestHelper.clickFirstCardFromTabSwitcher(mActivityTestRule.getActivity());
enterGTS();
mRenderTestRule.render(
mActivityTestRule.getActivity().findViewById(R.id.tab_list_view), "10_web_tabs");
leaveGTS();
mRenderTestRule.render(mActivityTestRule.getActivity().findViewById(
org.chromium.chrome.tab_ui.R.id.tab_list_view),
"10_web_tabs");
}
@Test
......@@ -181,6 +187,8 @@ public class StartSurfaceLayoutTest {
@Feature({"RenderTest"})
@CommandLineFlags.Add({BASE_PARAMS})
public void testRenderGrid_10WebTabs_InitialScroll() throws InterruptedException, IOException {
mSkipAssertThumbnailsAreReleased = true;
prepareTabs(10, 0, mUrl);
TabUiTestHelper.enterTabSwitcher(mActivityTestRule.getActivity());
TabUiTestHelper.clickNthCardFromTabSwitcher(mActivityTestRule.getActivity(),
......@@ -189,9 +197,9 @@ public class StartSurfaceLayoutTest {
enterGTS();
// Make sure the grid tab switcher is scrolled down to show the selected tab.
mRenderTestRule.render(mActivityTestRule.getActivity().findViewById(R.id.tab_list_view),
mRenderTestRule.render(mActivityTestRule.getActivity().findViewById(
org.chromium.chrome.tab_ui.R.id.tab_list_view),
"10_web_tabs-select_last");
leaveGTS();
}
@Test
......@@ -199,6 +207,8 @@ public class StartSurfaceLayoutTest {
@Feature({"RenderTest"})
@CommandLineFlags.Add({BASE_PARAMS})
public void testRenderGrid_Incognito() throws InterruptedException, IOException {
mSkipAssertThumbnailsAreReleased = true;
// Prepare some incognito tabs and enter tab switcher.
prepareTabs(1, 3, mUrl);
assertTrue(mActivityTestRule.getActivity().getCurrentTabModel().isIncognito());
......@@ -206,28 +216,9 @@ public class StartSurfaceLayoutTest {
TabUiTestHelper.clickFirstCardFromTabSwitcher(mActivityTestRule.getActivity());
enterGTS();
mRenderTestRule.render(mActivityTestRule.getActivity().findViewById(R.id.tab_list_view),
mRenderTestRule.render(mActivityTestRule.getActivity().findViewById(
org.chromium.chrome.tab_ui.R.id.tab_list_view),
"3_incognito_web_tabs");
leaveGTS();
}
@Test
@MediumTest
@Feature({"RenderTest"})
@CommandLineFlags.Add({BASE_PARAMS})
public void testRenderGrid_3IncognitoNTPs() throws InterruptedException, IOException {
// 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
// away the MV tiles, login promo, feed, etc.
prepareTabs(1, 3, null);
assertTrue(mActivityTestRule.getActivity().getCurrentTabModel().isIncognito());
TabUiTestHelper.enterTabSwitcher(mActivityTestRule.getActivity());
TabUiTestHelper.clickFirstCardFromTabSwitcher(mActivityTestRule.getActivity());
enterGTS();
mRenderTestRule.render(mActivityTestRule.getActivity().findViewById(R.id.tab_list_view),
"3_incognito_ntps");
leaveGTS();
}
@Test
......@@ -473,7 +464,7 @@ public class StartSurfaceLayoutTest {
waitForCaptureRateControl();
}
int count = getCaptureCount();
onView(withId(R.id.tab_list_view))
onView(withId(org.chromium.chrome.tab_ui.R.id.tab_list_view))
.perform(RecyclerViewActions.actionOnItemAtPosition(targetIndex, click()));
CriteriaHelper.pollUiThread(() -> {
boolean doneHiding =
......@@ -596,16 +587,16 @@ public class StartSurfaceLayoutTest {
public void testIncognitoEnterGts() throws InterruptedException {
prepareTabs(1, 1, null);
enterGTS();
onView(withId(R.id.tab_list_view))
onView(withId(org.chromium.chrome.tab_ui.R.id.tab_list_view))
.check(TabCountAssertion.havingTabCount(1));
onView(withId(R.id.tab_list_view))
onView(withId(org.chromium.chrome.tab_ui.R.id.tab_list_view))
.perform(RecyclerViewActions.actionOnItemAtPosition(0, click()));
CriteriaHelper.pollInstrumentationThread(
() -> !mActivityTestRule.getActivity().getLayoutManager().overviewVisible());
enterGTS();
onView(withId(R.id.tab_list_view))
onView(withId(org.chromium.chrome.tab_ui.R.id.tab_list_view))
.check(TabCountAssertion.havingTabCount(1));
}
......@@ -618,16 +609,16 @@ public class StartSurfaceLayoutTest {
// Prepare two incognito tabs and enter tab switcher.
prepareTabs(1, 2, mUrl);
enterGTS();
onView(withId(R.id.tab_list_view))
onView(withId(org.chromium.chrome.tab_ui.R.id.tab_list_view))
.check(TabCountAssertion.havingTabCount(2));
for (int i = 0; i < mRepeat; i++) {
switchTabModel(false);
onView(withId(R.id.tab_list_view))
onView(withId(org.chromium.chrome.tab_ui.R.id.tab_list_view))
.check(TabCountAssertion.havingTabCount(1));
switchTabModel(true);
onView(withId(R.id.tab_list_view))
onView(withId(org.chromium.chrome.tab_ui.R.id.tab_list_view))
.check(TabCountAssertion.havingTabCount(2));
}
leaveGTS();
......
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