use of org.robolectric.shadows.ShadowActivity.IntentForResult in project android_packages_apps_Settings by SudaMod.
the class SetupFingerprintEnrollIntroductionTest method testLockPattern.
@Test
public void testLockPattern() {
ShadowStorageManagerWrapper.sIsFileEncrypted = false;
mController.create().postCreate(null).resume();
SetupFingerprintEnrollIntroduction activity = mController.get();
final Button nextButton = activity.findViewById(R.id.fingerprint_next_button);
nextButton.performClick();
ShadowActivity shadowActivity = Shadows.shadowOf(activity);
IntentForResult startedActivity = shadowActivity.getNextStartedActivityForResult();
assertThat(startedActivity).isNotNull();
assertThat(startedActivity.intent.hasExtra(SetupChooseLockGenericFragment.EXTRA_PASSWORD_QUALITY)).isFalse();
}
use of org.robolectric.shadows.ShadowActivity.IntentForResult in project android_packages_apps_Settings by SudaMod.
the class ChooseLockSettingsHelperTest method testLaunchConfirmationActivity_internal_shouldPropagateTheme.
@Test
public void testLaunchConfirmationActivity_internal_shouldPropagateTheme() {
Intent intent = new Intent().putExtra(WizardManagerHelper.EXTRA_THEME, WizardManagerHelper.THEME_GLIF_V2);
Activity activity = Robolectric.buildActivity(Activity.class).withIntent(intent).get();
ChooseLockSettingsHelper helper = getChooseLockSettingsHelper(activity);
helper.launchConfirmationActivity(123, "test title", true, 0);
ShadowActivity shadowActivity = Shadows.shadowOf(activity);
IntentForResult startedActivity = shadowActivity.getNextStartedActivityForResult();
assertThat(startedActivity.requestCode).isEqualTo(123);
assertThat(startedActivity.intent.getStringExtra(WizardManagerHelper.EXTRA_THEME)).isEqualTo(WizardManagerHelper.THEME_GLIF_V2);
}
use of org.robolectric.shadows.ShadowActivity.IntentForResult in project platform_packages_apps_Settings by BlissRoms.
the class ChooseLockSettingsHelperTest method testLaunchConfirmationActivity_internal_shouldPropagateTheme.
@Test
public void testLaunchConfirmationActivity_internal_shouldPropagateTheme() {
Intent intent = new Intent().putExtra(WizardManagerHelper.EXTRA_THEME, WizardManagerHelper.THEME_GLIF_V2);
Activity activity = Robolectric.buildActivity(Activity.class).withIntent(intent).get();
ChooseLockSettingsHelper helper = getChooseLockSettingsHelper(activity);
helper.launchConfirmationActivity(123, "test title", true, 0);
ShadowActivity shadowActivity = Shadows.shadowOf(activity);
IntentForResult startedActivity = shadowActivity.getNextStartedActivityForResult();
assertThat(startedActivity.requestCode).isEqualTo(123);
assertThat(startedActivity.intent.getStringExtra(WizardManagerHelper.EXTRA_THEME)).isEqualTo(WizardManagerHelper.THEME_GLIF_V2);
}
use of org.robolectric.shadows.ShadowActivity.IntentForResult 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();
}
use of org.robolectric.shadows.ShadowActivity.IntentForResult in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class FingerprintEnrollFindSensorTest method enrollFingerprintTwice_shouldStartOneEnrolling.
@Test
public void enrollFingerprintTwice_shouldStartOneEnrolling() {
EnrollmentCallback enrollmentCallback = verifyAndCaptureEnrollmentCallback();
enrollmentCallback.onEnrollmentProgress(123);
// A second enroll should be a no-op
enrollmentCallback.onEnrollmentProgress(123);
ShadowActivity shadowActivity = Shadows.shadowOf(mActivity);
IntentForResult startedActivity = shadowActivity.getNextStartedActivityForResult();
assertThat(startedActivity).named("Next activity 1").isNotNull();
assertThat(startedActivity.intent.getComponent()).isEqualTo(new ComponentName(application, FingerprintEnrollEnrolling.class));
// Should only start one next activity
assertThat(shadowActivity.getNextStartedActivityForResult()).named("Next activity 2").isNull();
}
Aggregations