use of com.facebook.imagepipeline.testing.TrivialBufferPooledByteBuffer in project fresco by facebook.
the class AnimatedImageFactoryGifImplTest method testCreateWithDecodeAlFramesUsingByteBuffer.
@Test
public void testCreateWithDecodeAlFramesUsingByteBuffer() throws Exception {
GifImage mockGifImage = mock(GifImage.class);
Bitmap mockBitmap1 = MockBitmapFactory.create(50, 50, DEFAULT_BITMAP_CONFIG);
Bitmap mockBitmap2 = MockBitmapFactory.create(50, 50, DEFAULT_BITMAP_CONFIG);
// Expect a call to GifImage.createFromByteBuffer
TrivialBufferPooledByteBuffer byteBuffer = createDirectByteBuffer();
when(mGifImageMock.decodeFromByteBuffer(eq(byteBuffer.getByteBuffer()), any(ImageDecodeOptions.class))).thenReturn(mockGifImage);
when(mockGifImage.getWidth()).thenReturn(50);
when(mockGifImage.getHeight()).thenReturn(50);
testCreateWithDecodeAlFrames(mockGifImage, mockBitmap1, mockBitmap2, byteBuffer);
}
use of com.facebook.imagepipeline.testing.TrivialBufferPooledByteBuffer in project fresco by facebook.
the class AnimatedImageFactoryWebPImplTest method testCreateDefaultsUsingByteBuffer.
@Test
public void testCreateDefaultsUsingByteBuffer() {
WebPImage mockWebPImage = mock(WebPImage.class);
// Expect a call to WebPImage.createFromByteBuffer
TrivialBufferPooledByteBuffer byteBuffer = createDirectByteBuffer();
when(mWebPImageMock.decodeFromByteBuffer(eq(byteBuffer.getByteBuffer()), any(ImageDecodeOptions.class))).thenReturn(mockWebPImage);
testCreateDefaults(mockWebPImage, byteBuffer);
}
use of com.facebook.imagepipeline.testing.TrivialBufferPooledByteBuffer in project fresco by facebook.
the class AnimatedImageFactoryWebPImplTest method testCreateWithPreviewBitmapUsingByteBuffer.
@Test
public void testCreateWithPreviewBitmapUsingByteBuffer() throws Exception {
WebPImage mockWebPImage = mock(WebPImage.class);
Bitmap mockBitmap = MockBitmapFactory.create(50, 50, DEFAULT_BITMAP_CONFIG);
// Expect a call to WebPImage.createFromByteBuffer
TrivialBufferPooledByteBuffer byteBuffer = createDirectByteBuffer();
when(mWebPImageMock.decodeFromByteBuffer(eq(byteBuffer.getByteBuffer()), any(ImageDecodeOptions.class))).thenReturn(mockWebPImage);
when(mockWebPImage.getWidth()).thenReturn(50);
when(mockWebPImage.getHeight()).thenReturn(50);
testCreateWithPreviewBitmap(mockWebPImage, byteBuffer, mockBitmap);
}
use of com.facebook.imagepipeline.testing.TrivialBufferPooledByteBuffer in project fresco by facebook.
the class AnimatedImageFactoryGifImplTest method testCreateDefaultsUsingByteBuffer.
@Test
public void testCreateDefaultsUsingByteBuffer() {
GifImage mockGifImage = mock(GifImage.class);
// Expect a call to GifImage.createFromByteBuffer
TrivialBufferPooledByteBuffer byteBuffer = createDirectByteBuffer();
when(mGifImageMock.decodeFromByteBuffer(eq(byteBuffer.getByteBuffer()), any(ImageDecodeOptions.class))).thenReturn(mockGifImage);
testCreateDefaults(mockGifImage, byteBuffer);
}
use of com.facebook.imagepipeline.testing.TrivialBufferPooledByteBuffer in project fresco by facebook.
the class AnimatedImageFactoryGifImplTest method testCreateWithPreviewBitmapUsingByteBuffer.
@Test
public void testCreateWithPreviewBitmapUsingByteBuffer() throws Exception {
GifImage mockGifImage = mock(GifImage.class);
Bitmap mockBitmap = MockBitmapFactory.create(50, 50, DEFAULT_BITMAP_CONFIG);
// Expect a call to GifImage.createFromByteBuffer
TrivialBufferPooledByteBuffer byteBuffer = createDirectByteBuffer();
when(mGifImageMock.decodeFromByteBuffer(eq(byteBuffer.getByteBuffer()), any(ImageDecodeOptions.class))).thenReturn(mockGifImage);
when(mockGifImage.getWidth()).thenReturn(50);
when(mockGifImage.getHeight()).thenReturn(50);
testCreateWithPreviewBitmap(mockGifImage, mockBitmap, byteBuffer);
}
Aggregations