Search in sources :

Example 31 with Options

use of com.bumptech.glide.load.Options in project glide by bumptech.

the class BaseGlideUrlLoaderTest method setUp.

@SuppressWarnings("unchecked")
@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    options = new Options();
    urlLoader = new TestLoader(wrapped, modelCache);
}
Also used : Options(com.bumptech.glide.load.Options) Before(org.junit.Before)

Example 32 with Options

use of com.bumptech.glide.load.Options in project glide by bumptech.

the class StreamGifDecoderTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    List<ImageHeaderParser> parsers = new ArrayList<>();
    parsers.add(new DefaultImageHeaderParser());
    decoder = new StreamGifDecoder(parsers, byteBufferDecoder, new LruArrayPool());
    options = new Options();
}
Also used : LruArrayPool(com.bumptech.glide.load.engine.bitmap_recycle.LruArrayPool) Options(com.bumptech.glide.load.Options) DefaultImageHeaderParser(com.bumptech.glide.load.resource.bitmap.DefaultImageHeaderParser) ArrayList(java.util.ArrayList) DefaultImageHeaderParser(com.bumptech.glide.load.resource.bitmap.DefaultImageHeaderParser) ImageHeaderParser(com.bumptech.glide.load.ImageHeaderParser) Before(org.junit.Before)

Example 33 with Options

use of com.bumptech.glide.load.Options in project glide by bumptech.

the class GifDrawableBytesTranscoderTest method testReturnsBytesOfGivenGifDrawable.

@Test
public void testReturnsBytesOfGivenGifDrawable() {
    for (String fakeData : new String[] { "test", "1235asfklaw3", "@$@#" }) {
        ByteBuffer expected = ByteBuffer.wrap(fakeData.getBytes(Charset.defaultCharset()));
        when(gifDrawable.getBuffer()).thenReturn(expected);
        Resource<byte[]> transcoded = transcoder.transcode(resource, new Options());
        assertArrayEquals(expected.array(), transcoded.get());
    }
}
Also used : Options(com.bumptech.glide.load.Options) ByteBuffer(java.nio.ByteBuffer) Test(org.junit.Test)

Aggregations

Options (com.bumptech.glide.load.Options)33 Before (org.junit.Before)14 Test (org.junit.Test)10 Bitmap (android.graphics.Bitmap)4 Uri (android.net.Uri)3 NonNull (android.support.annotation.NonNull)3 ImageHeaderParser (com.bumptech.glide.load.ImageHeaderParser)3 ObjectKey (com.bumptech.glide.signature.ObjectKey)3 ByteArrayInputStream (java.io.ByteArrayInputStream)3 InputStream (java.io.InputStream)3 ArrayList (java.util.ArrayList)3 CheckResult (android.support.annotation.CheckResult)2 CacheKeyUpdater (com.bumptech.glide.load.Option.CacheKeyUpdater)2 LruArrayPool (com.bumptech.glide.load.engine.bitmap_recycle.LruArrayPool)2 DefaultImageHeaderParser (com.bumptech.glide.load.resource.bitmap.DefaultImageHeaderParser)2 ByteBuffer (java.nio.ByteBuffer)2 MessageDigest (java.security.MessageDigest)2 Application (android.app.Application)1 AssetManager (android.content.res.AssetManager)1 BitmapFactory (android.graphics.BitmapFactory)1