use of com.bumptech.glide.request.Request in project glide by bumptech.
the class RequestTrackerTest method testPausesFailedRequestOnRestartIfPaused.
@Test
public void testPausesFailedRequestOnRestartIfPaused() {
Request request = mock(Request.class);
when(request.isFailed()).thenReturn(true);
tracker.pauseRequests();
tracker.addRequest(request);
tracker.restartRequests();
verify(request).pause();
}
use of com.bumptech.glide.request.Request in project glide by bumptech.
the class RequestTrackerTest method testDoesNotBeginIncompleteRequestsOnRestartIfPaused.
@Test
public void testDoesNotBeginIncompleteRequestsOnRestartIfPaused() {
Request request = mock(Request.class);
when(request.isFailed()).thenReturn(false);
when(request.isComplete()).thenReturn(false);
tracker.pauseRequests();
tracker.addRequest(request);
tracker.restartRequests();
verify(request, never()).begin();
}
use of com.bumptech.glide.request.Request in project glide by bumptech.
the class RequestTrackerTest method testDoesNotBeginFailedRequestOnRestartIfPaused.
@Test
public void testDoesNotBeginFailedRequestOnRestartIfPaused() {
Request request = mock(Request.class);
when(request.isFailed()).thenReturn(true);
tracker.pauseRequests();
tracker.addRequest(request);
tracker.restartRequests();
verify(request, never()).begin();
}
use of com.bumptech.glide.request.Request in project glide by bumptech.
the class RequestTrackerTest method testAvoidsConcurrentModificationWhenClearing.
@Test
public void testAvoidsConcurrentModificationWhenClearing() {
Request first = mock(Request.class);
Request second = mock(Request.class);
doAnswer(new ClearAndRemoveRequest(second)).when(first).clear();
tracker.addRequest(mock(Request.class));
tracker.addRequest(first);
tracker.addRequest(second);
tracker.clearRequests();
}
Aggregations