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:
Kweku Adams
2022-01-19 17:44:51 +00:00
parent 34f56bf78a
commit 9747128394

View File

@@ -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));
}