Loading packages/SystemUI/multivalentTests/src/com/android/systemui/display/data/repository/DisplayRepositoryTest.kt +41 −10 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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) Loading @@ -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) Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading @@ -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>() Loading @@ -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) Loading @@ -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) Loading @@ -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) Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/display/data/repository/DisplayRepositoryTest.kt +41 −10 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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) Loading @@ -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) Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading @@ -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>() Loading @@ -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) Loading @@ -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) Loading @@ -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) Loading