From ba4953a76bac596c6b80757b24ad1179873fe868 Mon Sep 17 00:00:00 2001 From: Alejandro Nijamkin Date: Wed, 26 Jul 2023 17:13:29 -0700 Subject: 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 --- .../com/android/systemui/user/domain/interactor/UserInteractorTest.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/SystemUI/tests/src/com/android/systemui/user/domain/interactor/UserInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/user/domain/interactor/UserInteractorTest.kt index 5b418eddc4f5..5a54aff72af4 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/user/domain/interactor/UserInteractorTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/user/domain/interactor/UserInteractorTest.kt @@ -692,6 +692,7 @@ class UserInteractorTest : SysuiTestCase() { val userInfos = createUserInfos(count = 2, includeGuest = false) userRepository.setUserInfos(userInfos) userRepository.setSelectedUserInfo(userInfos[0]) + runCurrent() val refreshUsersCallCount = userRepository.refreshUsersCallCount fakeBroadcastDispatcher.sendIntentToMatchingReceiversOnly( @@ -712,6 +713,7 @@ class UserInteractorTest : SysuiTestCase() { val userInfos = createUserInfos(count = 2, includeGuest = false) userRepository.setUserInfos(userInfos) userRepository.setSelectedUserInfo(userInfos[0]) + runCurrent() val refreshUsersCallCount = userRepository.refreshUsersCallCount fakeBroadcastDispatcher.sendIntentToMatchingReceiversOnly( -- cgit v1.2.3-59-g8ed1b