Fix failing unit test; the test was using a deprecated API making it fail on WVGA devices.

Change-Id: I407c7baa5606aaee875f51d6e96ce8a0117fc375
This commit is contained in:
Romain Guy
2009-10-06 18:38:27 -07:00
parent c131c56719
commit c404ed2be5

View File

@@ -55,14 +55,14 @@ public class BigCacheTest extends ActivityInstrumentationTestCase<BigCache> {
@MediumTest @MediumTest
public void testDrawingCacheBelowMaximumSize() throws Exception { public void testDrawingCacheBelowMaximumSize() throws Exception {
final int max = ViewConfiguration.getMaximumDrawingCacheSize(); final int max = ViewConfiguration.get(getActivity()).getScaledMaximumDrawingCacheSize();
assertTrue(mTiny.getWidth() * mTiny.getHeight() * 2 < max); assertTrue(mTiny.getWidth() * mTiny.getHeight() * 2 < max);
assertNotNull(createCacheForView(mTiny)); assertNotNull(createCacheForView(mTiny));
} }
@MediumTest @MediumTest
public void testDrawingCacheAboveMaximumSize() throws Exception { public void testDrawingCacheAboveMaximumSize() throws Exception {
final int max = ViewConfiguration.getMaximumDrawingCacheSize(); final int max = ViewConfiguration.get(getActivity()).getScaledMaximumDrawingCacheSize();
assertTrue(mLarge.getWidth() * mLarge.getHeight() * 2 > max); assertTrue(mLarge.getWidth() * mLarge.getHeight() * 2 > max);
assertNull(createCacheForView(mLarge)); assertNull(createCacheForView(mLarge));
} }