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

Commit 50444c2a authored by David Saff's avatar David Saff
Browse files

Initial use of Kosmos in SceneTestUtils and associated tests.

This shows how we can begin to bring in Kosmos incrementally, but does not take
any particular class to the final "this is fixed" state.

Bug: 303103876
Test: ./gradlew :SystemUILib:testAospDebugUnitTest
Flag: NONE
Change-Id: If65b86ae7a02e23589a81acb4cdd0d28428201f2
parent 896c5c42
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.scene.SceneTestUtils
import com.android.systemui.scene.sceneKeys
import com.android.systemui.scene.shared.model.ObservableTransitionState
import com.android.systemui.scene.shared.model.SceneKey
import com.android.systemui.scene.shared.model.SceneModel
@@ -70,10 +71,8 @@ class SceneContainerRepositoryTest : SysuiTestCase() {

    @Test(expected = IllegalStateException::class)
    fun setDesiredScene_noSuchSceneInContainer_throws() {
        val underTest =
            utils.fakeSceneContainerRepository(
                utils.fakeSceneContainerConfig(listOf(SceneKey.QuickSettings, SceneKey.Lockscreen)),
            )
        utils.kosmos.sceneKeys = listOf(SceneKey.QuickSettings, SceneKey.Lockscreen)
        val underTest = utils.fakeSceneContainerRepository(utils.fakeSceneContainerConfig())
        underTest.setDesiredScene(SceneModel(SceneKey.Shade))
    }

+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import com.android.systemui.SysuiTestCase
import com.android.systemui.authentication.domain.model.AuthenticationMethodModel
import com.android.systemui.classifier.FalsingCollector
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.kosmos.testScope
import com.android.systemui.model.SysUiState
import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.setAsleepForTest
import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.setAwakeForTest
+1 −1
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ public class NotificationShadeWindowControllerImplTest extends SysuiTestCase {
                mTestScope.getBackgroundScope(),
                new SceneContainerRepository(
                        mTestScope.getBackgroundScope(),
                        mUtils.fakeSceneContainerConfig(mUtils.fakeSceneKeys())),
                        mUtils.fakeSceneContainerConfig()),
                powerRepository,
                mock(SceneLogger.class));

+1 −1
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@ public class QuickSettingsControllerBaseTest extends SysuiTestCase {
                mTestScope.getBackgroundScope(),
                new SceneContainerRepository(
                        mTestScope.getBackgroundScope(),
                        mUtils.fakeSceneContainerConfig(mUtils.fakeSceneKeys())),
                        mUtils.fakeSceneContainerConfig()),
                powerRepository,
                mock(SceneLogger.class));

+1 −1
Original line number Diff line number Diff line
@@ -395,7 +395,7 @@ public class BubblesTest extends SysuiTestCase {
                mTestScope.getBackgroundScope(),
                new SceneContainerRepository(
                        mTestScope.getBackgroundScope(),
                        mUtils.fakeSceneContainerConfig(mUtils.fakeSceneKeys())),
                        mUtils.fakeSceneContainerConfig()),
                powerRepository,
                mock(SceneLogger.class));

Loading