Commit 7ba39a05 authored by Alice Wang's avatar Alice Wang Committed by Chromium LUCI CQ

[Android][Test] Add SigninFirstRunFragment render test with adult account

This CL adds a render test for SigninFirstRunFragment with an adult
account on device.

Bug: 1045473
Change-Id: I30138f599df28f32ecdbff09d3c35fe63fdb8a67
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2632685Reviewed-by: default avatarTanmoy Mollik <triploblastic@chromium.org>
Commit-Queue: Alice Wang <aliceywang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845106}
parent 0d7f7013
......@@ -180,6 +180,33 @@ public class SigninFragmentTest {
"signin_fragment_default_account");
}
@Test
@LargeTest
@Feature("RenderTest")
public void testSigninFREFragmentWithAdultAccount() throws IOException {
HistogramDelta startPageHistogram =
new HistogramDelta("Signin.SigninStartedAccessPoint", SigninAccessPoint.START_PAGE);
mSyncTestRule.addTestAccount();
CustomSigninFirstRunFragment fragment = new CustomSigninFirstRunFragment();
Bundle bundle = new Bundle();
bundle.putInt(SigninFirstRunFragment.CHILD_ACCOUNT_STATUS, ChildAccountStatus.NOT_CHILD);
when(mFirstRunPageDelegateMock.getProperties()).thenReturn(bundle);
fragment.setPageDelegate(mFirstRunPageDelegateMock);
mActivityTestRule.launchActivity(null);
TestThreadUtils.runOnUiThreadBlocking(() -> {
mActivityTestRule.getActivity()
.getSupportFragmentManager()
.beginTransaction()
.add(android.R.id.content, fragment)
.commit();
});
ApplicationTestUtils.waitForActivityState(mActivityTestRule.getActivity(), Stage.RESUMED);
Assert.assertEquals(1, startPageHistogram.getDelta());
mRenderTestRule.render(mActivityTestRule.getActivity().findViewById(android.R.id.content),
"signin_fre_fragment_with_adult_account");
}
@Test
@LargeTest
@Feature("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