Merge "Unmocking SurfacePackage in AdminSecondaryLockScreenControllerTest.java" into udc-qpr-dev am: ed773a0dcf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23728010

Change-Id: I51377dc5ee7210b08a221eb33b9cf1763b4523a3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Vinícius Julião
2023-07-13 19:08:21 +00:00
committed by Automerger Merge Worker

View File

@@ -33,12 +33,15 @@ import android.app.admin.IKeyguardCallback;
import android.app.admin.IKeyguardClient; import android.app.admin.IKeyguardClient;
import android.content.ComponentName; import android.content.ComponentName;
import android.content.Intent; import android.content.Intent;
import android.hardware.display.DisplayManager;
import android.os.Binder;
import android.os.Handler; import android.os.Handler;
import android.os.RemoteException; import android.os.RemoteException;
import android.testing.AndroidTestingRunner; import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper; import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper; import android.testing.TestableLooper.RunWithLooper;
import android.testing.ViewUtils; import android.testing.ViewUtils;
import android.view.Display;
import android.view.SurfaceControlViewHost; import android.view.SurfaceControlViewHost;
import android.view.SurfaceView; import android.view.SurfaceView;
import android.view.View; import android.view.View;
@@ -50,7 +53,6 @@ import com.android.systemui.SysuiTestCase;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;
@@ -60,7 +62,6 @@ import org.mockito.MockitoAnnotations;
@RunWithLooper @RunWithLooper
@RunWith(AndroidTestingRunner.class) @RunWith(AndroidTestingRunner.class)
@SmallTest @SmallTest
@Ignore("b/286245842")
public class AdminSecondaryLockScreenControllerTest extends SysuiTestCase { public class AdminSecondaryLockScreenControllerTest extends SysuiTestCase {
private static final int TARGET_USER_ID = KeyguardUpdateMonitor.getCurrentUser(); private static final int TARGET_USER_ID = KeyguardUpdateMonitor.getCurrentUser();
@@ -79,7 +80,7 @@ public class AdminSecondaryLockScreenControllerTest extends SysuiTestCase {
private KeyguardSecurityCallback mKeyguardCallback; private KeyguardSecurityCallback mKeyguardCallback;
@Mock @Mock
private KeyguardUpdateMonitor mUpdateMonitor; private KeyguardUpdateMonitor mUpdateMonitor;
@Mock
private SurfaceControlViewHost.SurfacePackage mSurfacePackage; private SurfaceControlViewHost.SurfacePackage mSurfacePackage;
@Before @Before
@@ -99,6 +100,11 @@ public class AdminSecondaryLockScreenControllerTest extends SysuiTestCase {
when(mKeyguardClient.queryLocalInterface(anyString())).thenReturn(mKeyguardClient); when(mKeyguardClient.queryLocalInterface(anyString())).thenReturn(mKeyguardClient);
when(mKeyguardClient.asBinder()).thenReturn(mKeyguardClient); when(mKeyguardClient.asBinder()).thenReturn(mKeyguardClient);
Display display = mContext.getSystemService(DisplayManager.class).getDisplay(
Display.DEFAULT_DISPLAY);
mSurfacePackage = (new SurfaceControlViewHost(mContext, display,
new Binder())).getSurfacePackage();
mTestController = new AdminSecondaryLockScreenController.Factory( mTestController = new AdminSecondaryLockScreenController.Factory(
mContext, mKeyguardSecurityContainer, mUpdateMonitor, mHandler) mContext, mKeyguardSecurityContainer, mUpdateMonitor, mHandler)
.create(mKeyguardCallback); .create(mKeyguardCallback);