summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2023-07-26 14:58:48 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-07-26 14:58:48 +0000
commit3a01fab3a2512bd28537e43cd275881c6abb5898 (patch)
tree01f2f756c4b0103e2cf27313fde5de8982361812
parente42bb99a90147ef9cfe7bb802602d0222162bde4 (diff)
parentcd2676756650066861218b03b3a0200640cfecc4 (diff)
Merge "[flexiglass] Fixes failing test after coroutine lib upgrade." into main
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt16
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/SystemUI/tests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt
index a6ad4b24b63d..a86937fcad3c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt
@@ -89,6 +89,22 @@ class AuthenticationInteractorTest : SysuiTestCase() {
utils.authenticationRepository.setLockscreenEnabled(false)
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()
}