Merge "Enable Safety Center & Security unit tests on presubmit." into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
c20d8d2977
12
TEST_MAPPING
12
TEST_MAPPING
@@ -6,14 +6,20 @@
|
||||
{
|
||||
"name": "SettingsUnitTests",
|
||||
"options": [
|
||||
{
|
||||
"include-filter": "com.android.settings.password"
|
||||
},
|
||||
{
|
||||
"include-filter": "com.android.settings.biometrics"
|
||||
},
|
||||
{
|
||||
"include-filter": "com.android.settings.biometrics2"
|
||||
},
|
||||
{
|
||||
"include-filter": "com.android.settings.password"
|
||||
},
|
||||
{
|
||||
"include-filter": "com.android.settings.safetycenter"
|
||||
},
|
||||
{
|
||||
"include-filter": "com.android.settings.security"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -101,18 +101,20 @@ public class FakeFeatureFactory extends FeatureFactory {
|
||||
public FastPairFeatureProvider mFastPairFeatureProvider;
|
||||
public PrivateSpaceLoginFeatureProvider mPrivateSpaceLoginFeatureProvider;
|
||||
|
||||
/**
|
||||
* Call this in {@code @Before} method of the test class to use fake factory.
|
||||
*/
|
||||
/** Call this in {@code @Before} method of the test class to use fake factory. */
|
||||
public static FakeFeatureFactory setupForTest() {
|
||||
FakeFeatureFactory factory = new FakeFeatureFactory();
|
||||
try {
|
||||
setFactory(getAppContext(), factory);
|
||||
} catch (NoSuchMethodError ex) {
|
||||
// The getAppContext() @JvmStatic method doesn't appear to generated in AOSP. Falling
|
||||
// back to using the companion object method instead.
|
||||
setFactory(FeatureFactory.Companion.getAppContext(), factory);
|
||||
}
|
||||
return factory;
|
||||
}
|
||||
|
||||
/**
|
||||
* FeatureFactory constructor.
|
||||
*/
|
||||
/** FeatureFactory constructor. */
|
||||
public FakeFeatureFactory() {
|
||||
supportFeatureProvider = mock(SupportFeatureProvider.class);
|
||||
metricsFeatureProvider = mock(MetricsFeatureProvider.class);
|
||||
|
Reference in New Issue
Block a user