diff options
author | Nick Chalko <nchalko@google.com> | 2017-10-03 10:16:37 -0700 |
---|---|---|
committer | Nick Chalko <nchalko@google.com> | 2017-10-04 13:48:13 +0000 |
commit | 6ebde20b03db4c0d57f67acaac11832b610b966b (patch) | |
tree | d31e2adc1f9cce4f27ca07d30bee921032e33a3c /tests/unit/src/com/android/tv/util/ImageCacheTest.java | |
parent | ee027a576ddebaf1ae739219be01b0240b15f80c (diff) | |
download | TV-6ebde20b03db4c0d57f67acaac11832b610b966b.tar.gz |
Sync to match Live Channels 1.15(ncis)oreo-mr1-dev
aka ub-tv-dev at a73a150bb7d0d1ce867ef980c6ac8411899d40ad
Bug: 64021596
Change-Id: I7c544fd15e2c58784f8babc31877ad0dfeebb4c0
(cherry picked from commit 633eb826b8c97731dfc5ef12c7bf78a63734275d)
Diffstat (limited to 'tests/unit/src/com/android/tv/util/ImageCacheTest.java')
-rw-r--r-- | tests/unit/src/com/android/tv/util/ImageCacheTest.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/unit/src/com/android/tv/util/ImageCacheTest.java b/tests/unit/src/com/android/tv/util/ImageCacheTest.java index e185d5f1..a76194b8 100644 --- a/tests/unit/src/com/android/tv/util/ImageCacheTest.java +++ b/tests/unit/src/com/android/tv/util/ImageCacheTest.java @@ -17,19 +17,21 @@ package com.android.tv.util; import static com.android.tv.util.BitmapUtils.createScaledBitmapInfo; +import static org.junit.Assert.assertSame; import android.graphics.Bitmap; import android.support.test.filters.MediumTest; import com.android.tv.util.BitmapUtils.ScaledBitmapInfo; -import junit.framework.TestCase; +import org.junit.Before; +import org.junit.Test; /** * Tests for {@link ImageCache}. */ @MediumTest -public class ImageCacheTest extends TestCase { +public class ImageCacheTest { private static final Bitmap ORIG = Bitmap.createBitmap(100, 100, Bitmap.Config.RGB_565); private static final String KEY = "same"; @@ -40,14 +42,14 @@ public class ImageCacheTest extends TestCase { private ImageCache mImageCache; - @Override - protected void setUp() throws Exception { - super.setUp(); + @Before + public void setUp() throws Exception { mImageCache = ImageCache.newInstance(0.1f); } //TODO: Empty the cache in the setup. Try using @VisibleForTesting + @Test public void testPutIfLarger_smaller() throws Exception { mImageCache.putIfNeeded( INFO_50); @@ -57,6 +59,7 @@ public class ImageCacheTest extends TestCase { assertSame("after", INFO_50, mImageCache.get(KEY)); } + @Test public void testPutIfLarger_larger() throws Exception { mImageCache.putIfNeeded( INFO_50); assertSame("before", INFO_50, mImageCache.get(KEY)); @@ -65,6 +68,7 @@ public class ImageCacheTest extends TestCase { assertSame("after", INFO_100, mImageCache.get(KEY)); } + @Test public void testPutIfLarger_alreadyMax() throws Exception { mImageCache.putIfNeeded( INFO_100); |