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

[Android][WebSignin] Use correct icon for sign-in general error

This CL uses correct warning icon for sign-in general error and adds
render tests for the sign-in general error view.

Bug: 1120308
Change-Id: Ie25b8be7fca803ea49dfbc855dac41bc2bd89f8e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2379751Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Commit-Queue: Alice Wang <aliceywang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803163}
parent 8222b0cf
...@@ -141,6 +141,7 @@ class AccountPickerBottomSheetView implements BottomSheetContent { ...@@ -141,6 +141,7 @@ class AccountPickerBottomSheetView implements BottomSheetContent {
* Sets up the sign-in in progress view. * Sets up the sign-in in progress view.
*/ */
void setUpSignInInProgressView() { void setUpSignInInProgressView() {
mLogoImage.setImageResource(R.drawable.chrome_sync_logo);
mAccountPickerTitle.setText(R.string.signin_account_picker_bottom_sheet_signin_title); mAccountPickerTitle.setText(R.string.signin_account_picker_bottom_sheet_signin_title);
mAccountPickerSubtitle.setVisibility(View.INVISIBLE); mAccountPickerSubtitle.setVisibility(View.INVISIBLE);
// Set the account picker subtitle text in case there's an error. // Set the account picker subtitle text in case there's an error.
...@@ -168,6 +169,7 @@ class AccountPickerBottomSheetView implements BottomSheetContent { ...@@ -168,6 +169,7 @@ class AccountPickerBottomSheetView implements BottomSheetContent {
* Sets up the view for sign-in general error. * Sets up the view for sign-in general error.
*/ */
void setUpSignInGeneralErrorView() { void setUpSignInGeneralErrorView() {
mLogoImage.setImageResource(R.drawable.ic_warning_red_24dp);
mAccountPickerTitle.setText(R.string.signin_account_picker_bottom_sheet_error_title); mAccountPickerTitle.setText(R.string.signin_account_picker_bottom_sheet_error_title);
mAccountPickerSubtitle.setText(R.string.signin_account_picker_general_error_subtitle); mAccountPickerSubtitle.setText(R.string.signin_account_picker_general_error_subtitle);
mAccountPickerSubtitle.setVisibility(View.VISIBLE); mAccountPickerSubtitle.setVisibility(View.VISIBLE);
......
...@@ -166,6 +166,28 @@ public class AccountPickerBottomSheetRenderTest { ...@@ -166,6 +166,28 @@ public class AccountPickerBottomSheetRenderTest {
clickContinueButtonAndCheckSigninInProgressView(); clickContinueButtonAndCheckSigninInProgressView();
} }
@Test
@MediumTest
@Feature("RenderTest")
@ParameterAnnotations.UseMethodParameter(NightModeTestUtils.NightModeParams.class)
public void testSigninGeneralErrorView(boolean nightModeEnabled) throws IOException {
mAccountManagerTestRule.addAccount(PROFILE_DATA1);
CoreAccountInfo coreAccountInfo =
mAccountManagerTestRule.toCoreAccountInfo(PROFILE_DATA1.getAccountName());
// Throws a connection error during the sign-in action
doAnswer(invocation -> {
Callback<GoogleServiceAuthError> onSignInErrorCallback = invocation.getArgument(1);
onSignInErrorCallback.onResult(new GoogleServiceAuthError(State.CONNECTION_FAILED));
return null;
})
.when(mAccountPickerDelegateMock)
.signIn(eq(coreAccountInfo), any());
buildAndShowCollapsedBottomSheet();
clickContinueButtonAndWaitForErrorView();
mRenderTestRule.render(
mCoordinator.getBottomSheetViewForTesting(), "signin_general_error_sheet");
}
private void clickContinueButtonAndWaitForErrorView() { private void clickContinueButtonAndWaitForErrorView() {
View bottomSheetView = mCoordinator.getBottomSheetViewForTesting(); View bottomSheetView = mCoordinator.getBottomSheetViewForTesting();
TestThreadUtils.runOnUiThreadBlocking(() -> { TestThreadUtils.runOnUiThreadBlocking(() -> {
......
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