use of org.robolectric.shadows.ShadowActivity in project platform_packages_apps_Settings by BlissRoms.
the class FingerprintEnrollFindSensorTest method layoutWithoutAnimation_shouldNotCrash.
// Use a non-default resource qualifier to load the test layout in
// robotests/res/layout-mcc999/fingerprint_enroll_find_sensor. This layout is a copy of the
// regular find sensor layout, with the animation removed.
@Config(qualifiers = "mcc999")
@Test
public void layoutWithoutAnimation_shouldNotCrash() {
EnrollmentCallback enrollmentCallback = verifyAndCaptureEnrollmentCallback();
enrollmentCallback.onEnrollmentProgress(123);
enrollmentCallback.onEnrollmentError(FingerprintManager.FINGERPRINT_ERROR_CANCELED, "test");
ShadowActivity shadowActivity = Shadows.shadowOf(mActivity);
IntentForResult startedActivity = shadowActivity.getNextStartedActivityForResult();
assertThat(startedActivity).named("Next activity").isNotNull();
assertThat(startedActivity.intent.getComponent()).isEqualTo(new ComponentName(application, FingerprintEnrollEnrolling.class));
}
use of org.robolectric.shadows.ShadowActivity in project platform_packages_apps_Settings by BlissRoms.
the class SetupFingerprintEnrollIntroductionTest method testCancelClicked_shouldNotSetIntentDataIfLockScreenPresentBeforeLaunch.
@Test
public void testCancelClicked_shouldNotSetIntentDataIfLockScreenPresentBeforeLaunch() {
getShadowKeyguardManager().setIsKeyguardSecure(true);
SetupFingerprintEnrollIntroduction activity = mController.create().resume().get();
final Button skipButton = activity.findViewById(R.id.fingerprint_cancel_button);
skipButton.performClick();
ShadowActivity shadowActivity = Shadows.shadowOf(activity);
assertThat(shadowActivity.getResultIntent()).isNull();
}
use of org.robolectric.shadows.ShadowActivity in project platform_packages_apps_Settings by BlissRoms.
the class SetupFingerprintEnrollIntroductionTest method testBackKeyPress_shouldSetIntentDataIfLockScreenAdded.
@Test
public void testBackKeyPress_shouldSetIntentDataIfLockScreenAdded() {
getShadowKeyguardManager().setIsKeyguardSecure(false);
mController.create().resume();
getShadowKeyguardManager().setIsKeyguardSecure(true);
SetupFingerprintEnrollIntroduction activity = mController.get();
activity.onBackPressed();
ShadowActivity shadowActivity = Shadows.shadowOf(activity);
assertThat(shadowActivity.getResultIntent()).isNotNull();
assertThat(shadowActivity.getResultIntent().hasExtra(SetupChooseLockGenericFragment.EXTRA_PASSWORD_QUALITY)).isTrue();
}
use of org.robolectric.shadows.ShadowActivity in project platform_packages_apps_Settings by BlissRoms.
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 in project platform_packages_apps_Settings by BlissRoms.
the class SetupFingerprintEnrollIntroductionTest method testBackKeyPress_shouldNotSetIntentDataIfLockScreenPresentBeforeLaunch.
@Test
public void testBackKeyPress_shouldNotSetIntentDataIfLockScreenPresentBeforeLaunch() {
getShadowKeyguardManager().setIsKeyguardSecure(true);
mController.create().resume();
SetupFingerprintEnrollIntroduction activity = mController.get();
activity.onBackPressed();
ShadowActivity shadowActivity = Shadows.shadowOf(activity);
assertThat(shadowActivity.getResultIntent()).isNull();
}
Aggregations