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

Commit cdad37b0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix TopLineView NPR in NotificationContentViewTest" into main

parents 6883dcb3 cd152d93
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.service.notification.StatusBarNotification
import android.testing.TestableLooper
import android.testing.ViewUtils
import android.view.NotificationHeaderView
import android.view.NotificationTopLineView
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
@@ -284,7 +285,7 @@ class NotificationContentViewTest : SysuiTestCase() {
        val icon =
            FeedbackIcon(
                R.drawable.ic_feedback_alerted,
                R.string.notification_feedback_indicator_alerted
                R.string.notification_feedback_indicator_alerted,
            )
        view.setFeedbackIcon(icon)

@@ -305,10 +306,7 @@ class NotificationContentViewTest : SysuiTestCase() {
        val mockHeadsUpEB = mock<NotificationExpandButton>()
        val mockHeadsUp = createMockNotificationHeaderView(contractedHeight, mockHeadsUpEB)

        val view =
            createContentView(
                isSystemExpanded = false,
            )
        val view = createContentView(isSystemExpanded = false)

        // Update all 3 child forms
        view.apply {
@@ -333,12 +331,14 @@ class NotificationContentViewTest : SysuiTestCase() {

    private fun createMockNotificationHeaderView(
        height: Int,
        mockExpandedEB: NotificationExpandButton
        mockExpandedEB: NotificationExpandButton,
    ) =
        spy(NotificationHeaderView(mContext, /* attrs= */ null).apply { minimumHeight = height })
            .apply {
                whenever(this.animate()).thenReturn(mock())
                whenever(this.findViewById<View>(R.id.expand_button)).thenReturn(mockExpandedEB)
                whenever(this.findViewById<View>(R.id.notification_top_line))
                    .thenReturn(mock<NotificationTopLineView>())
            }

    @Test
@@ -358,7 +358,7 @@ class NotificationContentViewTest : SysuiTestCase() {
                isSystemExpanded = false,
                contractedView = mockContracted,
                expandedView = mockExpanded,
                headsUpView = mockHeadsUp
                headsUpView = mockHeadsUp,
            )

        view.setRemoteInputVisible(true)
@@ -387,7 +387,7 @@ class NotificationContentViewTest : SysuiTestCase() {
                isSystemExpanded = false,
                contractedView = mockContracted,
                expandedView = mockExpanded,
                headsUpView = mockHeadsUp
                headsUpView = mockHeadsUp,
            )

        view.setRemoteInputVisible(false)
@@ -649,7 +649,7 @@ class NotificationContentViewTest : SysuiTestCase() {
        contractedView: View = createViewWithHeight(contractedHeight),
        expandedView: View = createViewWithHeight(expandedHeight),
        headsUpView: View = createViewWithHeight(contractedHeight),
        row: ExpandableNotificationRow = this.row
        row: ExpandableNotificationRow = this.row,
    ): NotificationContentView {
        val height = if (isSystemExpanded) expandedHeight else contractedHeight
        doReturn(height).whenever(row).intrinsicHeight
@@ -661,7 +661,7 @@ class NotificationContentViewTest : SysuiTestCase() {
                setHeights(
                    /* smallHeight= */ contractedHeight,
                    /* headsUpMaxHeight= */ contractedHeight,
                    /* maxHeight= */ expandedHeight
                    /* maxHeight= */ expandedHeight,
                )
                contractedChild = contractedView
                expandedChild = expandedView