Fix prefetch test.
Confirm that the PrefetchController has processed the launch time change and scheduled an alarm before checking that the JobStatus has been updated. Bug: 215215283 Test: atest --rerun-until-failure 50 FrameworksMockingServicesTests:PrefetchControllerTest Change-Id: I99a3298e6ae05819e7da18b9658e71969e8f9647
This commit is contained in:
@@ -383,6 +383,10 @@ public class PrefetchControllerTest {
|
||||
|
||||
inOrder.verify(mUsageStatsManagerInternal, timeout(DEFAULT_WAIT_MS).times(0))
|
||||
.getEstimatedPackageLaunchTime(SOURCE_PACKAGE, SOURCE_USER_ID);
|
||||
verify(mAlarmManager, timeout(DEFAULT_WAIT_MS).times(1))
|
||||
.setWindow(
|
||||
anyInt(), eq(sElapsedRealtimeClock.millis() + 3 * HOUR_IN_MILLIS),
|
||||
anyLong(), eq(TAG_PREFETCH), any(), any());
|
||||
assertFalse(jobStatus.isConstraintSatisfied(JobStatus.CONSTRAINT_PREFETCH));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user