use of com.google.android.setupcompat.PartnerCustomizationLayout in project android_packages_apps_Settings by omnirom.
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();
assertWithMessage("Skip visible").that(skipButton.getVisibility()).isEqualTo(View.VISIBLE);
skipButton.performClick();
ShadowActivity shadowActivity = Shadows.shadowOf(mController.get());
assertWithMessage("Is finishing").that(mController.get().isFinishing()).isTrue();
assertWithMessage("Result code").that(shadowActivity.getResultCode()).isEqualTo(SetupSkipDialog.RESULT_SKIP);
}
use of com.google.android.setupcompat.PartnerCustomizationLayout in project android_packages_apps_Settings by omnirom.
the class SetupFingerprintEnrollIntroductionTest method testCancelClicked_shouldNotSetIntentDataIfLockScreenPresentBeforeLaunch.
@Test
public void testCancelClicked_shouldNotSetIntentDataIfLockScreenPresentBeforeLaunch() {
getShadowKeyguardManager().setIsKeyguardSecure(true);
SetupFingerprintEnrollIntroduction activity = mController.create().resume().get();
PartnerCustomizationLayout layout = activity.findViewById(R.id.setup_wizard_layout);
final Button skipButton = layout.getMixin(FooterBarMixin.class).getSecondaryButtonView();
skipButton.performClick();
assertThat(Shadows.shadowOf(activity).getResultIntent()).isNull();
}
use of com.google.android.setupcompat.PartnerCustomizationLayout in project android_packages_apps_Settings by omnirom.
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 android_packages_apps_Settings by omnirom.
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 android_packages_apps_Settings by omnirom.
the class FingerprintEnrollFindSensorTest method clickSkip_shouldReturnResultSkip.
@Test
public void clickSkip_shouldReturnResultSkip() {
PartnerCustomizationLayout layout = mActivity.findViewById(R.id.setup_wizard_layout);
layout.getMixin(FooterBarMixin.class).getSecondaryButtonView().performClick();
ShadowActivity shadowActivity = Shadows.shadowOf(mActivity);
assertWithMessage("result code").that(shadowActivity.getResultCode()).isEqualTo(BiometricEnrollBase.RESULT_SKIP);
}
Aggregations