Commit e4bf958c authored by Cathy Li's avatar Cathy Li Committed by Commit Bot

[ExploreSites]: ESP should default to top of the page if variation is MostLikely.

Bug: 971323
Change-Id: Iabdccb8e835bae9b32a2435d6eb31e15ec2aa213
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1646552Reviewed-by: default avatarJustin DeWitt <dewittj@chromium.org>
Commit-Queue: Cathy Li <chili@chromium.org>
Cr-Commit-Position: refs/heads/master@{#667320}
parent 04b7a085
...@@ -182,9 +182,11 @@ public class ExploreSitesPage extends BasicNativePage { ...@@ -182,9 +182,11 @@ public class ExploreSitesPage extends BasicNativePage {
} }
}); });
// When we personalize, we don't want to scroll to the 4th category. // We don't want to scroll to the 4th category if personalized
mInitialScrollPosition = // or integrated with Most Likely.
ExploreSitesBridge.getVariation() == ExploreSitesVariation.PERSONALIZED int variation = ExploreSitesBridge.getVariation();
mInitialScrollPosition = variation == ExploreSitesVariation.PERSONALIZED
|| ExploreSitesBridge.isIntegratedWithMostLikely(variation)
? INITIAL_SCROLL_POSITION_PERSONALIZED ? INITIAL_SCROLL_POSITION_PERSONALIZED
: INITIAL_SCROLL_POSITION; : INITIAL_SCROLL_POSITION;
......
...@@ -140,6 +140,18 @@ public class ExploreSitesPageTest { ...@@ -140,6 +140,18 @@ public class ExploreSitesPageTest {
mRenderTestRule.render(mRecyclerView, "initial_layout"); mRenderTestRule.render(mRecyclerView, "initial_layout");
} }
@Test
@SmallTest
@CommandLineFlags.
Add({"enabled-features=ExploreSites<FakeStudyName", "force-fieldtrials=FakeStudyName/Enabled",
"force-fieldtrial-params=FakeStudyName.Enabled:variation/mostLikelyTile"})
@Feature({"ExploreSites", "RenderTest"})
public void
testInitialLayout_MostLikely() throws Exception {
mRenderTestRule.render(mRecyclerView, "initial_layout");
Assert.assertEquals(0, getFirstVisiblePosition());
}
@Test @Test
@SmallTest @SmallTest
@Feature({"ExploreSites", "RenderTest"}) @Feature({"ExploreSites", "RenderTest"})
......
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