@@ -861,20 +861,20 @@ public void triggerRemoteConfigFetchIfNecessary_doesNotFetchBeforeRandomDelay()
861
861
}
862
862
863
863
@ Test
864
- public void triggerRemoteConfigFetchIfNecessary_fetchesAfterAppStartRandomDelay () {
865
- long appStartConfigFetchDelay = 5000 ;
864
+ public void triggerRemoteConfigFetchIfNecessary_fetchesAfterRandomDelay () {
865
+ long remoteConfigFetchDelay = 5000 ;
866
866
RemoteConfigManager remoteConfigManagerPartialMock =
867
867
spy (
868
868
setupTestRemoteConfigManager (
869
869
createFakeTaskThatDoesNothing (),
870
870
true ,
871
871
createDefaultRcConfigMap (),
872
- appStartConfigFetchDelay ));
872
+ remoteConfigFetchDelay ));
873
873
874
874
// Simulate time fast forward to 2s after fetch delay time is up
875
- long appStartTimeInMs = System .currentTimeMillis ();
875
+ long approxRcmInitTimestampInMs = System .currentTimeMillis ();
876
876
when (remoteConfigManagerPartialMock .getCurrentSystemTimeMillis ())
877
- .thenReturn (appStartTimeInMs + appStartConfigFetchDelay + 2000 );
877
+ .thenReturn (approxRcmInitTimestampInMs + remoteConfigFetchDelay + 2000 );
878
878
879
879
simulateFirebaseRemoteConfigLastFetchStatus (
880
880
FirebaseRemoteConfig .LAST_FETCH_STATUS_NO_FETCH_YET );
@@ -918,19 +918,16 @@ private RemoteConfigManager setupTestRemoteConfigManager(
918
918
Task <Boolean > fakeTask ,
919
919
boolean initializeFrc ,
920
920
Map <String , FirebaseRemoteConfigValue > configs ,
921
- long appStartConfigFetchDelayInMs ) {
921
+ long remoteConfigFetchDelayInMs ) {
922
922
simulateFirebaseRemoteConfigLastFetchStatus (FirebaseRemoteConfig .LAST_FETCH_STATUS_SUCCESS );
923
923
when (mockFirebaseRemoteConfig .fetchAndActivate ()).thenReturn (fakeTask );
924
924
when (mockFirebaseRemoteConfig .getAll ()).thenReturn (configs );
925
925
if (initializeFrc ) {
926
926
return new RemoteConfigManager (
927
- cacheManager , fakeExecutor , mockFirebaseRemoteConfig , appStartConfigFetchDelayInMs );
927
+ cacheManager , fakeExecutor , mockFirebaseRemoteConfig , remoteConfigFetchDelayInMs );
928
928
} else {
929
929
return new RemoteConfigManager (
930
- cacheManager ,
931
- fakeExecutor ,
932
- /* firebaseRemoteConfig= */ null ,
933
- appStartConfigFetchDelayInMs );
930
+ cacheManager , fakeExecutor , /* firebaseRemoteConfig= */ null , remoteConfigFetchDelayInMs );
934
931
}
935
932
}
936
933
0 commit comments