Search in sources :

Example 1 with CreateBitmap

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

the class BitmapPreFillerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    when(pool.getMaxSize()).thenReturn(poolSize);
    when(pool.getDirty(anyInt(), anyInt(), any(Bitmap.Config.class))).thenAnswer(new CreateBitmap());
    when(cache.getMaxSize()).thenReturn(cacheSize);
    bitmapPreFiller = new BitmapPreFiller(cache, pool, DecodeFormat.DEFAULT);
}
Also used : CreateBitmap(com.bumptech.glide.tests.Util.CreateBitmap) Config(org.robolectric.annotation.Config) Before(org.junit.Before)

Example 2 with CreateBitmap

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

the class BitmapPreFillRunnerTest method setUp.

@Before
public void setUp() {
    MockitoAnnotations.initMocks(this);
    doAnswer(new AddBitmapPoolAnswer(addedBitmaps)).when(pool).put(any(Bitmap.class));
    when(pool.getDirty(anyInt(), anyInt(), any(Bitmap.Config.class))).thenAnswer(new CreateBitmap());
    when(cache.put(any(Key.class), anyResource())).thenAnswer(new AddBitmapCacheAnswer(addedBitmaps));
}
Also used : CreateBitmap(com.bumptech.glide.tests.Util.CreateBitmap) Bitmap(android.graphics.Bitmap) CreateBitmap(com.bumptech.glide.tests.Util.CreateBitmap) Config(org.robolectric.annotation.Config) Key(com.bumptech.glide.load.Key) Before(org.junit.Before)

Aggregations

CreateBitmap (com.bumptech.glide.tests.Util.CreateBitmap)2 Before (org.junit.Before)2 Config (org.robolectric.annotation.Config)2 Bitmap (android.graphics.Bitmap)1 Key (com.bumptech.glide.load.Key)1