Loading packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt +5 −2 Original line number Diff line number Diff line Loading @@ -47,15 +47,16 @@ import com.android.systemui.bouncer.domain.interactor.PrimaryBouncerInteractor import com.android.systemui.bouncer.shared.constants.KeyguardBouncerConstants import com.android.systemui.classifier.FalsingA11yDelegate import com.android.systemui.classifier.FalsingCollector import com.android.systemui.deviceentry.data.repository.fakeDeviceEntryRepository import com.android.systemui.deviceentry.domain.interactor.DeviceEntryFaceAuthInteractor import com.android.systemui.deviceentry.domain.interactor.DeviceEntryInteractor import com.android.systemui.deviceentry.domain.interactor.deviceEntryInteractor import com.android.systemui.flags.FakeFeatureFlags import com.android.systemui.flags.Flags import com.android.systemui.keyboard.data.repository.FakeKeyboardRepository import com.android.systemui.keyguard.data.repository.fakeDeviceEntryFingerprintAuthRepository import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor import com.android.systemui.keyguard.domain.interactor.keyguardTransitionInteractor import com.android.systemui.keyguard.shared.model.SuccessFingerprintAuthenticationStatus import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.log.SessionTracker Loading Loading @@ -832,7 +833,9 @@ class KeyguardSecurityContainerControllerTest : SysuiTestCase() { // While listening, going from the bouncer scene to the gone scene, does dismiss the // keyguard. kosmos.fakeDeviceEntryRepository.setUnlocked(true) kosmos.fakeDeviceEntryFingerprintAuthRepository.setAuthenticationStatus( SuccessFingerprintAuthenticationStatus(0, true) ) runCurrent() fakeSceneDataSource.pause() sceneInteractor.changeScene(Scenes.Gone, "reason") Loading packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/BouncerMessageViewModelTest.kt +5 −5 Original line number Diff line number Diff line Loading @@ -122,7 +122,6 @@ class BouncerMessageViewModelTest : SysuiTestCase() { repeat(FakeAuthenticationRepository.MAX_FAILED_AUTH_TRIES_BEFORE_LOCKOUT) { bouncerInteractor.authenticate(WRONG_PIN) } assertThat(message?.isUpdateAnimated).isFalse() val lockoutEndMs = authenticationInteractor.lockoutEndTimestamp ?: 0 advanceTimeBy(lockoutEndMs - testScope.currentTime) Loading @@ -133,6 +132,7 @@ class BouncerMessageViewModelTest : SysuiTestCase() { fun lockoutMessage() = testScope.runTest { val message by collectLastValue(underTest.message) val lockoutSeconds = FakeAuthenticationRepository.LOCKOUT_DURATION_SECONDS kosmos.fakeAuthenticationRepository.setAuthenticationMethod(Pin) assertThat(kosmos.fakeAuthenticationRepository.lockoutEndTimestamp).isNull() runCurrent() Loading @@ -140,14 +140,14 @@ class BouncerMessageViewModelTest : SysuiTestCase() { repeat(FakeAuthenticationRepository.MAX_FAILED_AUTH_TRIES_BEFORE_LOCKOUT) { times -> bouncerInteractor.authenticate(WRONG_PIN) runCurrent() if (times < FakeAuthenticationRepository.MAX_FAILED_AUTH_TRIES_BEFORE_LOCKOUT - 1) { if (times == FakeAuthenticationRepository.MAX_FAILED_AUTH_TRIES_BEFORE_LOCKOUT) { assertTryAgainMessage(message?.text, lockoutSeconds) assertThat(message?.isUpdateAnimated).isFalse() } else { assertThat(message?.text).isEqualTo("Wrong PIN. Try again.") assertThat(message?.isUpdateAnimated).isTrue() } } val lockoutSeconds = FakeAuthenticationRepository.LOCKOUT_DURATION_SECONDS assertTryAgainMessage(message?.text, lockoutSeconds) assertThat(message?.isUpdateAnimated).isFalse() repeat(FakeAuthenticationRepository.LOCKOUT_DURATION_SECONDS) { time -> advanceTimeBy(1.seconds) Loading packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/PasswordBouncerViewModelTest.kt +0 −3 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import com.android.systemui.authentication.shared.model.AuthenticationMethodMode import com.android.systemui.bouncer.domain.interactor.bouncerInteractor import com.android.systemui.coroutines.collectLastValue import com.android.systemui.coroutines.collectValues import com.android.systemui.deviceentry.data.repository.fakeDeviceEntryRepository import com.android.systemui.inputmethod.data.model.InputMethodModel import com.android.systemui.inputmethod.data.repository.fakeInputMethodRepository import com.android.systemui.inputmethod.domain.interactor.inputMethodInteractor Loading Loading @@ -153,7 +152,6 @@ class PasswordBouncerViewModelTest : SysuiTestCase() { kosmos.fakeAuthenticationRepository.setAuthenticationMethod( AuthenticationMethodModel.Password ) kosmos.fakeDeviceEntryRepository.setUnlocked(false) switchToScene(Scenes.Bouncer) // No input entered. Loading Loading @@ -329,7 +327,6 @@ class PasswordBouncerViewModelTest : SysuiTestCase() { kosmos.fakeAuthenticationRepository.setAuthenticationMethod( AuthenticationMethodModel.Password ) kosmos.fakeDeviceEntryRepository.setUnlocked(false) switchToScene(Scenes.Bouncer) } Loading packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/PatternBouncerViewModelTest.kt +0 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import com.android.systemui.authentication.shared.model.AuthenticationMethodMode import com.android.systemui.authentication.shared.model.AuthenticationPatternCoordinate as Point import com.android.systemui.bouncer.domain.interactor.bouncerInteractor import com.android.systemui.coroutines.collectLastValue import com.android.systemui.deviceentry.data.repository.fakeDeviceEntryRepository import com.android.systemui.kosmos.testScope import com.android.systemui.res.R import com.android.systemui.scene.domain.interactor.sceneInteractor Loading Loading @@ -373,7 +372,6 @@ class PatternBouncerViewModelTest : SysuiTestCase() { kosmos.fakeAuthenticationRepository.setAuthenticationMethod( AuthenticationMethodModel.Pattern ) kosmos.fakeDeviceEntryRepository.setUnlocked(false) switchToScene(Scenes.Bouncer) } Loading packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/PinBouncerViewModelTest.kt +0 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import com.android.systemui.bouncer.data.repository.fakeSimBouncerRepository import com.android.systemui.bouncer.domain.interactor.bouncerInteractor import com.android.systemui.bouncer.domain.interactor.simBouncerInteractor import com.android.systemui.coroutines.collectLastValue import com.android.systemui.deviceentry.data.repository.fakeDeviceEntryRepository import com.android.systemui.kosmos.testScope import com.android.systemui.res.R import com.android.systemui.scene.domain.interactor.sceneInteractor Loading Loading @@ -387,7 +386,6 @@ class PinBouncerViewModelTest : SysuiTestCase() { private fun TestScope.lockDeviceAndOpenPinBouncer() { kosmos.fakeAuthenticationRepository.setAuthenticationMethod(AuthenticationMethodModel.Pin) kosmos.fakeDeviceEntryRepository.setUnlocked(false) switchToScene(Scenes.Bouncer) } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt +5 −2 Original line number Diff line number Diff line Loading @@ -47,15 +47,16 @@ import com.android.systemui.bouncer.domain.interactor.PrimaryBouncerInteractor import com.android.systemui.bouncer.shared.constants.KeyguardBouncerConstants import com.android.systemui.classifier.FalsingA11yDelegate import com.android.systemui.classifier.FalsingCollector import com.android.systemui.deviceentry.data.repository.fakeDeviceEntryRepository import com.android.systemui.deviceentry.domain.interactor.DeviceEntryFaceAuthInteractor import com.android.systemui.deviceentry.domain.interactor.DeviceEntryInteractor import com.android.systemui.deviceentry.domain.interactor.deviceEntryInteractor import com.android.systemui.flags.FakeFeatureFlags import com.android.systemui.flags.Flags import com.android.systemui.keyboard.data.repository.FakeKeyboardRepository import com.android.systemui.keyguard.data.repository.fakeDeviceEntryFingerprintAuthRepository import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor import com.android.systemui.keyguard.domain.interactor.keyguardTransitionInteractor import com.android.systemui.keyguard.shared.model.SuccessFingerprintAuthenticationStatus import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.log.SessionTracker Loading Loading @@ -832,7 +833,9 @@ class KeyguardSecurityContainerControllerTest : SysuiTestCase() { // While listening, going from the bouncer scene to the gone scene, does dismiss the // keyguard. kosmos.fakeDeviceEntryRepository.setUnlocked(true) kosmos.fakeDeviceEntryFingerprintAuthRepository.setAuthenticationStatus( SuccessFingerprintAuthenticationStatus(0, true) ) runCurrent() fakeSceneDataSource.pause() sceneInteractor.changeScene(Scenes.Gone, "reason") Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/BouncerMessageViewModelTest.kt +5 −5 Original line number Diff line number Diff line Loading @@ -122,7 +122,6 @@ class BouncerMessageViewModelTest : SysuiTestCase() { repeat(FakeAuthenticationRepository.MAX_FAILED_AUTH_TRIES_BEFORE_LOCKOUT) { bouncerInteractor.authenticate(WRONG_PIN) } assertThat(message?.isUpdateAnimated).isFalse() val lockoutEndMs = authenticationInteractor.lockoutEndTimestamp ?: 0 advanceTimeBy(lockoutEndMs - testScope.currentTime) Loading @@ -133,6 +132,7 @@ class BouncerMessageViewModelTest : SysuiTestCase() { fun lockoutMessage() = testScope.runTest { val message by collectLastValue(underTest.message) val lockoutSeconds = FakeAuthenticationRepository.LOCKOUT_DURATION_SECONDS kosmos.fakeAuthenticationRepository.setAuthenticationMethod(Pin) assertThat(kosmos.fakeAuthenticationRepository.lockoutEndTimestamp).isNull() runCurrent() Loading @@ -140,14 +140,14 @@ class BouncerMessageViewModelTest : SysuiTestCase() { repeat(FakeAuthenticationRepository.MAX_FAILED_AUTH_TRIES_BEFORE_LOCKOUT) { times -> bouncerInteractor.authenticate(WRONG_PIN) runCurrent() if (times < FakeAuthenticationRepository.MAX_FAILED_AUTH_TRIES_BEFORE_LOCKOUT - 1) { if (times == FakeAuthenticationRepository.MAX_FAILED_AUTH_TRIES_BEFORE_LOCKOUT) { assertTryAgainMessage(message?.text, lockoutSeconds) assertThat(message?.isUpdateAnimated).isFalse() } else { assertThat(message?.text).isEqualTo("Wrong PIN. Try again.") assertThat(message?.isUpdateAnimated).isTrue() } } val lockoutSeconds = FakeAuthenticationRepository.LOCKOUT_DURATION_SECONDS assertTryAgainMessage(message?.text, lockoutSeconds) assertThat(message?.isUpdateAnimated).isFalse() repeat(FakeAuthenticationRepository.LOCKOUT_DURATION_SECONDS) { time -> advanceTimeBy(1.seconds) Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/PasswordBouncerViewModelTest.kt +0 −3 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import com.android.systemui.authentication.shared.model.AuthenticationMethodMode import com.android.systemui.bouncer.domain.interactor.bouncerInteractor import com.android.systemui.coroutines.collectLastValue import com.android.systemui.coroutines.collectValues import com.android.systemui.deviceentry.data.repository.fakeDeviceEntryRepository import com.android.systemui.inputmethod.data.model.InputMethodModel import com.android.systemui.inputmethod.data.repository.fakeInputMethodRepository import com.android.systemui.inputmethod.domain.interactor.inputMethodInteractor Loading Loading @@ -153,7 +152,6 @@ class PasswordBouncerViewModelTest : SysuiTestCase() { kosmos.fakeAuthenticationRepository.setAuthenticationMethod( AuthenticationMethodModel.Password ) kosmos.fakeDeviceEntryRepository.setUnlocked(false) switchToScene(Scenes.Bouncer) // No input entered. Loading Loading @@ -329,7 +327,6 @@ class PasswordBouncerViewModelTest : SysuiTestCase() { kosmos.fakeAuthenticationRepository.setAuthenticationMethod( AuthenticationMethodModel.Password ) kosmos.fakeDeviceEntryRepository.setUnlocked(false) switchToScene(Scenes.Bouncer) } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/PatternBouncerViewModelTest.kt +0 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import com.android.systemui.authentication.shared.model.AuthenticationMethodMode import com.android.systemui.authentication.shared.model.AuthenticationPatternCoordinate as Point import com.android.systemui.bouncer.domain.interactor.bouncerInteractor import com.android.systemui.coroutines.collectLastValue import com.android.systemui.deviceentry.data.repository.fakeDeviceEntryRepository import com.android.systemui.kosmos.testScope import com.android.systemui.res.R import com.android.systemui.scene.domain.interactor.sceneInteractor Loading Loading @@ -373,7 +372,6 @@ class PatternBouncerViewModelTest : SysuiTestCase() { kosmos.fakeAuthenticationRepository.setAuthenticationMethod( AuthenticationMethodModel.Pattern ) kosmos.fakeDeviceEntryRepository.setUnlocked(false) switchToScene(Scenes.Bouncer) } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/PinBouncerViewModelTest.kt +0 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import com.android.systemui.bouncer.data.repository.fakeSimBouncerRepository import com.android.systemui.bouncer.domain.interactor.bouncerInteractor import com.android.systemui.bouncer.domain.interactor.simBouncerInteractor import com.android.systemui.coroutines.collectLastValue import com.android.systemui.deviceentry.data.repository.fakeDeviceEntryRepository import com.android.systemui.kosmos.testScope import com.android.systemui.res.R import com.android.systemui.scene.domain.interactor.sceneInteractor Loading Loading @@ -387,7 +386,6 @@ class PinBouncerViewModelTest : SysuiTestCase() { private fun TestScope.lockDeviceAndOpenPinBouncer() { kosmos.fakeAuthenticationRepository.setAuthenticationMethod(AuthenticationMethodModel.Pin) kosmos.fakeDeviceEntryRepository.setUnlocked(false) switchToScene(Scenes.Bouncer) } Loading