Loading packages/SystemUI/tests/src/com/android/systemui/broadcast/BroadcastDispatcherTest.kt +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import java.util.concurrent.Executor import junit.framework.Assert.assertSame import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch import kotlinx.coroutines.test.advanceUntilIdle import kotlinx.coroutines.test.runBlockingTest import org.junit.Before import org.junit.Test Loading packages/SystemUI/tests/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModelTest.kt +20 −2 Original line number Diff line number Diff line Loading @@ -47,7 +47,11 @@ import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.launch import kotlinx.coroutines.test.runBlockingTest import kotlinx.coroutines.test.TestCoroutineScheduler import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.UnconfinedTestDispatcher import kotlinx.coroutines.test.advanceUntilIdle import kotlinx.coroutines.test.runTest import org.junit.Before import org.junit.Test import org.junit.runner.RunWith Loading @@ -59,6 +63,7 @@ import org.mockito.Mockito.`when` as whenever @RunWithLooper class FooterActionsViewModelTest : SysuiTestCase() { private lateinit var utils: FooterActionsTestUtils private val testDispatcher = UnconfinedTestDispatcher(TestCoroutineScheduler()) @Before fun setUp() { Loading Loading @@ -130,6 +135,7 @@ class FooterActionsViewModelTest : SysuiTestCase() { showPowerButton = false, footerActionsInteractor = utils.footerActionsInteractor( bgDispatcher = testDispatcher, userSwitcherRepository = utils.userSwitcherRepository( userTracker = userTracker, Loading @@ -137,6 +143,7 @@ class FooterActionsViewModelTest : SysuiTestCase() { userManager = userManager, userInfoController = userInfoController, userSwitcherController = userSwitcherControllerWrapper.controller, bgDispatcher = testDispatcher, ), ) ) Loading Loading @@ -217,9 +224,11 @@ class FooterActionsViewModelTest : SysuiTestCase() { footerActionsInteractor = utils.footerActionsInteractor( qsSecurityFooterUtils = qsSecurityFooterUtils, bgDispatcher = testDispatcher, securityRepository = utils.securityRepository( securityController = securityController, bgDispatcher = testDispatcher, ), ), ) Loading Loading @@ -288,9 +297,14 @@ class FooterActionsViewModelTest : SysuiTestCase() { footerActionsInteractor = utils.footerActionsInteractor( qsSecurityFooterUtils = qsSecurityFooterUtils, securityRepository = utils.securityRepository(securityController), securityRepository = utils.securityRepository( securityController, bgDispatcher = testDispatcher, ), foregroundServicesRepository = utils.foregroundServicesRepository(fgsManagerController), bgDispatcher = testDispatcher, ), ) Loading Loading @@ -376,6 +390,7 @@ class FooterActionsViewModelTest : SysuiTestCase() { utils.footerActionsInteractor( qsSecurityFooterUtils = qsSecurityFooterUtils, broadcastDispatcher = broadcastDispatcher, bgDispatcher = testDispatcher, ), ) Loading @@ -400,4 +415,7 @@ class FooterActionsViewModelTest : SysuiTestCase() { underTest.onVisibilityChangeRequested(visible = true) assertThat(underTest.isVisible.value).isTrue() } private fun runBlockingTest(block: suspend TestScope.() -> Unit) = runTest(testDispatcher) { block() } } packages/SystemUI/tests/src/com/android/systemui/user/domain/interactor/UserInteractorRefactoredTest.kt +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.runBlocking import kotlinx.coroutines.test.advanceUntilIdle import org.junit.Before import org.junit.Test import org.junit.runner.RunWith Loading Loading
packages/SystemUI/tests/src/com/android/systemui/broadcast/BroadcastDispatcherTest.kt +1 −0 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import java.util.concurrent.Executor import junit.framework.Assert.assertSame import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch import kotlinx.coroutines.test.advanceUntilIdle import kotlinx.coroutines.test.runBlockingTest import org.junit.Before import org.junit.Test Loading
packages/SystemUI/tests/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModelTest.kt +20 −2 Original line number Diff line number Diff line Loading @@ -47,7 +47,11 @@ import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.launch import kotlinx.coroutines.test.runBlockingTest import kotlinx.coroutines.test.TestCoroutineScheduler import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.UnconfinedTestDispatcher import kotlinx.coroutines.test.advanceUntilIdle import kotlinx.coroutines.test.runTest import org.junit.Before import org.junit.Test import org.junit.runner.RunWith Loading @@ -59,6 +63,7 @@ import org.mockito.Mockito.`when` as whenever @RunWithLooper class FooterActionsViewModelTest : SysuiTestCase() { private lateinit var utils: FooterActionsTestUtils private val testDispatcher = UnconfinedTestDispatcher(TestCoroutineScheduler()) @Before fun setUp() { Loading Loading @@ -130,6 +135,7 @@ class FooterActionsViewModelTest : SysuiTestCase() { showPowerButton = false, footerActionsInteractor = utils.footerActionsInteractor( bgDispatcher = testDispatcher, userSwitcherRepository = utils.userSwitcherRepository( userTracker = userTracker, Loading @@ -137,6 +143,7 @@ class FooterActionsViewModelTest : SysuiTestCase() { userManager = userManager, userInfoController = userInfoController, userSwitcherController = userSwitcherControllerWrapper.controller, bgDispatcher = testDispatcher, ), ) ) Loading Loading @@ -217,9 +224,11 @@ class FooterActionsViewModelTest : SysuiTestCase() { footerActionsInteractor = utils.footerActionsInteractor( qsSecurityFooterUtils = qsSecurityFooterUtils, bgDispatcher = testDispatcher, securityRepository = utils.securityRepository( securityController = securityController, bgDispatcher = testDispatcher, ), ), ) Loading Loading @@ -288,9 +297,14 @@ class FooterActionsViewModelTest : SysuiTestCase() { footerActionsInteractor = utils.footerActionsInteractor( qsSecurityFooterUtils = qsSecurityFooterUtils, securityRepository = utils.securityRepository(securityController), securityRepository = utils.securityRepository( securityController, bgDispatcher = testDispatcher, ), foregroundServicesRepository = utils.foregroundServicesRepository(fgsManagerController), bgDispatcher = testDispatcher, ), ) Loading Loading @@ -376,6 +390,7 @@ class FooterActionsViewModelTest : SysuiTestCase() { utils.footerActionsInteractor( qsSecurityFooterUtils = qsSecurityFooterUtils, broadcastDispatcher = broadcastDispatcher, bgDispatcher = testDispatcher, ), ) Loading @@ -400,4 +415,7 @@ class FooterActionsViewModelTest : SysuiTestCase() { underTest.onVisibilityChangeRequested(visible = true) assertThat(underTest.isVisible.value).isTrue() } private fun runBlockingTest(block: suspend TestScope.() -> Unit) = runTest(testDispatcher) { block() } }
packages/SystemUI/tests/src/com/android/systemui/user/domain/interactor/UserInteractorRefactoredTest.kt +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.runBlocking import kotlinx.coroutines.test.advanceUntilIdle import org.junit.Before import org.junit.Test import org.junit.runner.RunWith Loading