summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Priyanka Advani <padvani@google.com> 2023-06-07 03:17:00 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-06-07 03:17:00 +0000
commit687564abc82d8fd58e6eb0b14d45cdfa419da62b (patch)
tree9e67159987affcfea219d66bfbf4a4179ab7f79b
parent31fce85ddeef29c41882a6d5f49cb0ee64db2ae9 (diff)
parentec8e33f11d7897091dc921395d79666a550ec220 (diff)
Merge "Revert "Re-enable and fix failing tests in NotificationStackScrollLayoutTest"" into udc-dev am: 5f870b3826 am: ec8e33f11d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23595911 Change-Id: I290eadf5762e202a10b2f07ac86ecc5137dd2097 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java19
1 files changed, 17 insertions, 2 deletions
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 faef5b44071d..ee02a7b6e090 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
@@ -89,6 +89,7 @@ import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController
import org.junit.Assert;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -102,6 +103,7 @@ import java.util.ArrayList;
/**
* Tests for {@link NotificationStackScrollLayout}.
*/
+@Ignore("b/255552856")
@SmallTest
@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
@@ -373,6 +375,20 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
}
@Test
+ public void testAppearFractionCalculation() {
+ // appear start position
+ when(mNotificationShelf.getIntrinsicHeight()).thenReturn(100);
+ // because it's the same as shelf height, appear start position equals shelf height
+ mStackScroller.mStatusBarHeight = 100;
+ // appear end position
+ when(mEmptyShadeView.getHeight()).thenReturn(200);
+
+ assertEquals(0f, mStackScroller.calculateAppearFraction(100));
+ assertEquals(1f, mStackScroller.calculateAppearFraction(200));
+ assertEquals(0.5f, mStackScroller.calculateAppearFraction(150));
+ }
+
+ @Test
public void testAppearFractionCalculationIsNotNegativeWhenShelfBecomesSmaller() {
// this situation might occur if status bar height is defined in pixels while shelf height
// in dp and screen density changes - appear start position
@@ -574,7 +590,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
@Test
public void testReInflatesFooterViews() {
- when(mEmptyShadeView.getTextResource()).thenReturn(R.string.empty_shade_text);
clearInvocations(mStackScroller);
mStackScroller.reinflateViews();
verify(mStackScroller).setFooterView(any());
@@ -901,7 +916,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
mStackScroller.setHasFilteredOutSeenNotifications(true);
mStackScroller.updateEmptyShadeView(true, false);
- verify(mEmptyShadeView).setFooterText(not(eq(0)));
+ verify(mEmptyShadeView).setFooterText(not(0));
}
@Test