Methods Summary |
---|
private android.graphics.Bitmap | createCacheForView(android.view.View view)
final Bitmap[] cache = new Bitmap[1];
getActivity().runOnUiThread(new Runnable() {
public void run() {
view.setDrawingCacheEnabled(true);
view.invalidate();
view.buildDrawingCache();
cache[0] = view.getDrawingCache();
}
});
getInstrumentation().waitForIdleSync();
return cache[0];
|
public void | setUp()
super.setUp();
final ZeroSized activity = getActivity();
mWithDimension = activity.findViewById(R.id.dimension);
mWithNoWdith = activity.findViewById(R.id.noWidth);
mWithNoHeight = activity.findViewById(R.id.noHeight);
mWithNoDimension = activity.findViewById(R.id.noDimension);
|
public void | testDrawingCacheWithDimension()
assertTrue(mWithDimension.getWidth() > 0);
assertTrue(mWithDimension.getHeight() > 0);
assertNotNull(createCacheForView(mWithDimension));
|
public void | testDrawingCacheWithNoDimension()
assertTrue(mWithNoDimension.getWidth() == 0);
assertTrue(mWithNoDimension.getHeight() == 0);
assertNull(createCacheForView(mWithNoDimension));
|
public void | testDrawingCacheWithNoHeight()
assertTrue(mWithNoHeight.getWidth() > 0);
assertTrue(mWithNoHeight.getHeight() == 0);
assertNull(createCacheForView(mWithNoHeight));
|
public void | testDrawingCacheWithNoWidth()
assertTrue(mWithNoWdith.getWidth() == 0);
assertTrue(mWithNoWdith.getHeight() > 0);
assertNull(createCacheForView(mWithNoWdith));
|
public void | testSetUpConditions()
assertNotNull(mWithDimension);
assertNotNull(mWithNoWdith);
assertNotNull(mWithNoHeight);
assertNotNull(mWithNoDimension);
|