Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2cd36566 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Re-enable and fix failing tests in NotificationStackScrollLayoutTest"...

Merge "Re-enable and fix failing tests in NotificationStackScrollLayoutTest" into udc-dev am: 9a5bc75e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23583976



Change-Id: I5984e447dad6c9d82cf18bcdccbff6974a982f49
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 43beb576 9a5bc75e
Loading
Loading
Loading
Loading
+2 −17
Original line number Original line Diff line number Diff line
@@ -89,7 +89,6 @@ import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController


import org.junit.Assert;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runner.RunWith;
@@ -103,7 +102,6 @@ import java.util.ArrayList;
/**
/**
 * Tests for {@link NotificationStackScrollLayout}.
 * Tests for {@link NotificationStackScrollLayout}.
 */
 */
@Ignore("b/255552856")
@SmallTest
@SmallTest
@RunWith(AndroidTestingRunner.class)
@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
@TestableLooper.RunWithLooper
@@ -374,20 +372,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
        mStackScroller.setExpandedHeight(expectedHeight);
        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
    @Test
    public void testAppearFractionCalculationIsNotNegativeWhenShelfBecomesSmaller() {
    public void testAppearFractionCalculationIsNotNegativeWhenShelfBecomesSmaller() {
        // this situation might occur if status bar height is defined in pixels while shelf height
        // this situation might occur if status bar height is defined in pixels while shelf height
@@ -590,6 +574,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {


    @Test
    @Test
    public void testReInflatesFooterViews() {
    public void testReInflatesFooterViews() {
        when(mEmptyShadeView.getTextResource()).thenReturn(R.string.empty_shade_text);
        clearInvocations(mStackScroller);
        clearInvocations(mStackScroller);
        mStackScroller.reinflateViews();
        mStackScroller.reinflateViews();
        verify(mStackScroller).setFooterView(any());
        verify(mStackScroller).setFooterView(any());
@@ -916,7 +901,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
        mStackScroller.setHasFilteredOutSeenNotifications(true);
        mStackScroller.setHasFilteredOutSeenNotifications(true);
        mStackScroller.updateEmptyShadeView(true, false);
        mStackScroller.updateEmptyShadeView(true, false);


        verify(mEmptyShadeView).setFooterText(not(0));
        verify(mEmptyShadeView).setFooterText(not(eq(0)));
    }
    }


    @Test
    @Test