use of com.google.android.setupcompat.PartnerCustomizationLayout in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class FingerprintSuggestionActivityTest 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 cancelButton = layout.getMixin(FooterBarMixin.class).getSecondaryButtonView();
assertThat(cancelButton.getText().toString()).isEqualTo("Cancel");
assertThat(cancelButton.getVisibility()).named("Cancel visible").isEqualTo(View.VISIBLE);
cancelButton.performClick();
ShadowActivity shadowActivity = Shadows.shadowOf(mController.get());
assertThat(mController.get().isFinishing()).named("Is finishing").isTrue();
assertThat(shadowActivity.getResultCode()).named("Result code").isEqualTo(Activity.RESULT_CANCELED);
}
use of com.google.android.setupcompat.PartnerCustomizationLayout in project Resurrection_packages_apps_Settings by ResurrectionRemix.
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 Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SetupChooseLockPatternTest method skipButton_shouldBeVisible_duringNonFingerprintFlow.
@Test
public void skipButton_shouldBeVisible_duringNonFingerprintFlow() {
PartnerCustomizationLayout layout = mActivity.findViewById(R.id.setup_wizard_layout);
final Button skipOrClearButton = layout.getMixin(FooterBarMixin.class).getSecondaryButtonView();
assertThat(skipOrClearButton).isNotNull();
assertThat(skipOrClearButton.getVisibility()).isEqualTo(View.VISIBLE);
skipOrClearButton.performClick();
AlertDialog chooserDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
assertThat(chooserDialog).isNotNull();
}
use of com.google.android.setupcompat.PartnerCustomizationLayout in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SetupChooseLockPatternTest method createActivity_enterPattern_clearButtonShouldBeShown.
@Test
public void createActivity_enterPattern_clearButtonShouldBeShown() {
ChooseLockPatternFragment fragment = findFragment(mActivity);
PartnerCustomizationLayout layout = mActivity.findViewById(R.id.setup_wizard_layout);
final Button skipOrClearButton = layout.getMixin(FooterBarMixin.class).getSecondaryButtonView();
assertThat(skipOrClearButton.isEnabled()).isTrue();
assertThat(skipOrClearButton.getVisibility()).isEqualTo(View.VISIBLE);
assertThat(skipOrClearButton.getText()).isEqualTo(application.getString(R.string.skip_label));
enterPattern();
assertThat(skipOrClearButton.isEnabled()).isTrue();
assertThat(skipOrClearButton.getVisibility()).isEqualTo(View.VISIBLE);
assertThat(skipOrClearButton.getText()).isEqualTo(application.getString(R.string.lockpattern_retry_button_text));
}
use of com.google.android.setupcompat.PartnerCustomizationLayout in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SetupChooseLockPatternTest method clearButton_shouldBeVisible_duringRetryStage.
@Test
public void clearButton_shouldBeVisible_duringRetryStage() {
enterPattern();
PartnerCustomizationLayout layout = mActivity.findViewById(R.id.setup_wizard_layout);
final Button skipOrClearButton = layout.getMixin(FooterBarMixin.class).getSecondaryButtonView();
assertThat(skipOrClearButton.getVisibility()).isEqualTo(View.VISIBLE);
assertThat(skipOrClearButton.isEnabled()).isTrue();
skipOrClearButton.performClick();
assertThat(findFragment(mActivity).mChosenPattern).isNull();
}
Aggregations