Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 454be403 authored by Bryce Lee's avatar Bryce Lee
Browse files

Rename BouncerWindowBlurTestUtil to KeyguardWindowBlurTestUtil.

This changelist updates the name of BouncerWindowBlurTestUtil as it can
also be used to test other root window blurring, such as from glanceable
hub.

Test: related transition view model tests have been updated.
Flag: EXEMPT refactor
Bug: 389788272
Change-Id: I13674556474ff1563b0953d1ec7cb8d098d59598
parent 177b4e45
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ class AlternateBouncerToPrimaryBouncerTransitionViewModelTest : SysuiTestCase()
    fun notifications_areFullyVisible_whenShadeIsOpen() =
        testScope.runTest {
            val values by collectValues(underTest.notificationAlpha)
            kosmos.bouncerWindowBlurTestUtil.shadeExpanded(true)
            kosmos.keyguardWindowBlurTestUtil.shadeExpanded(true)

            keyguardTransitionRepository.sendTransitionSteps(
                listOf(
@@ -100,9 +100,9 @@ class AlternateBouncerToPrimaryBouncerTransitionViewModelTest : SysuiTestCase()
    fun blurRadiusGoesToMaximumWhenShadeIsExpanded() =
        testScope.runTest {
            val values by collectValues(underTest.windowBlurRadius)
            kosmos.bouncerWindowBlurTestUtil.shadeExpanded(true)
            kosmos.keyguardWindowBlurTestUtil.shadeExpanded(true)

            kosmos.bouncerWindowBlurTestUtil.assertTransitionToBlurRadius(
            kosmos.keyguardWindowBlurTestUtil.assertTransitionToBlurRadius(
                transitionProgress = listOf(0f, 0f, 0.1f, 0.2f, 0.3f, 1f),
                startValue = kosmos.blurConfig.maxBlurRadiusPx,
                endValue = kosmos.blurConfig.maxBlurRadiusPx,
@@ -119,9 +119,9 @@ class AlternateBouncerToPrimaryBouncerTransitionViewModelTest : SysuiTestCase()
        testScope.runTest {
            val values by collectValues(underTest.notificationBlurRadius)

            kosmos.bouncerWindowBlurTestUtil.shadeExpanded(true)
            kosmos.keyguardWindowBlurTestUtil.shadeExpanded(true)

            kosmos.bouncerWindowBlurTestUtil.assertTransitionToBlurRadius(
            kosmos.keyguardWindowBlurTestUtil.assertTransitionToBlurRadius(
                transitionProgress = listOf(0f, 0f, 0.1f, 0.2f, 0.3f, 1f),
                startValue = kosmos.blurConfig.maxBlurRadiusPx / 3.0f,
                endValue = kosmos.blurConfig.maxBlurRadiusPx / 3.0f,
@@ -135,9 +135,9 @@ class AlternateBouncerToPrimaryBouncerTransitionViewModelTest : SysuiTestCase()
    fun blurRadiusGoesFromMinToMaxWhenShadeIsNotExpanded() =
        testScope.runTest {
            val values by collectValues(underTest.windowBlurRadius)
            kosmos.bouncerWindowBlurTestUtil.shadeExpanded(false)
            kosmos.keyguardWindowBlurTestUtil.shadeExpanded(false)

            kosmos.bouncerWindowBlurTestUtil.assertTransitionToBlurRadius(
            kosmos.keyguardWindowBlurTestUtil.assertTransitionToBlurRadius(
                transitionProgress = listOf(0f, 0f, 0.1f, 0.2f, 0.3f, 1f),
                startValue = kosmos.blurConfig.minBlurRadiusPx,
                endValue = kosmos.blurConfig.maxBlurRadiusPx,
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ class AodToPrimaryBouncerTransitionViewModelTest : SysuiTestCase() {
        testScope.runTest {
            val values by collectValues(underTest.windowBlurRadius)

            kosmos.bouncerWindowBlurTestUtil.assertTransitionToBlurRadius(
            kosmos.keyguardWindowBlurTestUtil.assertTransitionToBlurRadius(
                transitionProgress = listOf(0.0f, 0.0f, 0.3f, 0.4f, 0.5f, 1.0f),
                startValue = kosmos.blurConfig.maxBlurRadiusPx,
                endValue = kosmos.blurConfig.maxBlurRadiusPx,
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ class DozingToPrimaryBouncerTransitionViewModelTest : SysuiTestCase() {
        testScope.runTest {
            val values by collectValues(underTest.windowBlurRadius)

            kosmos.bouncerWindowBlurTestUtil.assertTransitionToBlurRadius(
            kosmos.keyguardWindowBlurTestUtil.assertTransitionToBlurRadius(
                transitionProgress = listOf(0.0f, 0.2f, 0.3f, 0.65f, 0.7f, 1.0f),
                startValue = kosmos.blurConfig.minBlurRadiusPx,
                endValue = kosmos.blurConfig.maxBlurRadiusPx,
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ class GlanceableHubToPrimaryBouncerTransitionViewModelTest : SysuiTestCase() {
        testScope.runTest {
            val values by collectValues(underTest.windowBlurRadius)

            kosmos.bouncerWindowBlurTestUtil.assertTransitionToBlurRadius(
            kosmos.keyguardWindowBlurTestUtil.assertTransitionToBlurRadius(
                transitionProgress = listOf(0.0f, 0.2f, 0.3f, 0.65f, 0.7f, 1.0f),
                startValue = kosmos.blurConfig.maxBlurRadiusPx,
                endValue = kosmos.blurConfig.maxBlurRadiusPx,
+3 −3
Original line number Diff line number Diff line
@@ -33,9 +33,9 @@ import com.android.systemui.shade.shadeTestUtil
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.test.TestScope

val Kosmos.bouncerWindowBlurTestUtil by
val Kosmos.keyguardWindowBlurTestUtil by
    Kosmos.Fixture {
        BouncerWindowBlurTestUtil(
        KeyguardWindowBlurTestUtil(
            shadeTestUtil = shadeTestUtil,
            fakeKeyguardTransitionRepository = fakeKeyguardTransitionRepository,
            fakeKeyguardRepository = fakeKeyguardRepository,
@@ -43,7 +43,7 @@ val Kosmos.bouncerWindowBlurTestUtil by
        )
    }

class BouncerWindowBlurTestUtil(
class KeyguardWindowBlurTestUtil(
    private val shadeTestUtil: ShadeTestUtil,
    private val fakeKeyguardTransitionRepository: FakeKeyguardTransitionRepository,
    private val fakeKeyguardRepository: FakeKeyguardRepository,
Loading