Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardBouncerViewModel.kt +1 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ constructor( /** Observe whether we should update fps is showing. */ val shouldUpdateSideFps: Flow<Unit> = merge( interactor.startingToHide, interactor.hide, interactor.show, interactor.startingDisappearAnimation.filterNotNull().map {} ) Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardBouncerViewModelTest.kt +13 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ class KeyguardBouncerViewModelTest : SysuiTestCase() { } @Test fun shouldUpdateSideFps() = runTest { fun shouldUpdateSideFps_show() = runTest { var count = 0 val job = underTest.shouldUpdateSideFps.onEach { count++ }.launchIn(this) repository.setPrimaryShow(true) Loading @@ -103,6 +103,18 @@ class KeyguardBouncerViewModelTest : SysuiTestCase() { job.cancel() } @Test fun shouldUpdateSideFps_hide() = runTest { repository.setPrimaryShow(true) var count = 0 val job = underTest.shouldUpdateSideFps.onEach { count++ }.launchIn(this) repository.setPrimaryShow(false) // Run the tasks that are pending at this point of virtual time. runCurrent() assertThat(count).isEqualTo(1) job.cancel() } @Test fun sideFpsShowing() = runTest { var sideFpsIsShowing = false Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardBouncerViewModel.kt +1 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ constructor( /** Observe whether we should update fps is showing. */ val shouldUpdateSideFps: Flow<Unit> = merge( interactor.startingToHide, interactor.hide, interactor.show, interactor.startingDisappearAnimation.filterNotNull().map {} ) Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardBouncerViewModelTest.kt +13 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ class KeyguardBouncerViewModelTest : SysuiTestCase() { } @Test fun shouldUpdateSideFps() = runTest { fun shouldUpdateSideFps_show() = runTest { var count = 0 val job = underTest.shouldUpdateSideFps.onEach { count++ }.launchIn(this) repository.setPrimaryShow(true) Loading @@ -103,6 +103,18 @@ class KeyguardBouncerViewModelTest : SysuiTestCase() { job.cancel() } @Test fun shouldUpdateSideFps_hide() = runTest { repository.setPrimaryShow(true) var count = 0 val job = underTest.shouldUpdateSideFps.onEach { count++ }.launchIn(this) repository.setPrimaryShow(false) // Run the tasks that are pending at this point of virtual time. runCurrent() assertThat(count).isEqualTo(1) job.cancel() } @Test fun sideFpsShowing() = runTest { var sideFpsIsShowing = false Loading