Add the remaining locksettings unit tests to presubmit

The locksettings unit tests are fast to run, and most of them were part
of presubmit already, so add the remaining ones to presubmit too.

For consistency, also add @SmallTest and @RunWith(AndroidJUnit4.class)
to tests that lacked them.

(This CL does not consider the recoverablekeystore directory.)

Test: atest com.android.server.locksettings
Change-Id: I301e7fd6f5ac8f9e7e3db1a333c68f67abf8bfc3
This commit is contained in:
Eric Biggers
2022-12-15 23:46:31 +00:00
parent 13101fe9d2
commit 3e79750683
4 changed files with 16 additions and 0 deletions

View File

@@ -39,10 +39,12 @@ import static org.mockito.Mockito.when;
import android.app.AlarmManager;
import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.platform.test.annotations.Presubmit;
import android.util.Log;
import androidx.test.InstrumentationRegistry;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
import com.android.server.locksettings.LockSettingsStrongAuth.NonStrongBiometricIdleTimeoutAlarmListener;
import com.android.server.locksettings.LockSettingsStrongAuth.NonStrongBiometricTimeoutAlarmListener;
@@ -50,10 +52,13 @@ import com.android.server.locksettings.LockSettingsStrongAuth.StrongAuthTimeoutA
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@SmallTest
@Presubmit
@RunWith(AndroidJUnit4.class)
public class LockSettingsStrongAuthTest {
private static final String TAG = LockSettingsStrongAuthTest.class.getSimpleName();

View File

@@ -26,7 +26,9 @@ import static org.junit.Assert.assertEquals;
import android.app.PropertyInvalidatedCache;
import android.app.admin.DevicePolicyManager;
import android.platform.test.annotations.Presubmit;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
import com.android.internal.widget.VerifyCredentialResponse;
@@ -38,6 +40,8 @@ import org.junit.runner.RunWith;
/** Test setting a lockscreen credential and then verify it under USER_FRP */
@SmallTest
@Presubmit
@RunWith(AndroidJUnit4.class)
public class LockscreenFrpTest extends BaseLockSettingsServiceTests {

View File

@@ -19,6 +19,9 @@ package com.android.server.locksettings;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import android.platform.test.annotations.Presubmit;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Before;
@@ -34,6 +37,8 @@ import javax.crypto.spec.SecretKeySpec;
/**
* atest FrameworksServicesTests:RebootEscrowDataTest
*/
@SmallTest
@Presubmit
@RunWith(AndroidJUnit4.class)
public class RebootEscrowDataTest {
private RebootEscrowKey mKey;

View File

@@ -30,6 +30,7 @@ import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.platform.test.annotations.Presubmit;
import android.service.resumeonreboot.ResumeOnRebootService;
import androidx.test.filters.SmallTest;
@@ -46,6 +47,7 @@ import org.mockito.MockitoAnnotations;
import java.util.ArrayList;
@SmallTest
@Presubmit
@RunWith(JUnit4.class)
public class ResumeOnRebootServiceProviderTests {