Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java +31 −5 Original line number Diff line number Diff line Loading @@ -995,18 +995,35 @@ public class CentralSurfacesImplTest extends SysuiTestCase { } @Test public void testOnStartedWakingUp_isNotDozing() { @DisableSceneContainer public void testOnStartedWakingUp_isNotDozing_withoutSceneContainer() { testOnStartedWakingUp_isNotDozing(true); } @Test @EnableSceneContainer public void testOnStartedWakingUp_isNotDozing_withSceneContainer() { // When the scene framework is enabled, the ShadeController implementation does nothing when // told to instantly expand the shade. testOnStartedWakingUp_isNotDozing(/* verifyNpvcExpandInvocations= */ false); } private void testOnStartedWakingUp_isNotDozing(boolean verifyNpvcExpandInvocations) { mCentralSurfaces.setBarStateForTest(StatusBarState.KEYGUARD); when(mStatusBarStateController.isKeyguardRequested()).thenReturn(true); when(mDozeServiceHost.getDozingRequested()).thenReturn(true); mCentralSurfaces.updateIsKeyguard(); if (verifyNpvcExpandInvocations) { // TODO: mNotificationPanelView.expand(false) gets called twice. Should be once. verify(mNotificationPanelViewController, times(2)).expand(eq(false)); clearInvocations(mNotificationPanelViewController); } mCentralSurfaces.mWakefulnessObserver.onStartedWakingUp(); verify(mDozeServiceHost, never()).stopDozing(); if (verifyNpvcExpandInvocations) { verify(mNotificationPanelViewController).expand(eq(false)); } mCentralSurfaces.mWakefulnessObserver.onFinishedWakingUp(); verify(mDozeServiceHost).stopDozing(); } Loading Loading @@ -1044,6 +1061,9 @@ public class CentralSurfacesImplTest extends SysuiTestCase { } @Test // When the scene framework is enabled, setting the "leave open" bit is handled in // SceneContainerStartable @DisableSceneContainer public void deviceStateChange_unfolded_shadeOpen_setsLeaveOpenOnKeyguardHide() { setFoldedStates(FOLD_STATE_FOLDED.getIdentifier()); setGoToSleepStates(FOLD_STATE_FOLDED.getIdentifier()); Loading Loading @@ -1081,6 +1101,9 @@ public class CentralSurfacesImplTest extends SysuiTestCase { } @Test // When the scene framework is enabled, closing QS based on screen power happens in // SceneContainerStartable @DisableSceneContainer public void deviceStateChange_unfolded_shadeExpanding_onKeyguard_closesQS() { setFoldedStates(FOLD_STATE_FOLDED.getIdentifier()); setGoToSleepStates(FOLD_STATE_FOLDED.getIdentifier()); Loading @@ -1094,6 +1117,9 @@ public class CentralSurfacesImplTest extends SysuiTestCase { } @Test // When the scene framework is enabled, closing QS based on screen power happens in // SceneContainerStartable @DisableSceneContainer public void deviceStateChange_unfolded_shadeExpanded_onKeyguard_closesQS() { setFoldedStates(FOLD_STATE_FOLDED.getIdentifier()); setGoToSleepStates(FOLD_STATE_FOLDED.getIdentifier()); Loading Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java +31 −5 Original line number Diff line number Diff line Loading @@ -995,18 +995,35 @@ public class CentralSurfacesImplTest extends SysuiTestCase { } @Test public void testOnStartedWakingUp_isNotDozing() { @DisableSceneContainer public void testOnStartedWakingUp_isNotDozing_withoutSceneContainer() { testOnStartedWakingUp_isNotDozing(true); } @Test @EnableSceneContainer public void testOnStartedWakingUp_isNotDozing_withSceneContainer() { // When the scene framework is enabled, the ShadeController implementation does nothing when // told to instantly expand the shade. testOnStartedWakingUp_isNotDozing(/* verifyNpvcExpandInvocations= */ false); } private void testOnStartedWakingUp_isNotDozing(boolean verifyNpvcExpandInvocations) { mCentralSurfaces.setBarStateForTest(StatusBarState.KEYGUARD); when(mStatusBarStateController.isKeyguardRequested()).thenReturn(true); when(mDozeServiceHost.getDozingRequested()).thenReturn(true); mCentralSurfaces.updateIsKeyguard(); if (verifyNpvcExpandInvocations) { // TODO: mNotificationPanelView.expand(false) gets called twice. Should be once. verify(mNotificationPanelViewController, times(2)).expand(eq(false)); clearInvocations(mNotificationPanelViewController); } mCentralSurfaces.mWakefulnessObserver.onStartedWakingUp(); verify(mDozeServiceHost, never()).stopDozing(); if (verifyNpvcExpandInvocations) { verify(mNotificationPanelViewController).expand(eq(false)); } mCentralSurfaces.mWakefulnessObserver.onFinishedWakingUp(); verify(mDozeServiceHost).stopDozing(); } Loading Loading @@ -1044,6 +1061,9 @@ public class CentralSurfacesImplTest extends SysuiTestCase { } @Test // When the scene framework is enabled, setting the "leave open" bit is handled in // SceneContainerStartable @DisableSceneContainer public void deviceStateChange_unfolded_shadeOpen_setsLeaveOpenOnKeyguardHide() { setFoldedStates(FOLD_STATE_FOLDED.getIdentifier()); setGoToSleepStates(FOLD_STATE_FOLDED.getIdentifier()); Loading Loading @@ -1081,6 +1101,9 @@ public class CentralSurfacesImplTest extends SysuiTestCase { } @Test // When the scene framework is enabled, closing QS based on screen power happens in // SceneContainerStartable @DisableSceneContainer public void deviceStateChange_unfolded_shadeExpanding_onKeyguard_closesQS() { setFoldedStates(FOLD_STATE_FOLDED.getIdentifier()); setGoToSleepStates(FOLD_STATE_FOLDED.getIdentifier()); Loading @@ -1094,6 +1117,9 @@ public class CentralSurfacesImplTest extends SysuiTestCase { } @Test // When the scene framework is enabled, closing QS based on screen power happens in // SceneContainerStartable @DisableSceneContainer public void deviceStateChange_unfolded_shadeExpanded_onKeyguard_closesQS() { setFoldedStates(FOLD_STATE_FOLDED.getIdentifier()); setGoToSleepStates(FOLD_STATE_FOLDED.getIdentifier()); Loading