Commit 1a30e50c authored by Alice Wang's avatar Alice Wang Committed by Commit Bot

[Android][WebSignIn] Add render test for sign-in in progress screen

This CL adds a render test for the sign-in in progress screen in the
web sign-in bottom sheet.

Bug: 1090356
Change-Id: Ice77509c68b54c1090351ed7962850f98bdbdb50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2356025Reviewed-by: default avatarTanmoy Mollik <triploblastic@chromium.org>
Commit-Queue: Alice Wang <aliceywang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798641}
parent 9a249a14
...@@ -10,6 +10,8 @@ import static androidx.test.espresso.matcher.ViewMatchers.withText; ...@@ -10,6 +10,8 @@ import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.mockito.MockitoAnnotations.initMocks; import static org.mockito.MockitoAnnotations.initMocks;
import android.view.View;
import androidx.test.filters.MediumTest; import androidx.test.filters.MediumTest;
import org.junit.AfterClass; import org.junit.AfterClass;
...@@ -123,6 +125,32 @@ public class AccountPickerBottomSheetRenderTest { ...@@ -123,6 +125,32 @@ public class AccountPickerBottomSheetRenderTest {
mRenderTestRule.render(mCoordinator.getBottomSheetViewForTesting(), "expanded_sheet"); mRenderTestRule.render(mCoordinator.getBottomSheetViewForTesting(), "expanded_sheet");
} }
@Test
@MediumTest
@Feature("RenderTest")
@ParameterAnnotations.UseMethodParameter(NightModeTestUtils.NightModeParams.class)
public void testSignInInProgressView(boolean nightModeEnabled) throws IOException {
mAccountManagerTestRule.addAccount(PROFILE_DATA1);
buildAndShowCollapsedBottomSheet();
View bottomSheetView = mCoordinator.getBottomSheetViewForTesting();
TestThreadUtils.runOnUiThreadBlocking(() -> {
bottomSheetView.findViewById(R.id.account_picker_continue_as_button).performClick();
});
CriteriaHelper.pollUiThread(
bottomSheetView.findViewById(R.id.account_picker_signin_spinner_view)::isShown);
// Currently the ProgressBar animation cannot be disabled on android-marshmallow-arm64-rel
// bot with DisableAnimationsTestRule, we hide the ProgressBar manually here to enable
// checks of other elements on the screen.
// TODO(https://crbug.com/1115067): Delete this line and use DisableAnimationsTestRule
// once DisableAnimationsTestRule is fixed.
TestThreadUtils.runOnUiThreadBlocking(() -> {
bottomSheetView.findViewById(R.id.account_picker_signin_spinner_view)
.setVisibility(View.INVISIBLE);
});
mRenderTestRule.render(
mCoordinator.getBottomSheetViewForTesting(), "signin_in_progress_sheet");
}
private void buildAndShowCollapsedBottomSheet() { private void buildAndShowCollapsedBottomSheet() {
TestThreadUtils.runOnUiThreadBlocking(() -> { TestThreadUtils.runOnUiThreadBlocking(() -> {
mCoordinator = new AccountPickerBottomSheetCoordinator(mActivityTestRule.getActivity(), mCoordinator = new AccountPickerBottomSheetCoordinator(mActivityTestRule.getActivity(),
......
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