use of com.android.settings.testutils.shadow.ShadowAlertDialogCompat in project android_packages_apps_Settings by AOSPA.
the class SetupSkipDialogTest method dialogMessage_whenSkipPasswordSetupForFace_shouldShownCorrectly.
@Test
public void dialogMessage_whenSkipPasswordSetupForFace_shouldShownCorrectly() {
SetupSkipDialog setupSkipDialog = SetupSkipDialog.newInstance(true, false, true, false, true, false);
setupSkipDialog.show(mActivity.getSupportFragmentManager());
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(shadowAlertDialog.getTitle()).isEqualTo(mActivity.getString(R.string.lock_screen_password_skip_face_title));
assertThat(shadowAlertDialog.getMessage()).isEqualTo(mActivity.getString(R.string.lock_screen_password_skip_face_message));
}
use of com.android.settings.testutils.shadow.ShadowAlertDialogCompat in project android_packages_apps_Settings by AOSPA.
the class SetupSkipDialogTest method dialogMessage_whenSkipPinSetupForFingerprint_shouldShownCorrectly.
@Test
public void dialogMessage_whenSkipPinSetupForFingerprint_shouldShownCorrectly() {
SetupSkipDialog setupSkipDialog = SetupSkipDialog.newInstance(true, false, false, true, false, false);
setupSkipDialog.show(mActivity.getSupportFragmentManager());
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(shadowAlertDialog.getTitle()).isEqualTo(mActivity.getString(R.string.lock_screen_pin_skip_fingerprint_title));
assertThat(shadowAlertDialog.getMessage()).isEqualTo(mActivity.getString(R.string.lock_screen_pin_skip_fingerprint_message));
}
use of com.android.settings.testutils.shadow.ShadowAlertDialogCompat in project android_packages_apps_Settings by AOSPA.
the class ChooseLockTypeDialogFragmentTest method testThat_OnClickListener_IsCalled.
@Test
public void testThat_OnClickListener_IsCalled() {
mFragment.mDelegate = mock(OnLockTypeSelectedListener.class);
AlertDialog lockDialog = startLockFragment();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(lockDialog);
shadowAlertDialog.clickOnItem(0);
verify(mFragment.mDelegate, times(1)).onLockTypeSelected(any(ScreenLockType.class));
}
use of com.android.settings.testutils.shadow.ShadowAlertDialogCompat in project android_packages_apps_Settings by AOSPA.
the class SetupFingerprintEnrollFindSensorTest method fingerprintEnroll_showsAlert_whenClickingSkip.
@Test
public void fingerprintEnroll_showsAlert_whenClickingSkip() {
final Intent intent = new Intent().putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, new byte[0]);
final SetupFingerprintEnrollFindSensor activity = Robolectric.buildActivity(SetupFingerprintEnrollFindSensor.class, intent).setup().get();
PartnerCustomizationLayout layout = activity.findViewById(R.id.setup_wizard_layout);
layout.getMixin(FooterBarMixin.class).getSecondaryButtonView().performClick();
final AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull();
final ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
final int titleRes = R.string.setup_fingerprint_enroll_skip_title;
assertThat(application.getString(titleRes)).isEqualTo(shadowAlertDialog.getTitle());
}
use of com.android.settings.testutils.shadow.ShadowAlertDialogCompat in project android_packages_apps_Settings by AOSPA.
the class NetworkRequestErrorDialogFragmentTest method display_shouldShowTimeoutDialog.
@Test
public void display_shouldShowTimeoutDialog() {
AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(alertDialog).isNotNull();
assertThat(alertDialog.isShowing()).isTrue();
ShadowAlertDialogCompat shadowAlertDialog = ShadowAlertDialogCompat.shadowOf(alertDialog);
assertThat(RuntimeEnvironment.application.getString(R.string.network_connection_timeout_dialog_message)).isEqualTo(shadowAlertDialog.getMessage());
}
Aggregations