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

Commit a8efffb2 authored by Ebru Kurnaz's avatar Ebru Kurnaz Committed by Android (Google) Code Review
Browse files

Merge "Fix DisplayRepositoryTest by enabling all flags needed for sys decor wm callback." into main

parents 3c1ffcc1 9a787fc5
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)