Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import static kotlinx.coroutines.flow.FlowKt.emptyFlow; import static kotlinx.coroutines.test.TestCoroutineDispatchersKt.StandardTestDispatcher; import android.metrics.LogMaker; import android.platform.test.annotations.DisableFlags; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.view.View; Loading Loading @@ -84,6 +85,7 @@ import com.android.systemui.statusbar.notification.collection.render.SectionHead import com.android.systemui.statusbar.notification.data.repository.ActiveNotificationListRepository; import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor; import com.android.systemui.statusbar.notification.domain.interactor.SeenNotificationsInteractor; import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor; import com.android.systemui.statusbar.notification.init.NotificationsController; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.NotificationGutsManager; Loading Loading @@ -218,6 +220,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_notificationsVisible_zenHiding() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(true); initController(/* viewIsAttached= */ true); Loading @@ -238,6 +241,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_notificationsHidden_zenNotHiding() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); Loading @@ -258,6 +262,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_splitShadeMode_alwaysShowEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); Loading Loading @@ -285,6 +290,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_bouncerShowing_flagOff_hideEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); Loading @@ -306,6 +312,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_bouncerShowing_flagOn_hideEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); Loading @@ -327,6 +334,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_bouncerNotShowing_flagOff_showEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); Loading @@ -348,6 +356,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_bouncerNotShowing_flagOn_showEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); Loading Loading @@ -504,6 +513,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testSetNotifStats_updatesHasFilteredOutSeenNotifications() { initController(/* viewIsAttached= */ true); mSeenNotificationsInteractor.setHasFilteredOutSeenNotifications(true); Loading Loading @@ -545,6 +555,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void updateImportantForAccessibility_noChild_onKeyGuard_notImportantForA11y() { // GIVEN: Controller is attached, active notifications is empty, // and mNotificationStackScrollLayout.onKeyguard() is true Loading @@ -561,6 +572,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void updateImportantForAccessibility_hasChild_onKeyGuard_importantForA11y() { // GIVEN: Controller is attached, active notifications is not empty, // and mNotificationStackScrollLayout.onKeyguard() is true Loading @@ -584,6 +596,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void updateImportantForAccessibility_hasChild_notOnKeyGuard_importantForA11y() { // GIVEN: Controller is attached, active notifications is not empty, // and mNotificationStackScrollLayout.onKeyguard() is false Loading @@ -607,6 +620,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void updateImportantForAccessibility_noChild_notOnKeyGuard_importantForA11y() { // GIVEN: Controller is attached, active notifications is empty, // and mNotificationStackScrollLayout.onKeyguard() is false Loading @@ -623,6 +637,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void updateEmptyShadeView_onKeyguardTransitionToAod_hidesView() { initController(/* viewIsAttached= */ true); mController.onKeyguardTransitionChanged( Loading @@ -633,6 +648,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void updateEmptyShadeView_onKeyguardOccludedTransitionToAod_hidesView() { initController(/* viewIsAttached= */ true); mController.onKeyguardTransitionChanged( Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +48 −13 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ import static org.mockito.Mockito.when; import android.graphics.Insets; import android.graphics.Rect; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.EnableFlags; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.testing.TestableResources; Loading Loading @@ -81,6 +83,7 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.render.GroupExpansionManager; import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager; import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor; import com.android.systemui.statusbar.notification.footer.ui.view.FooterView; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableView; Loading Loading @@ -309,7 +312,9 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { public void updateEmptyView_dndSuppressing() { when(mEmptyShadeView.willBeGone()).thenReturn(true); mStackScroller.updateEmptyShadeView(true, true); mStackScroller.updateEmptyShadeView(/* visible = */ true, /* areNotificationsHiddenInShade = */ true, /* hasFilteredOutSeenNotifications = */ false); verify(mEmptyShadeView).setText(R.string.dnd_suppressing_shade_text); } Loading @@ -319,7 +324,9 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.setEmptyShadeView(mEmptyShadeView); when(mEmptyShadeView.willBeGone()).thenReturn(true); mStackScroller.updateEmptyShadeView(true, false); mStackScroller.updateEmptyShadeView(/* visible = */ true, /* areNotificationsHiddenInShade = */ false, /* hasFilteredOutSeenNotifications = */ false); verify(mEmptyShadeView).setText(R.string.empty_shade_text); } Loading @@ -328,10 +335,14 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { public void updateEmptyView_noNotificationsToDndSuppressing() { mStackScroller.setEmptyShadeView(mEmptyShadeView); when(mEmptyShadeView.willBeGone()).thenReturn(true); mStackScroller.updateEmptyShadeView(true, false); mStackScroller.updateEmptyShadeView(/* visible = */ true, /* areNotificationsHiddenInShade = */ false, /* hasFilteredOutSeenNotifications = */ false); verify(mEmptyShadeView).setText(R.string.empty_shade_text); mStackScroller.updateEmptyShadeView(true, true); mStackScroller.updateEmptyShadeView(/* visible = */ true, /* areNotificationsHiddenInShade = */ true, /* hasFilteredOutSeenNotifications = */ false); verify(mEmptyShadeView).setText(R.string.dnd_suppressing_shade_text); } Loading Loading @@ -385,8 +396,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.setExpandedHeight(100f); } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void manageNotifications_visible() { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); Loading @@ -399,6 +410,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void clearAll_visible() { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); Loading @@ -411,6 +423,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testInflateFooterView() { mStackScroller.inflateFooterView(); ArgumentCaptor<FooterView> captor = ArgumentCaptor.forClass(FooterView.class); Loading Loading @@ -444,7 +457,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); mStackScroller.updateFooter(); verify(mStackScroller).updateFooterView(false, true, true); verify(mStackScroller, atLeastOnce()).updateFooterView(false, true, true); } @Test Loading @@ -459,7 +472,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); mStackScroller.updateFooter(); verify(mStackScroller).updateFooterView(false, false, true); verify(mStackScroller, atLeastOnce()).updateFooterView(false, false, true); } @Test Loading @@ -474,7 +487,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); mStackScroller.updateFooter(); verify(mStackScroller).updateFooterView(true, true, true); verify(mStackScroller, atLeastOnce()).updateFooterView(true, true, true); } @Test Loading @@ -490,7 +503,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); mStackScroller.updateFooter(); verify(mStackScroller).updateFooterView(true, true, false); verify(mStackScroller, atLeastOnce()).updateFooterView(true, true, false); } @Test Loading @@ -505,7 +518,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); mStackScroller.updateFooter(); verify(mStackScroller).updateFooterView(false, true, true); verify(mStackScroller, atLeastOnce()).updateFooterView(false, true, true); } @Test Loading @@ -521,7 +534,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); mStackScroller.updateFooter(); verify(mStackScroller).updateFooterView(true, false, true); verify(mStackScroller, atLeastOnce()).updateFooterView(true, false, true); } @Test Loading @@ -529,7 +542,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.setCurrentUserSetup(true); // add footer mStackScroller.inflateFooterView(); FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); // add notification ExpandableNotificationRow row = createClearableRow(); Loading @@ -545,6 +559,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testReInflatesFooterViews() { when(mEmptyShadeView.getTextResource()).thenReturn(R.string.empty_shade_text); clearInvocations(mStackScroller); Loading @@ -553,6 +568,16 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { verify(mStackScroller).setEmptyShadeView(any()); } @Test @EnableFlags(FooterViewRefactor.FLAG_NAME) public void testReInflatesEmptyShadeView() { when(mEmptyShadeView.getTextResource()).thenReturn(R.string.empty_shade_text); clearInvocations(mStackScroller); mStackScroller.reinflateViews(); verify(mStackScroller, never()).setFooterView(any()); verify(mStackScroller).setEmptyShadeView(any()); } @Test public void testSetIsBeingDraggedResetsExposedMenu() { mStackScroller.setIsBeingDragged(true); Loading Loading @@ -601,6 +626,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testClearNotifications_clearAllInProgress() { mFeatureFlags.set(Flags.ENABLE_NOTIFICATIONS_SIMULATE_SLOW_MEASURE, false); ExpandableNotificationRow row = createClearableRow(); when(row.getEntry().hasFinishedInitialization()).thenReturn(true); doReturn(true).when(mStackScroller).isVisible(row); Loading Loading @@ -645,6 +672,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testAddNotificationUpdatesSpeedBumpIndex() { mFeatureFlags.set(Flags.ENABLE_NOTIFICATIONS_SIMULATE_SLOW_MEASURE, false); // initial state calculated == 0 assertEquals(0, mStackScroller.getSpeedBumpIndex()); Loading @@ -661,6 +690,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testAddAmbientNotificationNoSpeedBumpUpdate() { mFeatureFlags.set(Flags.ENABLE_NOTIFICATIONS_SIMULATE_SLOW_MEASURE, false); // initial state calculated == 0 assertEquals(0, mStackScroller.getSpeedBumpIndex()); Loading @@ -677,6 +708,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testRemoveNotificationUpdatesSpeedBump() { mFeatureFlags.set(Flags.ENABLE_NOTIFICATIONS_SIMULATE_SLOW_MEASURE, false); // initial state calculated == 0 assertEquals(0, mStackScroller.getSpeedBumpIndex()); Loading Loading @@ -872,6 +905,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void hasFilteredOutSeenNotifs_updateFooter() { mStackScroller.setCurrentUserSetup(true); Loading @@ -887,6 +921,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void hasFilteredOutSeenNotifs_updateEmptyShadeView() { mStackScroller.setHasFilteredOutSeenNotifications(true); mStackScroller.updateEmptyShadeView(true, false); Loading Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java +16 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import static kotlinx.coroutines.flow.FlowKt.emptyFlow; import static kotlinx.coroutines.test.TestCoroutineDispatchersKt.StandardTestDispatcher; import android.metrics.LogMaker; import android.platform.test.annotations.DisableFlags; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.view.View; Loading Loading @@ -84,6 +85,7 @@ import com.android.systemui.statusbar.notification.collection.render.SectionHead import com.android.systemui.statusbar.notification.data.repository.ActiveNotificationListRepository; import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor; import com.android.systemui.statusbar.notification.domain.interactor.SeenNotificationsInteractor; import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor; import com.android.systemui.statusbar.notification.init.NotificationsController; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.NotificationGutsManager; Loading Loading @@ -218,6 +220,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_notificationsVisible_zenHiding() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(true); initController(/* viewIsAttached= */ true); Loading @@ -238,6 +241,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_notificationsHidden_zenNotHiding() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); Loading @@ -258,6 +262,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_splitShadeMode_alwaysShowEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); Loading Loading @@ -285,6 +290,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_bouncerShowing_flagOff_hideEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); Loading @@ -306,6 +312,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_bouncerShowing_flagOn_hideEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); Loading @@ -327,6 +334,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_bouncerNotShowing_flagOff_showEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); Loading @@ -348,6 +356,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testUpdateEmptyShadeView_bouncerNotShowing_flagOn_showEmptyView() { when(mZenModeController.areNotificationsHiddenInShade()).thenReturn(false); initController(/* viewIsAttached= */ true); Loading Loading @@ -504,6 +513,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testSetNotifStats_updatesHasFilteredOutSeenNotifications() { initController(/* viewIsAttached= */ true); mSeenNotificationsInteractor.setHasFilteredOutSeenNotifications(true); Loading Loading @@ -545,6 +555,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void updateImportantForAccessibility_noChild_onKeyGuard_notImportantForA11y() { // GIVEN: Controller is attached, active notifications is empty, // and mNotificationStackScrollLayout.onKeyguard() is true Loading @@ -561,6 +572,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void updateImportantForAccessibility_hasChild_onKeyGuard_importantForA11y() { // GIVEN: Controller is attached, active notifications is not empty, // and mNotificationStackScrollLayout.onKeyguard() is true Loading @@ -584,6 +596,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void updateImportantForAccessibility_hasChild_notOnKeyGuard_importantForA11y() { // GIVEN: Controller is attached, active notifications is not empty, // and mNotificationStackScrollLayout.onKeyguard() is false Loading @@ -607,6 +620,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void updateImportantForAccessibility_noChild_notOnKeyGuard_importantForA11y() { // GIVEN: Controller is attached, active notifications is empty, // and mNotificationStackScrollLayout.onKeyguard() is false Loading @@ -623,6 +637,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void updateEmptyShadeView_onKeyguardTransitionToAod_hidesView() { initController(/* viewIsAttached= */ true); mController.onKeyguardTransitionChanged( Loading @@ -633,6 +648,7 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void updateEmptyShadeView_onKeyguardOccludedTransitionToAod_hidesView() { initController(/* viewIsAttached= */ true); mController.onKeyguardTransitionChanged( Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +48 −13 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ import static org.mockito.Mockito.when; import android.graphics.Insets; import android.graphics.Rect; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.EnableFlags; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.testing.TestableResources; Loading Loading @@ -81,6 +83,7 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.render.GroupExpansionManager; import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager; import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor; import com.android.systemui.statusbar.notification.footer.ui.view.FooterView; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.row.ExpandableView; Loading Loading @@ -309,7 +312,9 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { public void updateEmptyView_dndSuppressing() { when(mEmptyShadeView.willBeGone()).thenReturn(true); mStackScroller.updateEmptyShadeView(true, true); mStackScroller.updateEmptyShadeView(/* visible = */ true, /* areNotificationsHiddenInShade = */ true, /* hasFilteredOutSeenNotifications = */ false); verify(mEmptyShadeView).setText(R.string.dnd_suppressing_shade_text); } Loading @@ -319,7 +324,9 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.setEmptyShadeView(mEmptyShadeView); when(mEmptyShadeView.willBeGone()).thenReturn(true); mStackScroller.updateEmptyShadeView(true, false); mStackScroller.updateEmptyShadeView(/* visible = */ true, /* areNotificationsHiddenInShade = */ false, /* hasFilteredOutSeenNotifications = */ false); verify(mEmptyShadeView).setText(R.string.empty_shade_text); } Loading @@ -328,10 +335,14 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { public void updateEmptyView_noNotificationsToDndSuppressing() { mStackScroller.setEmptyShadeView(mEmptyShadeView); when(mEmptyShadeView.willBeGone()).thenReturn(true); mStackScroller.updateEmptyShadeView(true, false); mStackScroller.updateEmptyShadeView(/* visible = */ true, /* areNotificationsHiddenInShade = */ false, /* hasFilteredOutSeenNotifications = */ false); verify(mEmptyShadeView).setText(R.string.empty_shade_text); mStackScroller.updateEmptyShadeView(true, true); mStackScroller.updateEmptyShadeView(/* visible = */ true, /* areNotificationsHiddenInShade = */ true, /* hasFilteredOutSeenNotifications = */ false); verify(mEmptyShadeView).setText(R.string.dnd_suppressing_shade_text); } Loading Loading @@ -385,8 +396,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.setExpandedHeight(100f); } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void manageNotifications_visible() { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); Loading @@ -399,6 +410,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void clearAll_visible() { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); Loading @@ -411,6 +423,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testInflateFooterView() { mStackScroller.inflateFooterView(); ArgumentCaptor<FooterView> captor = ArgumentCaptor.forClass(FooterView.class); Loading Loading @@ -444,7 +457,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); mStackScroller.updateFooter(); verify(mStackScroller).updateFooterView(false, true, true); verify(mStackScroller, atLeastOnce()).updateFooterView(false, true, true); } @Test Loading @@ -459,7 +472,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); mStackScroller.updateFooter(); verify(mStackScroller).updateFooterView(false, false, true); verify(mStackScroller, atLeastOnce()).updateFooterView(false, false, true); } @Test Loading @@ -474,7 +487,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); mStackScroller.updateFooter(); verify(mStackScroller).updateFooterView(true, true, true); verify(mStackScroller, atLeastOnce()).updateFooterView(true, true, true); } @Test Loading @@ -490,7 +503,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); mStackScroller.updateFooter(); verify(mStackScroller).updateFooterView(true, true, false); verify(mStackScroller, atLeastOnce()).updateFooterView(true, true, false); } @Test Loading @@ -505,7 +518,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); mStackScroller.updateFooter(); verify(mStackScroller).updateFooterView(false, true, true); verify(mStackScroller, atLeastOnce()).updateFooterView(false, true, true); } @Test Loading @@ -521,7 +534,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); mStackScroller.updateFooter(); verify(mStackScroller).updateFooterView(true, false, true); verify(mStackScroller, atLeastOnce()).updateFooterView(true, false, true); } @Test Loading @@ -529,7 +542,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.setCurrentUserSetup(true); // add footer mStackScroller.inflateFooterView(); FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); // add notification ExpandableNotificationRow row = createClearableRow(); Loading @@ -545,6 +559,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void testReInflatesFooterViews() { when(mEmptyShadeView.getTextResource()).thenReturn(R.string.empty_shade_text); clearInvocations(mStackScroller); Loading @@ -553,6 +568,16 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { verify(mStackScroller).setEmptyShadeView(any()); } @Test @EnableFlags(FooterViewRefactor.FLAG_NAME) public void testReInflatesEmptyShadeView() { when(mEmptyShadeView.getTextResource()).thenReturn(R.string.empty_shade_text); clearInvocations(mStackScroller); mStackScroller.reinflateViews(); verify(mStackScroller, never()).setFooterView(any()); verify(mStackScroller).setEmptyShadeView(any()); } @Test public void testSetIsBeingDraggedResetsExposedMenu() { mStackScroller.setIsBeingDragged(true); Loading Loading @@ -601,6 +626,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testClearNotifications_clearAllInProgress() { mFeatureFlags.set(Flags.ENABLE_NOTIFICATIONS_SIMULATE_SLOW_MEASURE, false); ExpandableNotificationRow row = createClearableRow(); when(row.getEntry().hasFinishedInitialization()).thenReturn(true); doReturn(true).when(mStackScroller).isVisible(row); Loading Loading @@ -645,6 +672,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testAddNotificationUpdatesSpeedBumpIndex() { mFeatureFlags.set(Flags.ENABLE_NOTIFICATIONS_SIMULATE_SLOW_MEASURE, false); // initial state calculated == 0 assertEquals(0, mStackScroller.getSpeedBumpIndex()); Loading @@ -661,6 +690,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testAddAmbientNotificationNoSpeedBumpUpdate() { mFeatureFlags.set(Flags.ENABLE_NOTIFICATIONS_SIMULATE_SLOW_MEASURE, false); // initial state calculated == 0 assertEquals(0, mStackScroller.getSpeedBumpIndex()); Loading @@ -677,6 +708,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testRemoveNotificationUpdatesSpeedBump() { mFeatureFlags.set(Flags.ENABLE_NOTIFICATIONS_SIMULATE_SLOW_MEASURE, false); // initial state calculated == 0 assertEquals(0, mStackScroller.getSpeedBumpIndex()); Loading Loading @@ -872,6 +905,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void hasFilteredOutSeenNotifs_updateFooter() { mStackScroller.setCurrentUserSetup(true); Loading @@ -887,6 +921,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) public void hasFilteredOutSeenNotifs_updateEmptyShadeView() { mStackScroller.setHasFilteredOutSeenNotifications(true); mStackScroller.updateEmptyShadeView(true, false); Loading