summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ioana Alexandru <aioana@google.com> 2024-10-30 14:14:26 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-10-30 14:14:26 +0000
commit32230acd29e780ab7cadf3de9bb22724ea70ce66 (patch)
tree3f4644892ac6cea92bf9930ca988b205546b3d71
parentd52ee8a62b8a636896c6e0891b206cf3ce17a332 (diff)
parent52756ccbb551c764ece17f3c5fa2aab4ace0a838 (diff)
Merge "Add test annotations for footer redesign" into main
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterViewTest.java37
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java23
2 files changed, 35 insertions, 25 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterViewTest.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterViewTest.java
index a21ca9458b00..c9ca67e6af94 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterViewTest.java
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterViewTest.java
@@ -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) {
@@ -74,8 +76,13 @@ public class FooterViewTest extends SysuiTestCase {
@Before
public void setUp() {
- mView = (FooterView) LayoutInflater.from(mSpyContext).inflate(
- R.layout.status_bar_notification_footer, null, false);
+ 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);
}
@@ -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());
@@ -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());
@@ -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);
@@ -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;
@@ -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);
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -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;
@@ -310,4 +320,3 @@ public class FooterViewTest extends SysuiTestCase {
.isEqualTo(View.GONE);
}
}
-
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
index fdfc25390a3f..06e8b1cf8dab 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
@@ -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;
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);