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

Commit 9a787fc5 authored by Ebru Kurnaz's avatar Ebru Kurnaz
Browse files

Fix DisplayRepositoryTest by enabling all flags needed for sys decor wm callback.

Bug: 422773333
Test: atest DisplayRepositoryTest
Flag: EXEMPT test only
Change-Id: I30ab91107cf9b8e3dc94aedcf6cc8d3c48c0fc0a
parent 6a96ac83
Loading
Loading
Loading
Loading
+41 −10
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import androidx.test.filters.SmallTest
import com.android.app.displaylib.DisplayDecorationListener
import com.android.app.displaylib.DisplayRepository.PendingDisplay
import com.android.app.displaylib.DisplaysWithDecorationsRepositoryCompat
import com.android.server.display.feature.flags.Flags.FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT
import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.FlowValue
import com.android.systemui.coroutines.collectLastValue
@@ -651,7 +652,10 @@ class DisplayRepositoryTest : SysuiTestCase() {
    }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM)
    @EnableFlags(
        Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM,
        FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT,
    )
    fun displayIdsWithSystemDecorations_withWmCallback_systemDecorationAdded_emitsIncludingNewDisplayIds() =
        testScope.runTest {
            setDisplays(0)
@@ -667,7 +671,10 @@ class DisplayRepositoryTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM)
    @EnableFlags(
        Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM,
        FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT,
    )
    fun displayIdsWithSystemDecorations_withWmCallback_systemDecorationAdded_emitsToNewSubscribers() =
        testScope.runTest {
            setDisplays(0)
@@ -685,7 +692,10 @@ class DisplayRepositoryTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM)
    @EnableFlags(
        Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM,
        FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT,
    )
    fun displayIdsWithSystemDecorations_withWmCallback_systemDecorationAdded_doesNotEmitRemovedDisplayId() =
        testScope.runTest {
            val lastDisplayIdsWithSystemDecorations by
@@ -700,7 +710,10 @@ class DisplayRepositoryTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM)
    @EnableFlags(
        Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM,
        FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT,
    )
    fun displayIdsWithSystemDecorations_withWmCallback_systemDecorationsRemoved_nonExistentDisplay_noEffect() =
        testScope.runTest {
            val lastDisplayIdsWithSystemDecorations by
@@ -714,7 +727,10 @@ class DisplayRepositoryTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM)
    @EnableFlags(
        Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM,
        FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT,
    )
    fun displayIdsWithSystemDecorations_withWmCallback_displayRemoved_doesNotEmitRemovedDisplayId() =
        testScope.runTest {
            val lastDisplayIdsWithSystemDecorations by
@@ -730,7 +746,10 @@ class DisplayRepositoryTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM)
    @EnableFlags(
        Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM,
        FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT,
    )
    fun displayIdsWithSystemDecorations_withWmCallback_displayRemoved_nonExistentDisplay_noEffect() =
        testScope.runTest {
            val lastDisplayIdsWithSystemDecorations by
@@ -745,7 +764,10 @@ class DisplayRepositoryTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM)
    @EnableFlags(
        Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM,
        FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT,
    )
    fun displaysWithSystemDecorationsCompat_registerListener_notifyAddSystemDecor() =
        testScope.runTest {
            val listener = mock<DisplayDecorationListener>()
@@ -758,7 +780,10 @@ class DisplayRepositoryTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM)
    @EnableFlags(
        Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM,
        FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT,
    )
    fun displaysWithSystemDecorationsCompat_registerListener_notifyInitialDisplaysWithSysDecor() =
        testScope.runTest {
            setDisplays(0)
@@ -772,7 +797,10 @@ class DisplayRepositoryTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM)
    @EnableFlags(
        Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM,
        FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT,
    )
    fun displaysWithSystemDecorationsCompat_registerListener_notifyRemoveSystemDecor() =
        testScope.runTest {
            setDisplays(0)
@@ -788,7 +816,10 @@ class DisplayRepositoryTest : SysuiTestCase() {
        }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM)
    @EnableFlags(
        Flags.FLAG_ENABLE_SYS_DECORS_CALLBACKS_VIA_WM,
        FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT,
    )
    fun displaysWithSystemDecorationsCompat_registerListener_notifyAllDisplaysWithSysDecor() =
        testScope.runTest {
            setDisplays(0, 2)