[flexiglass] Fixes failing test after coroutine lib upgrade. am: b243fe5fbf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24211453 Change-Id: If3ba6575e8ed875abab6607ad61f1c9e58add8fb Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
committed by
Automerger Merge Worker
commit
cccc240cac
@@ -89,6 +89,22 @@ class AuthenticationInteractorTest : SysuiTestCase() {
|
|||||||
utils.authenticationRepository.setLockscreenEnabled(false)
|
utils.authenticationRepository.setLockscreenEnabled(false)
|
||||||
|
|
||||||
val isUnlocked by collectLastValue(underTest.isUnlocked)
|
val isUnlocked by collectLastValue(underTest.isUnlocked)
|
||||||
|
// Toggle isUnlocked, twice.
|
||||||
|
//
|
||||||
|
// This is done because the underTest.isUnlocked flow doesn't receive values from
|
||||||
|
// just changing the state above; the actual isUnlocked state needs to change to
|
||||||
|
// cause the logic under test to "pick up" the current state again.
|
||||||
|
//
|
||||||
|
// It is done twice to make sure that we don't actually change the isUnlocked
|
||||||
|
// state from what it originally was.
|
||||||
|
utils.authenticationRepository.setUnlocked(
|
||||||
|
!utils.authenticationRepository.isUnlocked.value
|
||||||
|
)
|
||||||
|
runCurrent()
|
||||||
|
utils.authenticationRepository.setUnlocked(
|
||||||
|
!utils.authenticationRepository.isUnlocked.value
|
||||||
|
)
|
||||||
|
runCurrent()
|
||||||
assertThat(isUnlocked).isTrue()
|
assertThat(isUnlocked).isTrue()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user