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

Commit 4d6eb9b0 authored by Matías Hernández's avatar Matías Hernández Committed by Automerger Merge Worker
Browse files

Merge "Replace mocked loggers by real ones in SystemUI tests" into udc-qpr-dev am: 3eabcfed

parents 3d7773c6 3eabcfed
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import com.android.systemui.log.LogcatEchoTracker
/**
 * Creates a LogBuffer that will echo everything to logcat, which is useful for debugging tests.
 */
@JvmOverloads
fun logcatLogBuffer(name: String = "EchoToLogcatLogBuffer") =
    LogBuffer(name, 50, LogcatEchoTrackerAlways())

+4 −3
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.shade;
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;

import static com.android.keyguard.KeyguardClockSwitch.LARGE;
import static com.android.systemui.dump.LogBufferHelperKt.logcatLogBuffer;

import static com.google.common.truth.Truth.assertThat;

@@ -221,7 +222,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
    @Mock protected StatusBarTouchableRegionManager mStatusBarTouchableRegionManager;
    @Mock protected KeyguardStateController mKeyguardStateController;
    @Mock protected DozeLog mDozeLog;
    @Mock protected ShadeLogger mShadeLog;
    private final ShadeLogger mShadeLog = new ShadeLogger(logcatLogBuffer());
    @Mock protected CommandQueue mCommandQueue;
    @Mock protected VibratorHelper mVibratorHelper;
    @Mock protected LatencyTracker mLatencyTracker;
@@ -309,7 +310,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
    @Mock protected MotionEvent mDownMotionEvent;
    @Mock protected CoroutineDispatcher mMainDispatcher;
    @Mock protected KeyguardSliceViewController mKeyguardSliceViewController;
    @Mock protected KeyguardLogger mKeyguardLogger;
    private final KeyguardLogger mKeyguardLogger = new KeyguardLogger(logcatLogBuffer());
    @Mock protected KeyguardStatusView mKeyguardStatusView;
    @Captor
    protected ArgumentCaptor<NotificationStackScrollLayout.OnEmptySpaceClickListener>
@@ -518,7 +519,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
                        mKeyguardBypassController,
                        mDozeParameters,
                        mScreenOffAnimationController,
                        mock(NotificationWakeUpCoordinatorLogger.class));
                        new NotificationWakeUpCoordinatorLogger(logcatLogBuffer()));
        mConfigurationController = new ConfigurationControllerImpl(mContext);
        PulseExpansionHandler expansionHandler = new PulseExpansionHandler(
                mContext,
+2 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.statusbar;

import static android.app.Notification.FLAG_FSI_REQUESTED_BUT_DENIED;

import static com.android.systemui.dump.LogBufferHelperKt.logcatLogBuffer;
import static com.android.systemui.statusbar.notification.row.NotificationRowContentBinder.FLAG_CONTENT_VIEW_CONTRACTED;

import static junit.framework.Assert.assertFalse;
@@ -45,7 +46,6 @@ import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.policy.HeadsUpManager;
import com.android.systemui.statusbar.policy.HeadsUpManagerLogger;

import org.junit.After;
@@ -88,7 +88,7 @@ public class AlertingNotificationManagerTest extends SysuiTestCase {
        private AlertEntry mLastCreatedEntry;

        private TestableAlertingNotificationManager(Handler handler) {
            super(mock(HeadsUpManagerLogger.class), handler);
            super(new HeadsUpManagerLogger(logcatLogBuffer()), handler);
            mMinimumDisplayTime = TEST_MINIMUM_DISPLAY_TIME;
            mStickyDisplayTime = TEST_STICKY_DISPLAY_TIME;
            mAutoDismissNotificationDecay = TEST_AUTO_DISMISS_TIME;
+4 −2
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.statusbar;

import static com.android.systemui.dump.LogBufferHelperKt.logcatLogBuffer;

import static junit.framework.Assert.assertTrue;

import static org.mockito.Mockito.mock;
@@ -82,9 +84,9 @@ public class NotificationRemoteInputManagerTest extends SysuiTestCase {
                mPowerInteractor,
                mStateController,
                mRemoteInputUriController,
                mock(RemoteInputControllerLogger.class),
                new RemoteInputControllerLogger(logcatLogBuffer()),
                mClickNotifier,
                mock(ActionClickLogger.class),
                new ActionClickLogger(logcatLogBuffer()),
                mock(DumpManager.class));
        mEntry = new NotificationEntryBuilder()
                .setPkg(TEST_PACKAGE_NAME)
+2 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import androidx.core.animation.AnimatorTestRule
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.dump.DumpManager
import com.android.systemui.dump.logcatLogBuffer
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.shade.ShadeViewController.Companion.WAKEUP_ANIMATION_DELAY_MS
import com.android.systemui.statusbar.StatusBarState
@@ -59,7 +60,7 @@ class NotificationWakeUpCoordinatorTest : SysuiTestCase() {
    private val bypassController: KeyguardBypassController = mock()
    private val dozeParameters: DozeParameters = mock()
    private val screenOffAnimationController: ScreenOffAnimationController = mock()
    private val logger: NotificationWakeUpCoordinatorLogger = mock()
    private val logger = NotificationWakeUpCoordinatorLogger(logcatLogBuffer())
    private val stackScrollerController: NotificationStackScrollLayoutController = mock()
    private val wakeUpListener: NotificationWakeUpCoordinator.WakeUpListener = mock()

Loading