use of com.google.android.setupcompat.PartnerCustomizationLayout in project Resurrection_packages_apps_Settings by ResurrectionRemix.
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.google.android.setupcompat.PartnerCustomizationLayout in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SetupFingerprintEnrollIntroductionTest method testKeyguardNotSecure_shouldFinishWithSetupSkipDialogResultSkip.
@Test
public void testKeyguardNotSecure_shouldFinishWithSetupSkipDialogResultSkip() {
getShadowKeyguardManager().setIsKeyguardSecure(false);
mController.create().resume();
PartnerCustomizationLayout layout = mController.get().findViewById(R.id.setup_wizard_layout);
final Button skipButton = layout.getMixin(FooterBarMixin.class).getSecondaryButtonView();
assertThat(skipButton.getVisibility()).named("Skip visible").isEqualTo(View.VISIBLE);
skipButton.performClick();
ShadowActivity shadowActivity = Shadows.shadowOf(mController.get());
assertThat(mController.get().isFinishing()).named("Is finishing").isTrue();
assertThat(shadowActivity.getResultCode()).named("Result code").isEqualTo(SetupSkipDialog.RESULT_SKIP);
}
use of com.google.android.setupcompat.PartnerCustomizationLayout in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SetupFingerprintEnrollIntroductionTest method testKeyguardSecure_shouldFinishWithFingerprintResultSkip.
@Test
public void testKeyguardSecure_shouldFinishWithFingerprintResultSkip() {
getShadowKeyguardManager().setIsKeyguardSecure(true);
mController.create().resume();
PartnerCustomizationLayout layout = mController.get().findViewById(R.id.setup_wizard_layout);
final Button skipButton = layout.getMixin(FooterBarMixin.class).getSecondaryButtonView();
assertThat(skipButton.getVisibility()).named("Skip visible").isEqualTo(View.VISIBLE);
skipButton.performClick();
ShadowActivity shadowActivity = Shadows.shadowOf(mController.get());
assertThat(mController.get().isFinishing()).named("Is finishing").isTrue();
assertThat(shadowActivity.getResultCode()).named("Result code").isEqualTo(BiometricEnrollBase.RESULT_SKIP);
}
use of com.google.android.setupcompat.PartnerCustomizationLayout in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SetupFingerprintEnrollIntroductionTest method testCancelClicked_shouldSetIntentDataIfLockScreenAdded.
@Test
public void testCancelClicked_shouldSetIntentDataIfLockScreenAdded() {
getShadowKeyguardManager().setIsKeyguardSecure(false);
SetupFingerprintEnrollIntroduction activity = mController.create().resume().get();
PartnerCustomizationLayout layout = activity.findViewById(R.id.setup_wizard_layout);
final Button skipButton = layout.getMixin(FooterBarMixin.class).getSecondaryButtonView();
getShadowKeyguardManager().setIsKeyguardSecure(true);
skipButton.performClick();
ShadowActivity shadowActivity = Shadows.shadowOf(activity);
assertThat(shadowActivity.getResultIntent()).isNotNull();
assertThat(shadowActivity.getResultIntent().hasExtra(SetupChooseLockGenericFragment.EXTRA_PASSWORD_QUALITY)).isTrue();
}
use of com.google.android.setupcompat.PartnerCustomizationLayout in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SetupFingerprintEnrollIntroductionTest method testLockPattern.
@Test
public void testLockPattern() {
ShadowStorageManager.setIsFileEncryptedNativeOrEmulated(false);
mController.create().postCreate(null).resume();
SetupFingerprintEnrollIntroduction activity = mController.get();
PartnerCustomizationLayout layout = activity.findViewById(R.id.setup_wizard_layout);
layout.getMixin(FooterBarMixin.class).getPrimaryButtonView().performClick();
ShadowActivity shadowActivity = Shadows.shadowOf(activity);
IntentForResult startedActivity = shadowActivity.getNextStartedActivityForResult();
assertThat(startedActivity).isNotNull();
assertThat(startedActivity.intent.hasExtra(SetupChooseLockGenericFragment.EXTRA_PASSWORD_QUALITY)).isFalse();
}
Aggregations