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

Commit 668918cc authored by Will Leshner's avatar Will Leshner
Browse files

Fix DreamOverlayContainerViewControllerTests.

Bug: 341613855
Test: atest DreamOverlayContainerViewControllerTest
Flag: android.service.dreams.dream_handles_being_obscured
Change-Id: I18030f3a3214d41b6bd9079615fb5ea0e009828d
parent 6b2a3990
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.dreams;

import static kotlinx.coroutines.flow.FlowKt.emptyFlow;
import static kotlinx.coroutines.flow.StateFlowKt.MutableStateFlow;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
@@ -144,6 +145,8 @@ public class DreamOverlayContainerViewControllerTest extends SysuiTestCase {
        when(mDreamOverlayContainerView.getRootSurfaceControl())
                .thenReturn(mAttachedSurfaceControl);
        when(mKeyguardTransitionInteractor.isFinishedInStateWhere(any())).thenReturn(emptyFlow());
        when(mShadeInteractor.isAnyExpanded()).thenReturn(MutableStateFlow(false));
        when(mCommunalInteractor.isCommunalShowing()).thenReturn(MutableStateFlow(false));

        mController = new DreamOverlayContainerViewController(
                mDreamOverlayContainerView,
@@ -325,4 +328,12 @@ public class DreamOverlayContainerViewControllerTest extends SysuiTestCase {
        mController.onViewDetached();
        verify(mBouncerlessScrimController).removeCallback(any());
    }

    @EnableFlags(android.service.dreams.Flags.FLAG_DREAM_HANDLES_BEING_OBSCURED)
    @Test
    public void testOnViewAttachedSucceedsWhenDreamHandlesBeingObscuredFlagEnabled() {
        // This test will catch failures in presubmit when the dream_handles_being_obscured flag is
        // enabled.
        mController.onViewAttached();
    }
}