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

Commit d961094f authored by burakov's avatar burakov
Browse files

[Dual Shade] Fix LockscreenContentViewModelTest for DualShade on.

This ensures these unit tests do not fail when Dual Shade is the default
shade experience in scene container.

Bug: 376411622
Test: Updated unit tests.
Flag: com.android.systemui.scene_container
Change-Id: I11db077dcd0b9a8a8bc87d1bfc95d6eb13caba92
parent edef3e0f
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -238,15 +238,15 @@ class LockscreenContentViewModelTest(flags: FlagsParameterization) : SysuiTestCa
        hasNotifications: Boolean = false,
        shadeLayoutWide: Boolean? = null,
    ) {
        val isShadeLayoutWide by collectLastValue(kosmos.shadeRepository.isShadeLayoutWide)
        val collectedClockSize by collectLastValue(kosmos.keyguardClockInteractor.clockSize)
        val collectedShadeMode by collectLastValue(kosmos.shadeModeInteractor.shadeMode)
        val isShadeLayoutWide by collectLastValue(shadeRepository.isShadeLayoutWide)
        val collectedClockSize by collectLastValue(keyguardClockInteractor.clockSize)
        val collectedShadeMode by collectLastValue(shadeModeInteractor.shadeMode)
        val areAnyNotificationsPresent by
            collectLastValue(kosmos.activeNotificationsInteractor.areAnyNotificationsPresent)
        when (shadeMode) {
            ShadeMode.Dual -> kosmos.enableDualShade(wideLayout = shadeLayoutWide)
            ShadeMode.Single -> kosmos.enableSingleShade()
            ShadeMode.Split -> kosmos.enableSplitShade()
            ShadeMode.Dual -> enableDualShade(wideLayout = shadeLayoutWide)
            ShadeMode.Single -> enableSingleShade()
            ShadeMode.Split -> enableSplitShade()
        }
        fakeKeyguardClockRepository.setShouldForceSmallClock(clockSize == ClockSize.SMALL)
        fakeKeyguardClockRepository.setClockSize(clockSize)
@@ -273,12 +273,12 @@ class LockscreenContentViewModelTest(flags: FlagsParameterization) : SysuiTestCa
        assertThat(areAnyNotificationsPresent).isEqualTo(hasNotifications)
    }

    private fun prepareConfiguration(): Int {
    private fun Kosmos.prepareConfiguration(): Int {
        val configuration = context.resources.configuration
        configuration.setLayoutDirection(Locale.US)
        kosmos.fakeConfigurationRepository.onConfigurationChange(configuration)
        fakeConfigurationRepository.onConfigurationChange(configuration)
        val maxTranslation = 10
        kosmos.fakeConfigurationRepository.setDimensionPixelSize(
        fakeConfigurationRepository.setDimensionPixelSize(
            R.dimen.notification_side_paddings,
            maxTranslation,
        )