Home
last modified time | relevance | path

Searched refs:fakeClock (Results 1 – 18 of 18) sorted by relevance

/external/grpc-grpc-java/core/src/test/java/io/grpc/internal/
DFakeClockTest.java39 FakeClock fakeClock = new FakeClock(); in testScheduledExecutorService_sameInstance() local
40 ScheduledExecutorService scheduledExecutorService1 = fakeClock.getScheduledExecutorService(); in testScheduledExecutorService_sameInstance()
41 ScheduledExecutorService scheduledExecutorService2 = fakeClock.getScheduledExecutorService(); in testScheduledExecutorService_sameInstance()
47 FakeClock fakeClock = new FakeClock(); in testScheduledExecutorService_isDone() local
48 ScheduledFuture<?> future = fakeClock.getScheduledExecutorService() in testScheduledExecutorService_isDone()
51 fakeClock.forwardNanos(99L); in testScheduledExecutorService_isDone()
54 fakeClock.forwardNanos(2L); in testScheduledExecutorService_isDone()
60 FakeClock fakeClock = new FakeClock(); in testScheduledExecutorService_cancel() local
61 ScheduledFuture<?> future = fakeClock.getScheduledExecutorService() in testScheduledExecutorService_cancel()
64 fakeClock.forwardNanos(99L); in testScheduledExecutorService_cancel()
[all …]
DRetriableStreamTest.java126 private final FakeClock fakeClock = new FakeClock(); field in RetriableStreamTest
182 MoreExecutors.directExecutor(), fakeClock.getScheduledExecutorService(), RETRY_POLICY, in newThrottledRetriableStream()
188 assertEquals(0, fakeClock.numPendingTasks()); in tearDown()
252 assertEquals(1, fakeClock.numPendingTasks()); in retry_everythingDrained()
258 fakeClock.forwardTime((long) (INITIAL_BACKOFF_IN_SECONDS * FAKE_RANDOM) - 1L, TimeUnit.SECONDS); in retry_everythingDrained()
260 assertEquals(1, fakeClock.numPendingTasks()); in retry_everythingDrained()
261 fakeClock.forwardTime(1L, TimeUnit.SECONDS); in retry_everythingDrained()
262 assertEquals(0, fakeClock.numPendingTasks()); in retry_everythingDrained()
296 assertEquals(1, fakeClock.numPendingTasks()); in retry_everythingDrained()
303 fakeClock.forwardTime( in retry_everythingDrained()
[all …]
DInternalSubchannelTest.java84 private final FakeClock fakeClock = new FakeClock(); field in InternalSubchannelTest
140 assertEquals(0, fakeClock.numPendingTasks()); in noMorePendingTasks()
197 fakeClock.forwardNanos(9); in singleAddressReconnect()
204 fakeClock.forwardNanos(1); in singleAddressReconnect()
222 fakeClock.forwardNanos(99); in singleAddressReconnect()
228 fakeClock.forwardNanos(1); in singleAddressReconnect()
311 fakeClock.forwardNanos(9); in twoAddressesReconnect()
316 fakeClock.forwardNanos(1); in twoAddressesReconnect()
343 fakeClock.forwardNanos(99); in twoAddressesReconnect()
348 fakeClock.forwardNanos(1); in twoAddressesReconnect()
[all …]
DCensusModulesTest.java146 private final FakeClock fakeClock = new FakeClock(); field in CensusModulesTest
195 tagger, tagCtxSerializer, statsRecorder, fakeClock.getStopwatchSupplier(), true); in setUp()
375 fakeClock.forwardTime(30, MILLISECONDS); in subtestClientBasicStatsDefaultContext()
378 fakeClock.forwardTime(100, MILLISECONDS); in subtestClientBasicStatsDefaultContext()
383 fakeClock.forwardTime(16, MILLISECONDS); in subtestClientBasicStatsDefaultContext()
391 fakeClock.forwardTime(24, MILLISECONDS); in subtestClientBasicStatsDefaultContext()
488 fakeClock.forwardTime(3000, MILLISECONDS); in clientStreamNeverCreatedStillRecordStats()
573 fakeClock.getStopwatchSupplier(), in subtestStatsHeadersPropagateTags()
839 fakeClock.forwardTime(100, MILLISECONDS); in subtestServerBasicStatsNoHeaders()
844 fakeClock.forwardTime(16, MILLISECONDS); in subtestServerBasicStatsNoHeaders()
[all …]
DClientCallImplTest.java88 private final FakeClock fakeClock = new FakeClock(); field in ClientCallImplTest
90 fakeClock.getScheduledExecutorService();
657 fakeClock.forwardTime(System.nanoTime(), TimeUnit.NANOSECONDS); in deadlineExceededBeforeCallStarted()
785 fakeClock.forwardTime(System.nanoTime(), TimeUnit.NANOSECONDS); in expiredDeadlineCancelsStream_CallOptions()
799 fakeClock.forwardNanos(TimeUnit.SECONDS.toNanos(1) + 1); in expiredDeadlineCancelsStream_CallOptions()
807 fakeClock.forwardTime(System.nanoTime(), TimeUnit.NANOSECONDS); in expiredDeadlineCancelsStream_Context()
826 fakeClock.forwardNanos(TimeUnit.SECONDS.toNanos(1) + 1); in expiredDeadlineCancelsStream_Context()
834 fakeClock.forwardTime(System.nanoTime(), TimeUnit.NANOSECONDS); in streamCancelAbortsDeadlineTimer()
848 fakeClock.forwardNanos(TimeUnit.SECONDS.toNanos(1) + 1); in streamCancelAbortsDeadlineTimer()
DDnsNameResolverTest.java89 private final FakeClock fakeClock = new FakeClock(); field in DnsNameResolverTest
134 assertEquals(0, fakeClock.numPendingTasks()); in noMorePendingTasks()
195 assertEquals(0, fakeClock.numPendingTasks()); in resolve()
201 assertEquals(0, fakeClock.numPendingTasks()); in resolve()
/external/exoplayer/tree/testutils/src/test/java/com/google/android/exoplayer2/testutil/
DFakeClockTest.java40 FakeClock fakeClock = new FakeClock(/* initialTimeMs= */ 10); in currentTimeMillis_withoutBootTime() local
41 assertThat(fakeClock.currentTimeMillis()).isEqualTo(10); in currentTimeMillis_withoutBootTime()
46 FakeClock fakeClock = new FakeClock(/* bootTimeMs= */ 150, /* initialTimeMs= */ 200); in currentTimeMillis_withBootTime() local
47 assertThat(fakeClock.currentTimeMillis()).isEqualTo(350); in currentTimeMillis_withBootTime()
52 FakeClock fakeClock = new FakeClock(/* bootTimeMs= */ 100, /* initialTimeMs= */ 50); in currentTimeMillis_advanceTime_currentTimeHasAdvanced() local
53 fakeClock.advanceTime(/* timeDiffMs */ 250); in currentTimeMillis_advanceTime_currentTimeHasAdvanced()
54 assertThat(fakeClock.currentTimeMillis()).isEqualTo(400); in currentTimeMillis_advanceTime_currentTimeHasAdvanced()
59 FakeClock fakeClock = new FakeClock(2000); in testAdvanceTime() local
60 assertThat(fakeClock.elapsedRealtime()).isEqualTo(2000); in testAdvanceTime()
61 fakeClock.advanceTime(500); in testAdvanceTime()
[all …]
/external/grpc-grpc-java/netty/src/test/java/io/grpc/netty/
DMaxConnectionIdleManagerTest.java38 private final FakeClock fakeClock = new FakeClock(); field in MaxConnectionIdleManagerTest
42 return fakeClock.getTicker().read();
59 maxConnectionIdleManager.start(ctx, fakeClock.getScheduledExecutorService()); in maxIdleReached()
61 fakeClock.forwardNanos(123L); in maxIdleReached()
71 maxConnectionIdleManager.start(ctx, fakeClock.getScheduledExecutorService()); in maxIdleNotReachedAndReached()
73 fakeClock.forwardNanos(100L); in maxIdleNotReachedAndReached()
77 fakeClock.forwardNanos(100L); in maxIdleNotReachedAndReached()
80 fakeClock.forwardNanos(100L); in maxIdleNotReachedAndReached()
86 fakeClock.forwardNanos(123L); in maxIdleNotReachedAndReached()
96 maxConnectionIdleManager.start(ctx, fakeClock.getScheduledExecutorService()); in shutdownThenMaxIdleReached()
[all …]
DNettyServerHandlerTest.java577 fakeClock().forwardNanos(keepAliveTimeInNanos); in keepAliveManager_pingSent()
583 fakeClock().forwardTime(10L, TimeUnit.MILLISECONDS); in keepAliveManager_pingSent()
596 fakeClock().forwardNanos(keepAliveTimeInNanos); in keepAliveManager_pingTimeout()
600 fakeClock().forwardNanos(keepAliveTimeoutInNanos); in keepAliveManager_pingTimeout()
690 fakeClock().forwardTime(20, TimeUnit.MINUTES); in noGoAwaySentBeforeMaxConnectionIdleReached()
705 fakeClock().forwardNanos(maxConnectionIdleInNanos); in maxConnectionIdle_goAwaySent_pingAck()
740 fakeClock().forwardNanos(maxConnectionIdleInNanos); in maxConnectionIdle_goAwaySent_pingTimeout()
754 fakeClock().forwardTime(10, TimeUnit.SECONDS); in maxConnectionIdle_goAwaySent_pingTimeout()
770 fakeClock().forwardNanos(maxConnectionIdleInNanos); in maxConnectionIdle_activeThenRst_pingAck()
780 fakeClock().forwardNanos(maxConnectionIdleInNanos); in maxConnectionIdle_activeThenRst_pingAck()
[all …]
DNettyTransportTest.java35 private final FakeClock fakeClock = new FakeClock(); field in NettyTransportTest
84 fakeClock.forwardNanos(unit.toNanos(offset)); in advanceClock()
89 return fakeClock.getTicker().read(); in fakeCurrentTimeNanos()
DNettyHandlerTestBase.java105 private final FakeClock fakeClock = new FakeClock(); field in NettyHandlerTestBase
107 FakeClock fakeClock() { in fakeClock() method in NettyHandlerTestBase
108 return fakeClock; in fakeClock()
184 future = fakeClock.getScheduledExecutorService().schedule(wrap, delay, timeUnit); in FakeClockScheduledNettyFuture()
/external/robolectric-shadows/utils/src/test/java/org/robolectric/util/
DPerfStatsCollectorTest.java18 private FakeClock fakeClock; field in PerfStatsCollectorTest
23 fakeClock = new FakeClock(); in setUp()
24 collector = new PerfStatsCollector(fakeClock); in setUp()
30 fakeClock.delay(20); in shouldMeasureElapsedTimeForEvents()
42 fakeClock.delay(20); in shouldMeasureElapsedTimeForRepeatedEvents()
46 fakeClock.delay(20); in shouldMeasureElapsedTimeForRepeatedEvents()
50 fakeClock.delay(20); in shouldMeasureElapsedTimeForRepeatedEvents()
62 fakeClock.delay(10); in shouldRunAndMeasureSuccessfulCallable()
73 fakeClock.delay(10); in shouldRunAndMeasureExceptionThrowingCallable()
79 fakeClock.delay(5); in shouldRunAndMeasureExceptionThrowingCallable()
[all …]
/external/grpc-grpc-java/grpclb/src/test/java/io/grpc/grpclb/
DGrpclbLoadBalancerTest.java147 private final FakeClock fakeClock = new FakeClock(); field in GrpclbLoadBalancerTest
158 return fakeClock.getTicker().read();
249 ScheduledExecutorService timerService = fakeClock.getScheduledExecutorService(); in setUp()
289 assertThat(fakeClock.getPendingTasks()).isEmpty(); in tearDown()
402 assertEquals(1, fakeClock.numPendingTasks(FALLBACK_MODE_TASK_FILTER)); in loadReporting()
418 assertEquals(0, fakeClock.numPendingTasks(LOAD_REPORTING_TASK_FILTER)); in loadReporting()
422 assertEquals(1, fakeClock.numPendingTasks(LOAD_REPORTING_TASK_FILTER)); in loadReporting()
423 assertEquals(0, fakeClock.runDueTasks()); in loadReporting()
556 assertEquals(1, fakeClock.numPendingTasks()); in loadReporting()
559 assertEquals(0, fakeClock.numPendingTasks()); in loadReporting()
[all …]
/external/grpc-grpc-java/okhttp/src/test/java/io/grpc/okhttp/
DOkHttpTransportTest.java37 private final FakeClock fakeClock = new FakeClock(); field in OkHttpTransportTest
89 fakeClock.forwardNanos(unit.toNanos(offset)); in advanceClock()
94 return fakeClock.getTicker().read(); in fakeCurrentTimeNanos()
/external/exoplayer/tree/library/core/src/test/java/com/google/android/exoplayer2/
DDefaultMediaClockTest.java42 private FakeClock fakeClock; field in DefaultMediaClockTest
48 fakeClock = new FakeClock(0); in initMediaClockWithFakeClock()
49 mediaClock = new DefaultMediaClock(listener, fakeClock); in initMediaClockWithFakeClock()
259 fakeClock.advanceTime(SLEEP_TIME_MS); in disableRendererMediaClock_standaloneShouldBeSynced()
325 .isEqualTo(C.msToUs(fakeClock.elapsedRealtime())); in staleDisableRendererClock_shouldNotThrow()
358 fakeClock.advanceTime(SLEEP_TIME_MS); in assertClockIsRunning()
366 fakeClock.advanceTime(SLEEP_TIME_MS); in assertClockIsStopped()
/external/exoplayer/tree/library/core/src/test/java/com/google/android/exoplayer2/trackselection/
DAdaptiveTrackSelectionTest.java54 private FakeClock fakeClock; field in AdaptiveTrackSelectionTest
61 fakeClock = new FakeClock(0); in setUp()
281 fakeClock.advanceTime(1999); in evaluateQueueSizeDoNotReevaluateUntilAfterMinTimeBetweenBufferReevaluation()
319 fakeClock.advanceTime(2000); in evaluateQueueSizeRetainMoreThanMinimumDurationAfterDiscard()
349 fakeClock)); in adaptiveTrackSelectionWithMinDurationForQualityIncreaseMs()
366 fakeClock)); in adaptiveTrackSelectionWithMaxDurationForQualityDecreaseMs()
385 fakeClock)); in adaptiveTrackSelectionWithMinTimeBetweenBufferReevaluationMs()
/external/grpc-grpc-java/core/src/test/java/io/grpc/
DContextsTest.java216 FakeClock fakeClock = new FakeClock(); in statusFromCancelled_TimeoutExceptionShouldMapToDeadlineExceeded() local
218 .withDeadlineAfter(100, TimeUnit.NANOSECONDS, fakeClock.getScheduledExecutorService()); in statusFromCancelled_TimeoutExceptionShouldMapToDeadlineExceeded()
219 fakeClock.forwardTime(System.nanoTime(), TimeUnit.NANOSECONDS); in statusFromCancelled_TimeoutExceptionShouldMapToDeadlineExceeded()
220 fakeClock.forwardNanos(100); in statusFromCancelled_TimeoutExceptionShouldMapToDeadlineExceeded()
/external/grpc-grpc-java/testing/src/test/java/io/grpc/testing/
DGrpcCleanupRuleTest.java52 public static final FakeClock fakeClock = new FakeClock(); field in GrpcCleanupRuleTest
320 GrpcCleanupRule grpcCleanup = new GrpcCleanupRule().setTicker(fakeClock.getTicker()); in multiResource_timeoutCalculation()
358 .setTicker(fakeClock.getTicker()).setTimeout(3000, TimeUnit.NANOSECONDS); in multiResource_timeoutCalculation_customTimeout()
434 fakeClock.forwardTime(cleanupNanos, TimeUnit.NANOSECONDS); in cleanUp()
443 fakeClock.forwardTime(awaitReleaseNanos, TimeUnit.NANOSECONDS); in awaitReleased()