Commit 0e177c4b authored by Peter E Conn's avatar Peter E Conn Committed by Commit Bot

🏡 Enable scroll to load but remove listener in UiCapture test.

Bring the UI captured by the test in line with what is seen by default.

Bug: 754184
Change-Id: Id18971774dbbd87f14aa701f04ba101d2137d580
Reviewed-on: https://chromium-review.googlesource.com/702262Reviewed-by: default avatarMichael van Ouwerkerk <mvanouwerkerk@chromium.org>
Commit-Queue: Peter Conn <peconn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506739}
parent 9b006ab4
...@@ -18,11 +18,9 @@ import org.junit.Rule; ...@@ -18,11 +18,9 @@ import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.Restriction; import org.chromium.base.test.util.Restriction;
import org.chromium.chrome.R; import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.ntp.NtpUiCaptureTestData; import org.chromium.chrome.browser.ntp.NtpUiCaptureTestData;
import org.chromium.chrome.browser.ntp.cards.ItemViewType; import org.chromium.chrome.browser.ntp.cards.ItemViewType;
import org.chromium.chrome.browser.ntp.snippets.CategoryStatus; import org.chromium.chrome.browser.ntp.snippets.CategoryStatus;
...@@ -43,7 +41,6 @@ import java.util.Collections; ...@@ -43,7 +41,6 @@ import java.util.Collections;
*/ */
@RunWith(ChromeJUnit4ClassRunner.class) @RunWith(ChromeJUnit4ClassRunner.class)
@Restriction(UiRestriction.RESTRICTION_TYPE_PHONE) // ChromeHome is only enabled on phones @Restriction(UiRestriction.RESTRICTION_TYPE_PHONE) // ChromeHome is only enabled on phones
@CommandLineFlags.Add({"disable-features=" + ChromeFeatureList.CONTENT_SUGGESTIONS_SCROLL_TO_LOAD})
public class HomeSheetCardsUiCaptureTest { public class HomeSheetCardsUiCaptureTest {
@Rule @Rule
public SuggestionsBottomSheetTestRule mActivityRule = new SuggestionsBottomSheetTestRule(); public SuggestionsBottomSheetTestRule mActivityRule = new SuggestionsBottomSheetTestRule();
...@@ -88,6 +85,17 @@ public class HomeSheetCardsUiCaptureTest { ...@@ -88,6 +85,17 @@ public class HomeSheetCardsUiCaptureTest {
mActivityRule.setSheetState(BottomSheet.SHEET_STATE_FULL, false); mActivityRule.setSheetState(BottomSheet.SHEET_STATE_FULL, false);
waitForWindowUpdates(); waitForWindowUpdates();
// When scrolling to a View, we wait until the View is no longer updating - when it is no
// longer dirty. If scroll to load is triggered, the animated progress spinner will keep
// the RecyclerView dirty as it is constantly updating. In addition for the UiCaptureTest
// we would like to get to the bottom of the CardsUI.
// We do not want to disable the Scroll to Load feature entirely because its presence
// effects other elements of the UI - it moves the Learn More link into the Context Menu.
// Removing the ScrollToLoad listener from the RecyclerView allows us to prevent scroll to
// load triggering while maintaining the UI otherwise.
mActivityRule.getRecyclerView().clearScrollToLoadListener();
mActivityRule.scrollToFirstItemOfType(ItemViewType.ACTION); mActivityRule.scrollToFirstItemOfType(ItemViewType.ACTION);
waitForWindowUpdates(); waitForWindowUpdates();
mScreenShooter.shoot("ScrolledToMoreButton"); mScreenShooter.shoot("ScrolledToMoreButton");
......
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