use of com.bumptech.glide.request.Request in project glide by bumptech.
the class RequestTrackerTest method testDoesNotStartStartedRequestsWhenResumed.
@Test
public void testDoesNotStartStartedRequestsWhenResumed() {
Request request = mock(Request.class);
when(request.isRunning()).thenReturn(true);
tracker.addRequest(request);
tracker.resumeRequests();
verify(request, never()).begin();
}
use of com.bumptech.glide.request.Request in project glide by bumptech.
the class RequestTrackerTest method testRestartsFailedRequestRestart.
@Test
public void testRestartsFailedRequestRestart() {
Request request = mock(Request.class);
when(request.isFailed()).thenReturn(true);
tracker.addRequest(request);
tracker.restartRequests();
verify(request).begin();
}
use of com.bumptech.glide.request.Request in project glide by bumptech.
the class RequestTrackerTest method testAvoidsConcurrentModificationWhenResuming.
@Test
public void testAvoidsConcurrentModificationWhenResuming() {
Request first = mock(Request.class);
Request second = mock(Request.class);
doAnswer(new ClearAndRemoveRequest(second)).when(first).begin();
tracker.addRequest(mock(Request.class));
tracker.addRequest(first);
tracker.addRequest(second);
tracker.resumeRequests();
}
use of com.bumptech.glide.request.Request in project glide by bumptech.
the class RequestTrackerTest method testDoesNotClearFailedRequestsWhenPaused.
@Test
public void testDoesNotClearFailedRequestsWhenPaused() {
Request request = mock(Request.class);
when(request.isFailed()).thenReturn(true);
tracker.addRequest(request);
tracker.pauseRequests();
verify(request, never()).clear();
}
use of com.bumptech.glide.request.Request in project glide by bumptech.
the class RequestTrackerTest method testDoesNotStartRequestOnRunIfPaused.
@Test
public void testDoesNotStartRequestOnRunIfPaused() {
Request request = mock(Request.class);
tracker.pauseRequests();
tracker.runRequest(request);
verify(request, never()).begin();
}
Aggregations