Merge "Refactored how CachedAppOptimizerTest uses ExtendedMockitoRule." into udc-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
f23ce1081b
@@ -85,22 +85,17 @@ public final class CachedAppOptimizerTest {
|
|||||||
@Mock
|
@Mock
|
||||||
private PackageManagerInternal mPackageManagerInt;
|
private PackageManagerInternal mPackageManagerInt;
|
||||||
|
|
||||||
private final TestableDeviceConfig mDeviceConfig = new TestableDeviceConfig();
|
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
public final ApplicationExitInfoTest.ServiceThreadRule
|
public final ApplicationExitInfoTest.ServiceThreadRule
|
||||||
mServiceThreadRule = new ApplicationExitInfoTest.ServiceThreadRule();
|
mServiceThreadRule = new ApplicationExitInfoTest.ServiceThreadRule();
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
public final ExtendedMockitoRule mExtendedMockitoRule = new ExtendedMockitoRule.Builder(this)
|
public final ExtendedMockitoRule mExtendedMockitoRule = new ExtendedMockitoRule.Builder(this)
|
||||||
.configureSessionBuilder(
|
.addStaticMockFixtures(TestableDeviceConfig::new).build();
|
||||||
sessionBuilder -> mDeviceConfig.setUpMockedClasses(sessionBuilder))
|
|
||||||
.build();
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
System.loadLibrary("mockingservicestestjni");
|
System.loadLibrary("mockingservicestestjni");
|
||||||
mDeviceConfig.setUpMockBehaviors();
|
|
||||||
mHandlerThread = new HandlerThread("");
|
mHandlerThread = new HandlerThread("");
|
||||||
mHandlerThread.start();
|
mHandlerThread.start();
|
||||||
mHandler = new Handler(mHandlerThread.getLooper());
|
mHandler = new Handler(mHandlerThread.getLooper());
|
||||||
@@ -131,7 +126,6 @@ public final class CachedAppOptimizerTest {
|
|||||||
mHandlerThread.quit();
|
mHandlerThread.quit();
|
||||||
mThread.quit();
|
mThread.quit();
|
||||||
mCountDown = null;
|
mCountDown = null;
|
||||||
mDeviceConfig.tearDown();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ProcessRecord makeProcessRecord(int pid, int uid, int packageUid, String processName,
|
private ProcessRecord makeProcessRecord(int pid, int uid, int packageUid, String processName,
|
||||||
|
|||||||
Reference in New Issue
Block a user