From b4cac546539c7004c6074030d077f8dac758ffa6 Mon Sep 17 00:00:00 2001 From: Priyanka Advani Date: Wed, 7 Jun 2023 01:25:10 +0000 Subject: [PATCH] Revert "Re-enable and fix failing tests in NotificationStackScrollLayoutTest" This reverts commit d528756a474b96544341c52df9084f2afe648ae1. Reason for revert: b/286093328 Change-Id: I10122c420ad84a40aac12742bbc4f911f1d87b0b --- .../NotificationStackScrollLayoutTest.java | 19 +++++++++++++++++-- 1 file 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 13501f3e25601..a4ee349f5b710 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 @@ -88,6 +88,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; @@ -101,6 +102,7 @@ import java.util.ArrayList; /** * Tests for {@link NotificationStackScrollLayout}. */ +@Ignore("b/255552856") @SmallTest @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper @@ -371,6 +373,20 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.setExpandedHeight(expectedHeight); } + @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 @@ -576,7 +592,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()); @@ -859,7 +874,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