use of com.facebook.imagepipeline.request.RepeatedPostprocessorRunner in project fresco by facebook.
the class RepeatedPostprocessorProducerTest method testCannotPostprocessAfterPostprocessFailure.
@Test
public void testCannotPostprocessAfterPostprocessFailure() {
RepeatedPostprocessorConsumer postprocessorConsumer = produceResults();
RepeatedPostprocessorRunner repeatedPostprocessorRunner = getRunner();
performNewResult(postprocessorConsumer, true);
verifyNewResultProcessed(0);
performFailure(repeatedPostprocessorRunner);
mInOrder.verify(mProducerListener).onProducerStart(mRequestId, PostprocessorProducer.NAME);
mInOrder.verify(mPostprocessor).process(mSourceBitmap, mPlatformBitmapFactory);
mInOrder.verify(mProducerListener).requiresExtraMap(mRequestId);
mInOrder.verify(mProducerListener).onProducerFinishWithFailure(eq(mRequestId), eq(PostprocessorProducer.NAME), any(RuntimeException.class), eq(mExtraMap));
mInOrder.verify(mConsumer).onFailure(any(RuntimeException.class));
mInOrder.verifyNoMoreInteractions();
// Can't update now that the request has failed.
performUpdate(repeatedPostprocessorRunner, true);
mInOrder.verifyNoMoreInteractions();
performCancelAfterFinished();
verify(mSourceCloseableStaticBitmap).close();
}
use of com.facebook.imagepipeline.request.RepeatedPostprocessorRunner in project fresco by facebook.
the class RepeatedPostprocessorProducerTest method testUpdateBeforeNewResultDoesNothing.
@Test
public void testUpdateBeforeNewResultDoesNothing() {
RepeatedPostprocessorConsumer postprocessorConsumer = produceResults();
RepeatedPostprocessorRunner repeatedPostprocessorRunner = getRunner();
performUpdate(repeatedPostprocessorRunner, true);
performUpdate(repeatedPostprocessorRunner, true);
mInOrder.verifyNoMoreInteractions();
performNewResult(postprocessorConsumer, true);
verifyNewResultProcessed(0);
}
Aggregations