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

Commit 1352d2c2 authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

Use new layouts in guts tests

Bug: 394822197
Test: presubmit
Flag: android.app.notifications_redesign_templates
Change-Id: I7e62a52a044888319425fcde78d57d76cb06a7f9
parent 19543611
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -125,7 +125,10 @@ class NotificationInfoTest : SysuiTestCase() {

        // Inflate the layout
        val inflater = LayoutInflater.from(mContext)
        underTest = inflater.inflate(R.layout.notification_info, null) as NotificationInfo
        val layoutId =
            if (Flags.notificationsRedesignTemplates()) R.layout.notification_2025_info
            else R.layout.notification_info
        underTest = inflater.inflate(layoutId, null) as NotificationInfo

        underTest.setGutsParent(mock<NotificationGuts>())

+5 −2
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import android.app.Flags;
import android.app.INotificationManager;
import android.app.Notification;
import android.app.NotificationChannel;
@@ -40,7 +41,6 @@ import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.os.UserHandle;
import android.service.notification.NotificationListenerService;
import android.service.notification.StatusBarNotification;
import android.testing.TestableLooper;
import android.text.SpannableString;
@@ -109,7 +109,10 @@ public class PartialConversationInfoTest extends SysuiTestCase {
        mDependency.injectTestDependency(MetricsLogger.class, mMetricsLogger);
        // Inflate the layout
        final LayoutInflater layoutInflater = LayoutInflater.from(mContext);
        mInfo = (PartialConversationInfo) layoutInflater.inflate(R.layout.partial_conversation_info,
        int layoutId = Flags.notificationsRedesignTemplates()
                ? R.layout.notification_2025_partial_conversation_info
                : R.layout.partial_conversation_info;
        mInfo = (PartialConversationInfo) layoutInflater.inflate(layoutId,
                null);
        mInfo.setGutsParent(mock(NotificationGuts.class));
        // Our view is never attached to a window so the View#post methods in NotificationInfo never
+4 −1
Original line number Diff line number Diff line
@@ -190,8 +190,11 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
        mDependency.injectTestDependency(ShadeController.class, mShadeController);
        // Inflate the layout
        final LayoutInflater layoutInflater = LayoutInflater.from(mContext);
        int layoutId = Flags.notificationsRedesignTemplates()
                ? R.layout.notification_2025_conversation_info
                : R.layout.notification_conversation_info;
        mNotificationInfo = (NotificationConversationInfo) layoutInflater.inflate(
                R.layout.notification_conversation_info,
                layoutId,
                null);
        mNotificationInfo.setGutsParent(mNotificationGuts);
        doAnswer((Answer<Object>) invocation -> {