Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentViewTest.kt +10 −10 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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) Loading @@ -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 { Loading @@ -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 Loading @@ -358,7 +358,7 @@ class NotificationContentViewTest : SysuiTestCase() { isSystemExpanded = false, contractedView = mockContracted, expandedView = mockExpanded, headsUpView = mockHeadsUp headsUpView = mockHeadsUp, ) view.setRemoteInputVisible(true) Loading Loading @@ -387,7 +387,7 @@ class NotificationContentViewTest : SysuiTestCase() { isSystemExpanded = false, contractedView = mockContracted, expandedView = mockExpanded, headsUpView = mockHeadsUp headsUpView = mockHeadsUp, ) view.setRemoteInputVisible(false) Loading Loading @@ -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 Loading @@ -661,7 +661,7 @@ class NotificationContentViewTest : SysuiTestCase() { setHeights( /* smallHeight= */ contractedHeight, /* headsUpMaxHeight= */ contractedHeight, /* maxHeight= */ expandedHeight /* maxHeight= */ expandedHeight, ) contractedChild = contractedView expandedChild = expandedView Loading Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentViewTest.kt +10 −10 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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) Loading @@ -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 { Loading @@ -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 Loading @@ -358,7 +358,7 @@ class NotificationContentViewTest : SysuiTestCase() { isSystemExpanded = false, contractedView = mockContracted, expandedView = mockExpanded, headsUpView = mockHeadsUp headsUpView = mockHeadsUp, ) view.setRemoteInputVisible(true) Loading Loading @@ -387,7 +387,7 @@ class NotificationContentViewTest : SysuiTestCase() { isSystemExpanded = false, contractedView = mockContracted, expandedView = mockExpanded, headsUpView = mockHeadsUp headsUpView = mockHeadsUp, ) view.setRemoteInputVisible(false) Loading Loading @@ -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 Loading @@ -661,7 +661,7 @@ class NotificationContentViewTest : SysuiTestCase() { setHeights( /* smallHeight= */ contractedHeight, /* headsUpMaxHeight= */ contractedHeight, /* maxHeight= */ expandedHeight /* maxHeight= */ expandedHeight, ) contractedChild = contractedView expandedChild = expandedView Loading