Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterViewTest.java +23 −14 Original line number Diff line number Diff line Loading @@ -45,23 +45,25 @@ import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import com.android.systemui.res.R; import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor; import com.android.systemui.statusbar.notification.footer.shared.NotifRedesignFooter; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import java.util.List; import platform.test.runner.parameterized.ParameterizedAndroidJunit4; import platform.test.runner.parameterized.Parameters; import java.util.List; @SmallTest @RunWith(ParameterizedAndroidJunit4.class) public class FooterViewTest extends SysuiTestCase { @Parameters(name = "{0}") public static List<FlagsParameterization> getFlags() { return FlagsParameterization.allCombinationsOf(FooterViewRefactor.FLAG_NAME); return FlagsParameterization.progressionOf(FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME); } public FooterViewTest(FlagsParameterization flags) { Loading @@ -74,8 +76,13 @@ public class FooterViewTest extends SysuiTestCase { @Before public void setUp() { if (NotifRedesignFooter.isEnabled()) { mView = (FooterView) LayoutInflater.from(mSpyContext).inflate( R.layout.status_bar_notification_footer_redesign, null, false); } else { mView = (FooterView) LayoutInflater.from(mSpyContext).inflate( R.layout.status_bar_notification_footer, null, false); } mView.setAnimationDuration(0); } Loading @@ -92,13 +99,14 @@ public class FooterViewTest extends SysuiTestCase { } @Test @DisableFlags(NotifRedesignFooter.FLAG_NAME) public void setManageOnClick() { mView.setManageButtonClickListener(mock(View.OnClickListener.class)); assertTrue(mView.findViewById(R.id.manage_text).hasOnClickListeners()); } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void setHistoryShown() { mView.showHistory(true); assertTrue(mView.isHistoryShown()); Loading @@ -107,7 +115,7 @@ public class FooterViewTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void setHistoryNotShown() { mView.showHistory(false); assertFalse(mView.isHistoryShown()); Loading @@ -133,6 +141,7 @@ public class FooterViewTest extends SysuiTestCase { @Test @EnableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags(NotifRedesignFooter.FLAG_NAME) public void testSetManageOrHistoryButtonText_resourceOnlyFetchedOnce() { int resId = R.string.manage_notifications_history_text; mView.setManageOrHistoryButtonText(resId); Loading @@ -151,7 +160,7 @@ public class FooterViewTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testSetManageOrHistoryButtonText_expectsFlagEnabled() { clearInvocations(mSpyContext); int resId = R.string.manage_notifications_history_text; Loading @@ -161,6 +170,7 @@ public class FooterViewTest extends SysuiTestCase { @Test @EnableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags(NotifRedesignFooter.FLAG_NAME) public void testSetManageOrHistoryButtonDescription_resourceOnlyFetchedOnce() { int resId = R.string.manage_notifications_history_text; mView.setManageOrHistoryButtonDescription(resId); Loading @@ -179,7 +189,7 @@ public class FooterViewTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testSetManageOrHistoryButtonDescription_expectsFlagEnabled() { clearInvocations(mSpyContext); int resId = R.string.accessibility_clear_all; Loading Loading @@ -207,7 +217,7 @@ public class FooterViewTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testSetClearAllButtonText_expectsFlagEnabled() { clearInvocations(mSpyContext); int resId = R.string.clear_all_notifications_text; Loading Loading @@ -235,7 +245,7 @@ public class FooterViewTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testSetClearAllButtonDescription_expectsFlagEnabled() { clearInvocations(mSpyContext); int resId = R.string.accessibility_clear_all; Loading Loading @@ -263,7 +273,7 @@ public class FooterViewTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testSetMessageString_expectsFlagEnabled() { clearInvocations(mSpyContext); int resId = R.string.unlock_to_see_notif_text; Loading @@ -288,7 +298,7 @@ public class FooterViewTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testSetMessageIcon_expectsFlagEnabled() { clearInvocations(mSpyContext); int resId = R.drawable.ic_friction_lock_closed; Loading @@ -310,4 +320,3 @@ public class FooterViewTest extends SysuiTestCase { .isEqualTo(View.GONE); } } packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +12 −11 Original line number Diff line number Diff line Loading @@ -91,6 +91,7 @@ import com.android.systemui.statusbar.notification.collection.render.GroupMember import com.android.systemui.statusbar.notification.emptyshade.shared.ModesEmptyShadeFix; import com.android.systemui.statusbar.notification.emptyshade.ui.view.EmptyShadeView; import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor; import com.android.systemui.statusbar.notification.footer.shared.NotifRedesignFooter; 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 @@ -559,7 +560,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void manageNotifications_visible() { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); Loading @@ -572,7 +573,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void clearAll_visible() { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); Loading @@ -585,7 +586,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testInflateFooterView() { mStackScroller.inflateFooterView(); ArgumentCaptor<FooterView> captor = ArgumentCaptor.forClass(FooterView.class); Loading @@ -596,7 +597,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testUpdateFooter_noNotifications() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); Loading @@ -608,7 +609,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testUpdateFooter_remoteInput() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); Loading @@ -625,7 +626,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testUpdateFooter_withoutNotifications() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); Loading @@ -641,7 +642,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testUpdateFooter_oneClearableNotification() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); Loading @@ -657,7 +658,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testUpdateFooter_withoutHistory() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); Loading @@ -674,7 +675,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testUpdateFooter_oneClearableNotification_beforeUserSetup() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(false); Loading @@ -690,7 +691,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testUpdateFooter_oneNonClearableNotification() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); Loading Loading @@ -1181,7 +1182,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void hasFilteredOutSeenNotifs_updateFooter() { mStackScroller.setCurrentUserSetup(true); Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterViewTest.java +23 −14 Original line number Diff line number Diff line Loading @@ -45,23 +45,25 @@ import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; import com.android.systemui.res.R; import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor; import com.android.systemui.statusbar.notification.footer.shared.NotifRedesignFooter; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import java.util.List; import platform.test.runner.parameterized.ParameterizedAndroidJunit4; import platform.test.runner.parameterized.Parameters; import java.util.List; @SmallTest @RunWith(ParameterizedAndroidJunit4.class) public class FooterViewTest extends SysuiTestCase { @Parameters(name = "{0}") public static List<FlagsParameterization> getFlags() { return FlagsParameterization.allCombinationsOf(FooterViewRefactor.FLAG_NAME); return FlagsParameterization.progressionOf(FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME); } public FooterViewTest(FlagsParameterization flags) { Loading @@ -74,8 +76,13 @@ public class FooterViewTest extends SysuiTestCase { @Before public void setUp() { if (NotifRedesignFooter.isEnabled()) { mView = (FooterView) LayoutInflater.from(mSpyContext).inflate( R.layout.status_bar_notification_footer_redesign, null, false); } else { mView = (FooterView) LayoutInflater.from(mSpyContext).inflate( R.layout.status_bar_notification_footer, null, false); } mView.setAnimationDuration(0); } Loading @@ -92,13 +99,14 @@ public class FooterViewTest extends SysuiTestCase { } @Test @DisableFlags(NotifRedesignFooter.FLAG_NAME) public void setManageOnClick() { mView.setManageButtonClickListener(mock(View.OnClickListener.class)); assertTrue(mView.findViewById(R.id.manage_text).hasOnClickListeners()); } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void setHistoryShown() { mView.showHistory(true); assertTrue(mView.isHistoryShown()); Loading @@ -107,7 +115,7 @@ public class FooterViewTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void setHistoryNotShown() { mView.showHistory(false); assertFalse(mView.isHistoryShown()); Loading @@ -133,6 +141,7 @@ public class FooterViewTest extends SysuiTestCase { @Test @EnableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags(NotifRedesignFooter.FLAG_NAME) public void testSetManageOrHistoryButtonText_resourceOnlyFetchedOnce() { int resId = R.string.manage_notifications_history_text; mView.setManageOrHistoryButtonText(resId); Loading @@ -151,7 +160,7 @@ public class FooterViewTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testSetManageOrHistoryButtonText_expectsFlagEnabled() { clearInvocations(mSpyContext); int resId = R.string.manage_notifications_history_text; Loading @@ -161,6 +170,7 @@ public class FooterViewTest extends SysuiTestCase { @Test @EnableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags(NotifRedesignFooter.FLAG_NAME) public void testSetManageOrHistoryButtonDescription_resourceOnlyFetchedOnce() { int resId = R.string.manage_notifications_history_text; mView.setManageOrHistoryButtonDescription(resId); Loading @@ -179,7 +189,7 @@ public class FooterViewTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testSetManageOrHistoryButtonDescription_expectsFlagEnabled() { clearInvocations(mSpyContext); int resId = R.string.accessibility_clear_all; Loading Loading @@ -207,7 +217,7 @@ public class FooterViewTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testSetClearAllButtonText_expectsFlagEnabled() { clearInvocations(mSpyContext); int resId = R.string.clear_all_notifications_text; Loading Loading @@ -235,7 +245,7 @@ public class FooterViewTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testSetClearAllButtonDescription_expectsFlagEnabled() { clearInvocations(mSpyContext); int resId = R.string.accessibility_clear_all; Loading Loading @@ -263,7 +273,7 @@ public class FooterViewTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testSetMessageString_expectsFlagEnabled() { clearInvocations(mSpyContext); int resId = R.string.unlock_to_see_notif_text; Loading @@ -288,7 +298,7 @@ public class FooterViewTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testSetMessageIcon_expectsFlagEnabled() { clearInvocations(mSpyContext); int resId = R.drawable.ic_friction_lock_closed; Loading @@ -310,4 +320,3 @@ public class FooterViewTest extends SysuiTestCase { .isEqualTo(View.GONE); } }
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +12 −11 Original line number Diff line number Diff line Loading @@ -91,6 +91,7 @@ import com.android.systemui.statusbar.notification.collection.render.GroupMember import com.android.systemui.statusbar.notification.emptyshade.shared.ModesEmptyShadeFix; import com.android.systemui.statusbar.notification.emptyshade.ui.view.EmptyShadeView; import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor; import com.android.systemui.statusbar.notification.footer.shared.NotifRedesignFooter; 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 @@ -559,7 +560,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void manageNotifications_visible() { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); Loading @@ -572,7 +573,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void clearAll_visible() { FooterView view = mock(FooterView.class); mStackScroller.setFooterView(view); Loading @@ -585,7 +586,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testInflateFooterView() { mStackScroller.inflateFooterView(); ArgumentCaptor<FooterView> captor = ArgumentCaptor.forClass(FooterView.class); Loading @@ -596,7 +597,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testUpdateFooter_noNotifications() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); Loading @@ -608,7 +609,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testUpdateFooter_remoteInput() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); Loading @@ -625,7 +626,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testUpdateFooter_withoutNotifications() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); Loading @@ -641,7 +642,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testUpdateFooter_oneClearableNotification() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); Loading @@ -657,7 +658,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testUpdateFooter_withoutHistory() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); Loading @@ -674,7 +675,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testUpdateFooter_oneClearableNotification_beforeUserSetup() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(false); Loading @@ -690,7 +691,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void testUpdateFooter_oneNonClearableNotification() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); Loading Loading @@ -1181,7 +1182,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @DisableFlags(FooterViewRefactor.FLAG_NAME) @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) public void hasFilteredOutSeenNotifs_updateFooter() { mStackScroller.setCurrentUserSetup(true); Loading