use of com.facebook.imagepipeline.producers.PostprocessorProducer.RepeatedPostprocessorConsumer 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(mProducerContext, PostprocessorProducer.NAME);
mInOrder.verify(mPostprocessor).process(mSourceBitmap, mPlatformBitmapFactory);
mInOrder.verify(mProducerListener).requiresExtraMap(mProducerContext, PostprocessorProducer.NAME);
mInOrder.verify(mProducerListener).onProducerFinishWithFailure(eq(mProducerContext), 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.producers.PostprocessorProducer.RepeatedPostprocessorConsumer 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