Commit 377f8147 authored by Tanmoy Mollik's avatar Tanmoy Mollik Committed by Commit Bot

[Android] Update SigninPromo tests in NewTabPageTest

Use AccountManagerTestRule to add accounts on the device to check that
Signin Promos for that account is shown. Currently the tests just check
generic promo.

Bug: 1100895
Change-Id: Iea2f61943ca0c3545a02d95b812cac1a28ecbca7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2519456
Commit-Queue: Tanmoy Mollik <triploblastic@chromium.org>
Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829214}
parent 33cfcf1f
......@@ -188,7 +188,7 @@ public class NewTabPageTest {
@SmallTest
@Feature({"NewTabPage", "FeedNewTabPage", "RenderTest"})
@Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)
public void testRender_SignInPromo() throws Exception {
public void testRender_SignInPromoNoAccounts() throws Exception {
// Scroll to the sign in promo in case it is not visible.
onView(instanceOf(RecyclerView.class))
.perform(RecyclerViewActions.scrollToPosition(SIGNIN_PROMO_POSITION));
......@@ -196,6 +196,20 @@ public class NewTabPageTest {
mNtp.getCoordinatorForTesting().getSignInPromoViewForTesting(), "sign_in_promo");
}
@Test
@SmallTest
@Feature({"NewTabPage", "FeedNewTabPage", "RenderTest"})
@Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)
public void testRender_SignInPromoWithAccount() throws Exception {
mAccountManagerTestRule.addAccount(mAccountManagerTestRule.createProfileDataFromName(
AccountManagerTestRule.TEST_ACCOUNT_EMAIL));
// Scroll to the sign in promo in case it is not visible.
onView(instanceOf(RecyclerView.class))
.perform(RecyclerViewActions.scrollToPosition(SIGNIN_PROMO_POSITION));
mRenderTestRule.render(mNtp.getCoordinatorForTesting().getSignInPromoViewForTesting(),
"sign_in_promo_with_account");
}
@Test
@SmallTest
@Feature({"NewTabPage", "FeedNewTabPage", "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