use of com.bumptech.glide.request.Request in project glide by bumptech.
the class RequestTrackerTest method testDoesRestartFailedRequestsWhenResumed.
@Test
public void testDoesRestartFailedRequestsWhenResumed() {
Request request = mock(Request.class);
when(request.isFailed()).thenReturn(true);
tracker.addRequest(request);
tracker.resumeRequests();
verify(request).begin();
}
use of com.bumptech.glide.request.Request in project glide by bumptech.
the class RequestTrackerTest method testDoesNotClearCompleteRequestsWhenPaused.
@Test
public void testDoesNotClearCompleteRequestsWhenPaused() {
Request request = mock(Request.class);
tracker.addRequest(request);
when(request.isComplete()).thenReturn(true);
tracker.pauseRequests();
verify(request, never()).clear();
}
use of com.bumptech.glide.request.Request in project glide by bumptech.
the class RequestTrackerTest method testCanAddAndRemoveRequest.
@Test
public void testCanAddAndRemoveRequest() {
Request request = mock(Request.class);
tracker.addRequest(request);
tracker.clearRemoveAndRecycle(request);
tracker.clearRequests();
verify(request, times(1)).clear();
}
use of com.bumptech.glide.request.Request in project glide by bumptech.
the class RequestTrackerTest method testRestartsStoppedRequestWhenResumed.
@Test
public void testRestartsStoppedRequestWhenResumed() {
Request request = mock(Request.class);
tracker.addRequest(request);
tracker.resumeRequests();
verify(request).begin();
}
use of com.bumptech.glide.request.Request in project glide by bumptech.
the class RequestTrackerTest method testClearRemoveAndRecycle_withAlreadyRemovedRequest_doesNothingAndReturnsFalse.
@Test
public void testClearRemoveAndRecycle_withAlreadyRemovedRequest_doesNothingAndReturnsFalse() {
Request request = mock(Request.class);
tracker.addRequest(request);
tracker.clearRemoveAndRecycle(request);
assertThat(tracker.clearRemoveAndRecycle(request)).isFalse();
verify(request, times(1)).clear();
verify(request, times(1)).recycle();
}
Aggregations