Loading packages/SystemUI/multivalentTests/src/com/android/systemui/ExpandHelperTest.java +3 −10 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import android.content.Context; import android.testing.TestableLooper; import android.testing.TestableLooper.RunWithLooper; import androidx.core.animation.ObjectAnimator; Loading @@ -31,10 +30,9 @@ import androidx.test.filters.SmallTest; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.systemui.animation.AnimatorTestRule; import com.android.systemui.flags.FakeFeatureFlagsClassic; import com.android.systemui.kosmos.KosmosJavaAdapter; import com.android.systemui.media.NotificationMediaManager; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.NotificationTestHelper; import org.junit.Before; import org.junit.Rule; Loading @@ -49,10 +47,10 @@ public class ExpandHelperTest extends SysuiTestCase { @Rule public final AnimatorTestRule mAnimatorTestRule = new AnimatorTestRule(this); private final FakeFeatureFlagsClassic mFeatureFlags = new FakeFeatureFlagsClassic(); private ExpandableNotificationRow mRow; private ExpandHelper mExpandHelper; private ExpandHelper.Callback mCallback; private final KosmosJavaAdapter mKosmos = new KosmosJavaAdapter(this); @Before public void setUp() throws Exception { Loading @@ -60,12 +58,7 @@ public class ExpandHelperTest extends SysuiTestCase { mDependency.injectMockDependency(NotificationMediaManager.class); allowTestableLooperAsMainThread(); Context context = getContext(); NotificationTestHelper helper = new NotificationTestHelper( mContext, mDependency, TestableLooper.get(this), mFeatureFlags); mRow = helper.createRow(); mRow = mKosmos.createRow(); mCallback = mock(ExpandHelper.Callback.class); mExpandHelper = new ExpandHelper(context, mCallback, 10, 100); } Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/NotificationGroupingUtilTest.kt +13 −20 Original line number Diff line number Diff line Loading @@ -25,13 +25,13 @@ import com.android.systemui.res.R import com.android.systemui.statusbar.notification.collection.BundleEntry import com.android.systemui.statusbar.notification.collection.EntryAdapterFactory import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.NotificationTestHelper import com.android.systemui.statusbar.notification.row.createRow import com.android.systemui.statusbar.notification.row.createRowWithNotif import com.android.systemui.statusbar.notification.row.data.repository.TEST_BUNDLE_SPEC import com.android.systemui.statusbar.notification.row.entryAdapterFactory import com.android.systemui.statusbar.notification.shared.NotificationBundleUi import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mockito.mock Loading @@ -46,7 +46,6 @@ class NotificationGroupingUtilTest(flags: FlagsParameterization) : SysuiTestCase private lateinit var underTest: NotificationGroupingUtil private val factory: EntryAdapterFactory = kosmos.entryAdapterFactory private lateinit var testHelper: NotificationTestHelper companion object { @JvmStatic Loading @@ -60,23 +59,16 @@ class NotificationGroupingUtilTest(flags: FlagsParameterization) : SysuiTestCase mSetFlagsRule.setFlagsParameterization(flags) } @Before fun setup() { testHelper = NotificationTestHelper(mContext, mDependency) } @Test fun showsTime() { val row = testHelper.createRow() var row = kosmos.createRow() underTest = NotificationGroupingUtil(row) assertThat(underTest.showsTime(row)).isTrue() } @Test fun iconExtractor_extractsSbn_notification() { val row = testHelper.createRow() var row = kosmos.createRow() underTest = NotificationGroupingUtil(row) assertThat(NotificationGroupingUtil.ICON_EXTRACTOR.extractData(row)) Loading @@ -97,17 +89,20 @@ class NotificationGroupingUtilTest(flags: FlagsParameterization) : SysuiTestCase @Test fun iconComparator_sameNotificationIcon() { val n1 = NotificationGroupingUtil.ICON_EXTRACTOR.extractData(testHelper.createRow()) val n2 = NotificationGroupingUtil.ICON_EXTRACTOR.extractData(testHelper.createRow()) var row = kosmos.createRow() val n1 = NotificationGroupingUtil.ICON_EXTRACTOR.extractData(row) val n2 = NotificationGroupingUtil.ICON_EXTRACTOR.extractData(row) assertThat(NotificationGroupingUtil.IconComparator().hasSameIcon(n1, n2)).isTrue() } @Test fun iconComparator_differentNotificationIcon() { var row = kosmos.createRow() val notif = Notification.Builder(mContext, "").setSmallIcon(R.drawable.ic_menu).build() val n1 = NotificationGroupingUtil.ICON_EXTRACTOR.extractData(testHelper.createRow(notif)) val n2 = NotificationGroupingUtil.ICON_EXTRACTOR.extractData(testHelper.createRow()) val n1 = NotificationGroupingUtil.ICON_EXTRACTOR.extractData(kosmos.createRowWithNotif(notif)) val n2 = NotificationGroupingUtil.ICON_EXTRACTOR.extractData(row) assertThat(NotificationGroupingUtil.IconComparator().hasSameIcon(n1, n2)).isFalse() } Loading @@ -115,12 +110,10 @@ class NotificationGroupingUtilTest(flags: FlagsParameterization) : SysuiTestCase @Test @EnableFlags(NotificationBundleUi.FLAG_NAME) fun iconComparator_bundleNotification() { var row = kosmos.createRow() assertThat( NotificationGroupingUtil.IconComparator() .hasSameIcon( null, NotificationGroupingUtil.ICON_EXTRACTOR.extractData(testHelper.createRow()), ) .hasSameIcon(null, NotificationGroupingUtil.ICON_EXTRACTOR.extractData(row)) ) .isFalse() } Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/AboveShelfObserverTest.java +4 −8 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import com.android.systemui.kosmos.KosmosJavaAdapter; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.NotificationTestHelper; Loading @@ -42,22 +43,18 @@ public class AboveShelfObserverTest extends SysuiTestCase { private AboveShelfObserver mObserver; private FrameLayout mHostLayout; private NotificationTestHelper mNotificationTestHelper; private AboveShelfObserver.HasViewAboveShelfChangedListener mListener; private final KosmosJavaAdapter mKosmos = new KosmosJavaAdapter(this); @Before public void setUp() throws Exception { allowTestableLooperAsMainThread(); mNotificationTestHelper = new NotificationTestHelper( mContext, mDependency, TestableLooper.get(this)); mHostLayout = new FrameLayout(getContext()); mObserver = new AboveShelfObserver(mHostLayout); ExpandableNotificationRow row = mNotificationTestHelper.createRow(); ExpandableNotificationRow row = mKosmos.createRow(); row.setAboveShelfChangedListener(mObserver); mHostLayout.addView(row); row = mNotificationTestHelper.createRow(); row = mKosmos.createRow(); row.setAboveShelfChangedListener(mObserver); mHostLayout.addView(row); mListener = mock(AboveShelfObserver.HasViewAboveShelfChangedListener.class); Loading Loading @@ -91,4 +88,3 @@ public class AboveShelfObserverTest extends SysuiTestCase { mObserver.hasViewsAboveShelf()); } } packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/coordinator/ColorizedFgsCoordinatorTest.kt +16 −7 Original line number Diff line number Diff line Loading @@ -189,7 +189,9 @@ class ColorizedFgsCoordinatorTest : SysuiTestCase() { // GIVEN a screen record event + screen record notif that has a status bar chip screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val screenRecordEntry = buildNotificationEntry(tag = "screenRecord", promoted = false) { setImportance(NotificationManager.IMPORTANCE_DEFAULT) Loading @@ -202,7 +204,7 @@ class ColorizedFgsCoordinatorTest : SysuiTestCase() { collectLastValue(promotedNotificationsInteractor.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|screenRecord|0") .containsExactly("0|com.android.systemui.tests|0|screenRecord|0") .inOrder() // THEN the entry is in the fgs section Loading @@ -216,7 +218,9 @@ class ColorizedFgsCoordinatorTest : SysuiTestCase() { // GIVEN a screen record event + screen record notif that has a status bar chip screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val screenRecordEntry = buildNotificationEntry(tag = "screenRecord", promoted = false) { setImportance(NotificationManager.IMPORTANCE_MIN) Loading @@ -229,7 +233,7 @@ class ColorizedFgsCoordinatorTest : SysuiTestCase() { collectLastValue(promotedNotificationsInteractor.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|screenRecord|0") .containsExactly("0|com.android.systemui.tests|0|screenRecord|0") .inOrder() // THEN the entry is NOT in the fgs section Loading @@ -243,7 +247,9 @@ class ColorizedFgsCoordinatorTest : SysuiTestCase() { // GIVEN a screen record event + screen record notif that has a status bar chip screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val screenRecordEntry = buildNotificationEntry(tag = "screenRecord", promoted = false) { setImportance(NotificationManager.IMPORTANCE_DEFAULT) Loading @@ -256,7 +262,7 @@ class ColorizedFgsCoordinatorTest : SysuiTestCase() { collectLastValue(promotedNotificationsInteractor.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|screenRecord|0") .containsExactly("0|com.android.systemui.tests|0|screenRecord|0") .inOrder() // THEN the entry is NOT in the fgs section Loading Loading @@ -315,7 +321,10 @@ class ColorizedFgsCoordinatorTest : SysuiTestCase() { // THEN the order of the notification keys should be the call then the RON assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|call|0", "0|test_pkg|0|ron|0") .containsExactly( "0|com.android.systemui.tests|0|call|0", "0|com.android.systemui.tests|0|ron|0", ) // VERIFY that the comparator puts the call before the ron assertThat(sectioner.comparator!!.compare(callEntry, ronEntry)).isLessThan(0) Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/promoted/domain/interactor/PromotedNotificationsInteractorTest.kt +64 −34 Original line number Diff line number Diff line Loading @@ -85,7 +85,8 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) // THEN the call shouldn't be in the list assertThat(orderedChipNotificationKeys).containsExactly("0|test_pkg|0|ron|0") assertThat(orderedChipNotificationKeys).containsExactly( "0|com.android.systemui.tests|0|ron|0") } @Test Loading @@ -105,7 +106,10 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { // THEN the order of the notification keys should be the call then the RON assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|call|0", "0|test_pkg|0|ron|0") .containsExactly( "0|com.android.systemui.tests|0|call|0", "0|com.android.systemui.tests|0|ron|0", ) .inOrder() } Loading @@ -114,7 +118,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) renderNotificationListInteractor.setRenderedList(emptyList()) Loading Loading @@ -146,7 +152,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val screenRecordEntry = buildNotificationEntry(tag = "record", promoted = true) renderNotificationListInteractor.setRenderedList(listOf(screenRecordEntry)) Loading @@ -155,7 +163,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|record|0") .containsExactly("0|com.android.systemui.tests|0|record|0") .inOrder() } Loading @@ -164,7 +172,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val screenRecordEntry = buildNotificationEntry(tag = "record", promoted = false) { Loading @@ -176,7 +186,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|record|0") .containsExactly("0|com.android.systemui.tests|0|record|0") .inOrder() } Loading @@ -185,7 +195,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val screenRecordEntry = buildNotificationEntry(tag = "record", promoted = false) { Loading @@ -197,7 +209,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|record|0") .containsExactly("0|com.android.systemui.tests|0|record|0") .inOrder() } Loading @@ -206,7 +218,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val screenRecordEntry = buildNotificationEntry(tag = "record", promoted = false) { Loading @@ -226,7 +240,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val fgsEntry = buildNotificationEntry(tag = "recordFgs", promoted = false) { Loading @@ -242,7 +258,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|recordFgs|0") .containsExactly("0|com.android.systemui.tests|0|recordFgs|0") .inOrder() } Loading @@ -251,7 +267,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val ongoingEntry = buildNotificationEntry(tag = "recordOngoing", promoted = false) { Loading @@ -267,7 +285,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|recordOngoing|0") .containsExactly("0|com.android.systemui.tests|0|recordOngoing|0") .inOrder() } Loading @@ -276,7 +294,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val ongoingAndFgsEntry = buildNotificationEntry(tag = "recordBoth", promoted = false) { Loading @@ -301,7 +321,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|recordBoth|0") .containsExactly("0|com.android.systemui.tests|0|recordBoth|0") .inOrder() } Loading @@ -310,7 +330,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val entry1 = buildNotificationEntry(tag = "entry1", promoted = false) { Loading @@ -333,7 +355,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading @@ -351,7 +373,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading @@ -362,7 +384,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { val orderedChipNotificationKeys by collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys).containsExactly("0|test_pkg|0|proj|0").inOrder() assertThat(orderedChipNotificationKeys) .containsExactly("0|com.android.systemui.tests|0|proj|0") .inOrder() } @Test Loading @@ -370,7 +394,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading @@ -384,7 +408,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { val orderedChipNotificationKeys by collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys).containsExactly("0|test_pkg|0|proj|0").inOrder() assertThat(orderedChipNotificationKeys) .containsExactly("0|com.android.systemui.tests|0|proj|0") .inOrder() } @Test Loading @@ -392,7 +418,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading @@ -406,7 +432,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { val orderedChipNotificationKeys by collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys).containsExactly("0|test_pkg|0|proj|0").inOrder() assertThat(orderedChipNotificationKeys) .containsExactly("0|com.android.systemui.tests|0|proj|0") .inOrder() } @Test Loading @@ -414,7 +442,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading @@ -437,7 +465,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading @@ -456,7 +484,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|projFgs|0") .containsExactly("0|com.android.systemui.tests|0|projFgs|0") .inOrder() } Loading @@ -465,7 +493,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading @@ -484,7 +512,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|projOngoing|0") .containsExactly("0|com.android.systemui.tests|0|projOngoing|0") .inOrder() } Loading @@ -493,7 +521,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading Loading @@ -521,7 +549,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|projBoth|0") .containsExactly("0|com.android.systemui.tests|0|projBoth|0") .inOrder() } Loading @@ -530,7 +558,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading Loading @@ -639,7 +667,8 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.aodPromotedNotification) // THEN the ron is first because the call has no content assertThat(topPromotedNotificationContent?.key).isEqualTo("0|test_pkg|0|ron|0") assertThat(topPromotedNotificationContent?.key) .isEqualTo("0|com.android.systemui.tests|0|ron|0") } @Test Loading @@ -658,7 +687,8 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.aodPromotedNotification) // THEN the call is the top notification assertThat(topPromotedNotificationContent?.key).isEqualTo("0|test_pkg|0|call|0") assertThat(topPromotedNotificationContent?.key) .isEqualTo("0|com.android.systemui.tests|0|call|0") } @Test Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/ExpandHelperTest.java +3 −10 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import android.content.Context; import android.testing.TestableLooper; import android.testing.TestableLooper.RunWithLooper; import androidx.core.animation.ObjectAnimator; Loading @@ -31,10 +30,9 @@ import androidx.test.filters.SmallTest; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.systemui.animation.AnimatorTestRule; import com.android.systemui.flags.FakeFeatureFlagsClassic; import com.android.systemui.kosmos.KosmosJavaAdapter; import com.android.systemui.media.NotificationMediaManager; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.NotificationTestHelper; import org.junit.Before; import org.junit.Rule; Loading @@ -49,10 +47,10 @@ public class ExpandHelperTest extends SysuiTestCase { @Rule public final AnimatorTestRule mAnimatorTestRule = new AnimatorTestRule(this); private final FakeFeatureFlagsClassic mFeatureFlags = new FakeFeatureFlagsClassic(); private ExpandableNotificationRow mRow; private ExpandHelper mExpandHelper; private ExpandHelper.Callback mCallback; private final KosmosJavaAdapter mKosmos = new KosmosJavaAdapter(this); @Before public void setUp() throws Exception { Loading @@ -60,12 +58,7 @@ public class ExpandHelperTest extends SysuiTestCase { mDependency.injectMockDependency(NotificationMediaManager.class); allowTestableLooperAsMainThread(); Context context = getContext(); NotificationTestHelper helper = new NotificationTestHelper( mContext, mDependency, TestableLooper.get(this), mFeatureFlags); mRow = helper.createRow(); mRow = mKosmos.createRow(); mCallback = mock(ExpandHelper.Callback.class); mExpandHelper = new ExpandHelper(context, mCallback, 10, 100); } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/NotificationGroupingUtilTest.kt +13 −20 Original line number Diff line number Diff line Loading @@ -25,13 +25,13 @@ import com.android.systemui.res.R import com.android.systemui.statusbar.notification.collection.BundleEntry import com.android.systemui.statusbar.notification.collection.EntryAdapterFactory import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.NotificationTestHelper import com.android.systemui.statusbar.notification.row.createRow import com.android.systemui.statusbar.notification.row.createRowWithNotif import com.android.systemui.statusbar.notification.row.data.repository.TEST_BUNDLE_SPEC import com.android.systemui.statusbar.notification.row.entryAdapterFactory import com.android.systemui.statusbar.notification.shared.NotificationBundleUi import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mockito.mock Loading @@ -46,7 +46,6 @@ class NotificationGroupingUtilTest(flags: FlagsParameterization) : SysuiTestCase private lateinit var underTest: NotificationGroupingUtil private val factory: EntryAdapterFactory = kosmos.entryAdapterFactory private lateinit var testHelper: NotificationTestHelper companion object { @JvmStatic Loading @@ -60,23 +59,16 @@ class NotificationGroupingUtilTest(flags: FlagsParameterization) : SysuiTestCase mSetFlagsRule.setFlagsParameterization(flags) } @Before fun setup() { testHelper = NotificationTestHelper(mContext, mDependency) } @Test fun showsTime() { val row = testHelper.createRow() var row = kosmos.createRow() underTest = NotificationGroupingUtil(row) assertThat(underTest.showsTime(row)).isTrue() } @Test fun iconExtractor_extractsSbn_notification() { val row = testHelper.createRow() var row = kosmos.createRow() underTest = NotificationGroupingUtil(row) assertThat(NotificationGroupingUtil.ICON_EXTRACTOR.extractData(row)) Loading @@ -97,17 +89,20 @@ class NotificationGroupingUtilTest(flags: FlagsParameterization) : SysuiTestCase @Test fun iconComparator_sameNotificationIcon() { val n1 = NotificationGroupingUtil.ICON_EXTRACTOR.extractData(testHelper.createRow()) val n2 = NotificationGroupingUtil.ICON_EXTRACTOR.extractData(testHelper.createRow()) var row = kosmos.createRow() val n1 = NotificationGroupingUtil.ICON_EXTRACTOR.extractData(row) val n2 = NotificationGroupingUtil.ICON_EXTRACTOR.extractData(row) assertThat(NotificationGroupingUtil.IconComparator().hasSameIcon(n1, n2)).isTrue() } @Test fun iconComparator_differentNotificationIcon() { var row = kosmos.createRow() val notif = Notification.Builder(mContext, "").setSmallIcon(R.drawable.ic_menu).build() val n1 = NotificationGroupingUtil.ICON_EXTRACTOR.extractData(testHelper.createRow(notif)) val n2 = NotificationGroupingUtil.ICON_EXTRACTOR.extractData(testHelper.createRow()) val n1 = NotificationGroupingUtil.ICON_EXTRACTOR.extractData(kosmos.createRowWithNotif(notif)) val n2 = NotificationGroupingUtil.ICON_EXTRACTOR.extractData(row) assertThat(NotificationGroupingUtil.IconComparator().hasSameIcon(n1, n2)).isFalse() } Loading @@ -115,12 +110,10 @@ class NotificationGroupingUtilTest(flags: FlagsParameterization) : SysuiTestCase @Test @EnableFlags(NotificationBundleUi.FLAG_NAME) fun iconComparator_bundleNotification() { var row = kosmos.createRow() assertThat( NotificationGroupingUtil.IconComparator() .hasSameIcon( null, NotificationGroupingUtil.ICON_EXTRACTOR.extractData(testHelper.createRow()), ) .hasSameIcon(null, NotificationGroupingUtil.ICON_EXTRACTOR.extractData(row)) ) .isFalse() } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/AboveShelfObserverTest.java +4 −8 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import com.android.systemui.kosmos.KosmosJavaAdapter; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.NotificationTestHelper; Loading @@ -42,22 +43,18 @@ public class AboveShelfObserverTest extends SysuiTestCase { private AboveShelfObserver mObserver; private FrameLayout mHostLayout; private NotificationTestHelper mNotificationTestHelper; private AboveShelfObserver.HasViewAboveShelfChangedListener mListener; private final KosmosJavaAdapter mKosmos = new KosmosJavaAdapter(this); @Before public void setUp() throws Exception { allowTestableLooperAsMainThread(); mNotificationTestHelper = new NotificationTestHelper( mContext, mDependency, TestableLooper.get(this)); mHostLayout = new FrameLayout(getContext()); mObserver = new AboveShelfObserver(mHostLayout); ExpandableNotificationRow row = mNotificationTestHelper.createRow(); ExpandableNotificationRow row = mKosmos.createRow(); row.setAboveShelfChangedListener(mObserver); mHostLayout.addView(row); row = mNotificationTestHelper.createRow(); row = mKosmos.createRow(); row.setAboveShelfChangedListener(mObserver); mHostLayout.addView(row); mListener = mock(AboveShelfObserver.HasViewAboveShelfChangedListener.class); Loading Loading @@ -91,4 +88,3 @@ public class AboveShelfObserverTest extends SysuiTestCase { mObserver.hasViewsAboveShelf()); } }
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/coordinator/ColorizedFgsCoordinatorTest.kt +16 −7 Original line number Diff line number Diff line Loading @@ -189,7 +189,9 @@ class ColorizedFgsCoordinatorTest : SysuiTestCase() { // GIVEN a screen record event + screen record notif that has a status bar chip screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val screenRecordEntry = buildNotificationEntry(tag = "screenRecord", promoted = false) { setImportance(NotificationManager.IMPORTANCE_DEFAULT) Loading @@ -202,7 +204,7 @@ class ColorizedFgsCoordinatorTest : SysuiTestCase() { collectLastValue(promotedNotificationsInteractor.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|screenRecord|0") .containsExactly("0|com.android.systemui.tests|0|screenRecord|0") .inOrder() // THEN the entry is in the fgs section Loading @@ -216,7 +218,9 @@ class ColorizedFgsCoordinatorTest : SysuiTestCase() { // GIVEN a screen record event + screen record notif that has a status bar chip screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val screenRecordEntry = buildNotificationEntry(tag = "screenRecord", promoted = false) { setImportance(NotificationManager.IMPORTANCE_MIN) Loading @@ -229,7 +233,7 @@ class ColorizedFgsCoordinatorTest : SysuiTestCase() { collectLastValue(promotedNotificationsInteractor.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|screenRecord|0") .containsExactly("0|com.android.systemui.tests|0|screenRecord|0") .inOrder() // THEN the entry is NOT in the fgs section Loading @@ -243,7 +247,9 @@ class ColorizedFgsCoordinatorTest : SysuiTestCase() { // GIVEN a screen record event + screen record notif that has a status bar chip screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val screenRecordEntry = buildNotificationEntry(tag = "screenRecord", promoted = false) { setImportance(NotificationManager.IMPORTANCE_DEFAULT) Loading @@ -256,7 +262,7 @@ class ColorizedFgsCoordinatorTest : SysuiTestCase() { collectLastValue(promotedNotificationsInteractor.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|screenRecord|0") .containsExactly("0|com.android.systemui.tests|0|screenRecord|0") .inOrder() // THEN the entry is NOT in the fgs section Loading Loading @@ -315,7 +321,10 @@ class ColorizedFgsCoordinatorTest : SysuiTestCase() { // THEN the order of the notification keys should be the call then the RON assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|call|0", "0|test_pkg|0|ron|0") .containsExactly( "0|com.android.systemui.tests|0|call|0", "0|com.android.systemui.tests|0|ron|0", ) // VERIFY that the comparator puts the call before the ron assertThat(sectioner.comparator!!.compare(callEntry, ronEntry)).isLessThan(0) Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/promoted/domain/interactor/PromotedNotificationsInteractorTest.kt +64 −34 Original line number Diff line number Diff line Loading @@ -85,7 +85,8 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) // THEN the call shouldn't be in the list assertThat(orderedChipNotificationKeys).containsExactly("0|test_pkg|0|ron|0") assertThat(orderedChipNotificationKeys).containsExactly( "0|com.android.systemui.tests|0|ron|0") } @Test Loading @@ -105,7 +106,10 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { // THEN the order of the notification keys should be the call then the RON assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|call|0", "0|test_pkg|0|ron|0") .containsExactly( "0|com.android.systemui.tests|0|call|0", "0|com.android.systemui.tests|0|ron|0", ) .inOrder() } Loading @@ -114,7 +118,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) renderNotificationListInteractor.setRenderedList(emptyList()) Loading Loading @@ -146,7 +152,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val screenRecordEntry = buildNotificationEntry(tag = "record", promoted = true) renderNotificationListInteractor.setRenderedList(listOf(screenRecordEntry)) Loading @@ -155,7 +163,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|record|0") .containsExactly("0|com.android.systemui.tests|0|record|0") .inOrder() } Loading @@ -164,7 +172,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val screenRecordEntry = buildNotificationEntry(tag = "record", promoted = false) { Loading @@ -176,7 +186,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|record|0") .containsExactly("0|com.android.systemui.tests|0|record|0") .inOrder() } Loading @@ -185,7 +195,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val screenRecordEntry = buildNotificationEntry(tag = "record", promoted = false) { Loading @@ -197,7 +209,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|record|0") .containsExactly("0|com.android.systemui.tests|0|record|0") .inOrder() } Loading @@ -206,7 +218,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val screenRecordEntry = buildNotificationEntry(tag = "record", promoted = false) { Loading @@ -226,7 +240,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val fgsEntry = buildNotificationEntry(tag = "recordFgs", promoted = false) { Loading @@ -242,7 +258,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|recordFgs|0") .containsExactly("0|com.android.systemui.tests|0|recordFgs|0") .inOrder() } Loading @@ -251,7 +267,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val ongoingEntry = buildNotificationEntry(tag = "recordOngoing", promoted = false) { Loading @@ -267,7 +285,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|recordOngoing|0") .containsExactly("0|com.android.systemui.tests|0|recordOngoing|0") .inOrder() } Loading @@ -276,7 +294,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val ongoingAndFgsEntry = buildNotificationEntry(tag = "recordBoth", promoted = false) { Loading @@ -301,7 +321,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|recordBoth|0") .containsExactly("0|com.android.systemui.tests|0|recordBoth|0") .inOrder() } Loading @@ -310,7 +330,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { screenRecordRepository.screenRecordState.value = ScreenRecordModel.Recording fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.EntireScreen(hostPackage = "test_pkg") MediaProjectionState.Projecting.EntireScreen( hostPackage = "com.android.systemui.tests" ) val entry1 = buildNotificationEntry(tag = "entry1", promoted = false) { Loading @@ -333,7 +355,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading @@ -351,7 +373,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading @@ -362,7 +384,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { val orderedChipNotificationKeys by collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys).containsExactly("0|test_pkg|0|proj|0").inOrder() assertThat(orderedChipNotificationKeys) .containsExactly("0|com.android.systemui.tests|0|proj|0") .inOrder() } @Test Loading @@ -370,7 +394,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading @@ -384,7 +408,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { val orderedChipNotificationKeys by collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys).containsExactly("0|test_pkg|0|proj|0").inOrder() assertThat(orderedChipNotificationKeys) .containsExactly("0|com.android.systemui.tests|0|proj|0") .inOrder() } @Test Loading @@ -392,7 +418,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading @@ -406,7 +432,9 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { val orderedChipNotificationKeys by collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys).containsExactly("0|test_pkg|0|proj|0").inOrder() assertThat(orderedChipNotificationKeys) .containsExactly("0|com.android.systemui.tests|0|proj|0") .inOrder() } @Test Loading @@ -414,7 +442,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading @@ -437,7 +465,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading @@ -456,7 +484,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|projFgs|0") .containsExactly("0|com.android.systemui.tests|0|projFgs|0") .inOrder() } Loading @@ -465,7 +493,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading @@ -484,7 +512,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|projOngoing|0") .containsExactly("0|com.android.systemui.tests|0|projOngoing|0") .inOrder() } Loading @@ -493,7 +521,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading Loading @@ -521,7 +549,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.orderedChipNotificationKeys) assertThat(orderedChipNotificationKeys) .containsExactly("0|test_pkg|0|projBoth|0") .containsExactly("0|com.android.systemui.tests|0|projBoth|0") .inOrder() } Loading @@ -530,7 +558,7 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { kosmos.runTest { fakeMediaProjectionRepository.mediaProjectionState.value = MediaProjectionState.Projecting.SingleTask( hostPackage = "test_pkg", hostPackage = "com.android.systemui.tests", hostDeviceName = null, createTask(taskId = 1), ) Loading Loading @@ -639,7 +667,8 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.aodPromotedNotification) // THEN the ron is first because the call has no content assertThat(topPromotedNotificationContent?.key).isEqualTo("0|test_pkg|0|ron|0") assertThat(topPromotedNotificationContent?.key) .isEqualTo("0|com.android.systemui.tests|0|ron|0") } @Test Loading @@ -658,7 +687,8 @@ class PromotedNotificationsInteractorTest : SysuiTestCase() { collectLastValue(underTest.aodPromotedNotification) // THEN the call is the top notification assertThat(topPromotedNotificationContent?.key).isEqualTo("0|test_pkg|0|call|0") assertThat(topPromotedNotificationContent?.key) .isEqualTo("0|com.android.systemui.tests|0|call|0") } @Test Loading