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

Commit 7970a121 authored by Danny Burakov's avatar Danny Burakov
Browse files

[flexiglass] Remove setShadeLayoutWide (KeyguardBlueprintInteractorTest)

Bug: 444643845
Test: Unit test still passes.
Flag: com.android.systemui.scene_container
Change-Id: Ib6d28a1858e0ec75b20e8a803c24dd81c7fed0e4
parent edebc45c
Loading
Loading
Loading
Loading
+18 −26
Original line number Diff line number Diff line
@@ -24,42 +24,37 @@ import com.android.systemui.biometrics.data.repository.fakeFingerprintPropertyRe
import com.android.systemui.biometrics.shared.model.FingerprintSensorType
import com.android.systemui.biometrics.shared.model.SensorStrength
import com.android.systemui.common.ui.data.repository.fakeConfigurationRepository
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.flags.DisableSceneContainer
import com.android.systemui.flags.EnableSceneContainer
import com.android.systemui.keyguard.data.repository.keyguardBlueprintRepository
import com.android.systemui.keyguard.ui.view.layout.blueprints.DefaultKeyguardBlueprint
import com.android.systemui.keyguard.ui.view.layout.blueprints.SplitShadeKeyguardBlueprint
import com.android.systemui.kosmos.testScope
import com.android.systemui.shade.data.repository.shadeRepository
import com.android.systemui.kosmos.advanceUntilIdle
import com.android.systemui.kosmos.collectLastValue
import com.android.systemui.kosmos.runCurrent
import com.android.systemui.kosmos.runTest
import com.android.systemui.shade.domain.interactor.enableSingleShade
import com.android.systemui.shade.domain.interactor.enableSplitShade
import com.android.systemui.testKosmos
import com.android.systemui.util.mockito.any
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.test.advanceUntilIdle
import kotlinx.coroutines.test.runCurrent
import kotlinx.coroutines.test.runTest
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito.reset
import org.mockito.Mockito.times
import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations

@SmallTest
@RunWith(AndroidJUnit4::class)
class KeyguardBlueprintInteractorTest : SysuiTestCase() {

    private val kosmos = testKosmos()
    private val testScope = kosmos.testScope
    private val underTest by lazy { kosmos.keyguardBlueprintInteractor }
    private val keyguardBlueprintRepository by lazy { kosmos.keyguardBlueprintRepository }
    private val configurationRepository by lazy { kosmos.fakeConfigurationRepository }
    private val fingerprintPropertyRepository by lazy { kosmos.fakeFingerprintPropertyRepository }

    @Before
    fun setup() {
        MockitoAnnotations.initMocks(this)
        fingerprintPropertyRepository.setProperties(
        kosmos.fakeFingerprintPropertyRepository.setProperties(
            sensorId = 1,
            strength = SensorStrength.STRONG,
            sensorType = FingerprintSensorType.POWER_BUTTON,
@@ -69,10 +64,9 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() {

    @Test
    fun testAppliesDefaultBlueprint() {
        testScope.runTest {
        kosmos.runTest {
            val blueprintId by collectLastValue(underTest.blueprintId)
            kosmos.shadeRepository.setShadeLayoutWide(false)
            configurationRepository.onConfigurationChange()
            enableSingleShade()

            runCurrent()
            advanceUntilIdle()
@@ -83,10 +77,9 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() {
    @Test
    @DisableSceneContainer
    fun testAppliesSplitShadeBlueprint() {
        testScope.runTest {
        kosmos.runTest {
            val blueprintId by collectLastValue(underTest.blueprintId)
            kosmos.shadeRepository.setShadeLayoutWide(true)
            configurationRepository.onConfigurationChange()
            enableSplitShade()

            runCurrent()
            advanceUntilIdle()
@@ -97,10 +90,9 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() {
    @Test
    @EnableSceneContainer
    fun testDoesNotApplySplitShadeBlueprint() {
        testScope.runTest {
        kosmos.runTest {
            val blueprintId by collectLastValue(underTest.blueprintId)
            kosmos.shadeRepository.setShadeLayoutWide(true)
            configurationRepository.onConfigurationChange()
            enableSplitShade()

            runCurrent()
            advanceUntilIdle()
@@ -111,11 +103,11 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() {
    @Test
    @DisableSceneContainer
    fun fingerprintPropertyInitialized_updatesBlueprint() {
        testScope.runTest {
        kosmos.runTest {
            underTest.start()
            reset(keyguardBlueprintRepository)

            fingerprintPropertyRepository.supportsUdfps() // initialize properties
            fakeFingerprintPropertyRepository.supportsUdfps() // initialize properties

            runCurrent()
            advanceUntilIdle()
@@ -125,11 +117,11 @@ class KeyguardBlueprintInteractorTest : SysuiTestCase() {

    @Test
    fun testRefreshFromConfigChange() {
        testScope.runTest {
        kosmos.runTest {
            underTest.start()
            reset(keyguardBlueprintRepository)

            configurationRepository.onConfigurationChange()
            fakeConfigurationRepository.onConfigurationChange()

            runCurrent()
            advanceUntilIdle()