Search in sources :

Example 1 with ReturnsSelfAnswer

use of com.bumptech.glide.tests.Util.ReturnsSelfAnswer in project glide by bumptech.

the class GifFrameLoaderTest method setUp.

@SuppressWarnings("unchecked")
@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    when(handler.obtainMessage(anyInt(), isA(DelayTarget.class))).thenReturn(mock(Message.class));
    firstFrame = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888);
    ByteBuffer byteBuffer = ByteBuffer.allocate(10);
    when(gifDecoder.getData()).thenReturn(byteBuffer);
    requestBuilder = mock(RequestBuilder.class, new ReturnsSelfAnswer());
    loader = createGifFrameLoader(handler);
}
Also used : Message(android.os.Message) RequestBuilder(com.bumptech.glide.RequestBuilder) DelayTarget(com.bumptech.glide.load.resource.gif.GifFrameLoader.DelayTarget) ByteBuffer(java.nio.ByteBuffer) ReturnsSelfAnswer(com.bumptech.glide.tests.Util.ReturnsSelfAnswer) Before(org.junit.Before)

Aggregations

Message (android.os.Message)1 RequestBuilder (com.bumptech.glide.RequestBuilder)1 DelayTarget (com.bumptech.glide.load.resource.gif.GifFrameLoader.DelayTarget)1 ReturnsSelfAnswer (com.bumptech.glide.tests.Util.ReturnsSelfAnswer)1 ByteBuffer (java.nio.ByteBuffer)1 Before (org.junit.Before)1