Fixes failing test after coroutine lib upgrade.

The changed test case started failing after the coroutines library has
been upgraded; not sure why.

This fixes it by making sure that we call runCurrent() right before we
run the rest of the test to let the logic in the init block of the class
under test do its thing and register a broadcast receiver through its
callback-like flow.

Bug: 292807808
Test: N/A
Change-Id: Ifdc470e3350e36f616ce89e2185e855389b7547d
Merged-In: Ifdc470e3350e36f616ce89e2185e855389b7547d
(cherry picked from commit ba4953a76b)
This commit is contained in:
Alejandro Nijamkin
2023-07-26 17:13:29 -07:00
committed by Colin Cross
parent e502678bd1
commit 67e625de41

View File

@@ -633,6 +633,7 @@ class UserInteractorTest : SysuiTestCase() {
val userInfos = createUserInfos(count = 2, includeGuest = false)
userRepository.setUserInfos(userInfos)
userRepository.setSelectedUserInfo(userInfos[0])
runCurrent()
val refreshUsersCallCount = userRepository.refreshUsersCallCount
fakeBroadcastDispatcher.registeredReceivers.forEach {
@@ -653,6 +654,7 @@ class UserInteractorTest : SysuiTestCase() {
val userInfos = createUserInfos(count = 2, includeGuest = false)
userRepository.setUserInfos(userInfos)
userRepository.setSelectedUserInfo(userInfos[0])
runCurrent()
val refreshUsersCallCount = userRepository.refreshUsersCallCount
fakeBroadcastDispatcher.registeredReceivers.forEach {