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

[Android] Add signin FRE render test when no accounts on device

This CL adds a render test for SigninFirstRunFragment when no accounts
are on device.

Bug: 1045473
Change-Id: I058212677f7f4cb0d29888632f12d2fabd75ded0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2639895Reviewed-by: default avatarTanmoy Mollik <triploblastic@chromium.org>
Commit-Queue: Alice Wang <aliceywang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845624}
parent d1c9e030
......@@ -180,6 +180,35 @@ public class SigninFragmentTest {
"signin_fragment_default_account");
}
@Test
@LargeTest
@Feature("RenderTest")
public void testSigninFREFragmentWithNoAccountsOnDevice() throws IOException {
HistogramDelta countHistogram =
new HistogramDelta("Signin.AndroidDeviceAccountsNumberWhenEnteringFRE", 0);
HistogramDelta startPageHistogram =
new HistogramDelta("Signin.SigninStartedAccessPoint", SigninAccessPoint.START_PAGE);
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, countHistogram.getDelta());
Assert.assertEquals(1, startPageHistogram.getDelta());
mRenderTestRule.render(mActivityTestRule.getActivity().findViewById(android.R.id.content),
"signin_fre_fragment_with_no_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