Avoid using unnecessary subclass of ForwardingDrawable.
@@ -29,12 +29,12 @@ import static org.mockito.Mockito.*;
@RunWith(RobolectricTestRunner.class)
public class ForwardingDrawableTest {
private Drawable mInnerDrawable;
- private FakeForwardingDrawable mDrawable;
+ private ForwardingDrawable mDrawable;
@Before
public void setup() {
mInnerDrawable = mock(Drawable.class);
- mDrawable = new FakeForwardingDrawable(mInnerDrawable);
+ mDrawable = new ForwardingDrawable(mInnerDrawable);
// ForwardingDrawable will call mInnerDrawable.setCallback
reset(mInnerDrawable);
}
@@ -43,7 +43,7 @@ public class ForwardingDrawableTest {
public void testIntrinsicDimensions() {
when(mInnerDrawable.getIntrinsicWidth()).thenReturn(100);
when(mInnerDrawable.getIntrinsicHeight()).thenReturn(200);
- Drawable drawable1 = new FakeForwardingDrawable(mInnerDrawable);
+ Drawable drawable1 = new ForwardingDrawable(mInnerDrawable);
Assert.assertEquals(100, drawable1.getIntrinsicWidth());
Assert.assertEquals(200, drawable1.getIntrinsicHeight());
}
@@ -114,10 +114,4 @@ public class ForwardingDrawableTest {
verify(newDrawable).setVisible(visible, false);
verify(newDrawable).setState(stateSet);
}
-
- static class FakeForwardingDrawable extends ForwardingDrawable {
- public FakeForwardingDrawable(Drawable drawable) {
- super(drawable);
- }
- }
}
