Enable Safety Center & Security unit tests on presubmit.
See b/323650746 and b/323649900 for issues that should’ve been caught by pre-submit. Bug: 323649900 Bug: 323650746 Change-Id: I77d664b6fce6a3f76a4c9a6b39202f6e9d47da33 Test: atest SettingsUnitTests
This commit is contained in:
@@ -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();
|
||||
setFactory(getAppContext(), factory);
|
||||
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