Home
last modified time | relevance | path

Searched refs:mockDrawable (Results 1 – 7 of 7) sorted by relevance

/cts/tests/tests/graphics/src/android/graphics/drawable/cts/
DDrawableTest.java85 Drawable mockDrawable = new MockDrawable(); in testClearColorFilter() local
86 mockDrawable.clearColorFilter(); in testClearColorFilter()
87 assertNull(mockDrawable.getColorFilter()); in testClearColorFilter()
90 mockDrawable.setColorFilter(cf); in testClearColorFilter()
91 assertEquals(cf, mockDrawable.getColorFilter()); in testClearColorFilter()
93 mockDrawable.clearColorFilter(); in testClearColorFilter()
94 assertNull(mockDrawable.getColorFilter()); in testClearColorFilter()
99 Drawable mockDrawable = new MockDrawable(); in testCopyBounds() local
100 Rect rect1 = mockDrawable.copyBounds(); in testCopyBounds()
102 mockDrawable.copyBounds(r1); in testCopyBounds()
[all …]
DDrawableWrapperTest.java168 Drawable mockDrawable = spy(new ColorDrawable(Color.BLUE)); in testDraw() local
169 doNothing().when(mockDrawable).draw(any()); in testDraw()
170 DrawableWrapper wrapper = new MyWrapper(mockDrawable); in testDraw()
173 verify(mockDrawable, times(1)).draw(any()); in testDraw()
175 reset(mockDrawable); in testDraw()
176 doNothing().when(mockDrawable).draw(any()); in testDraw()
178 verify(mockDrawable, times(1)).draw(any()); in testDraw()
186 MockDrawable mockDrawable = new MockDrawable(); in testGetChangingConfigurations() local
187 DrawableWrapper wrapper = new MyWrapper(mockDrawable); in testGetChangingConfigurations()
191 mockDrawable.setChangingConfigurations(CONTAINED_DRAWABLE_CONFIG); in testGetChangingConfigurations()
[all …]
DScaleDrawableTest.java152 Drawable mockDrawable = spy(new ColorDrawable(Color.RED)); in testDraw() local
153 ScaleDrawable scaleDrawable = new ScaleDrawable(mockDrawable, Gravity.CENTER, 100, 200); in testDraw()
156 verify(mockDrawable, never()).draw(any()); in testDraw()
160 mockDrawable.setLevel(1); in testDraw()
162 verify(mockDrawable, times(1)).draw(any()); in testDraw()
164 reset(mockDrawable); in testDraw()
165 doNothing().when(mockDrawable).draw(any()); in testDraw()
167 verify(mockDrawable, times(1)).draw(any()); in testDraw()
175 Drawable mockDrawable = new ColorDrawable(Color.YELLOW); in testGetChangingConfigurations() local
176 ScaleDrawable scaleDrawable = new ScaleDrawable(mockDrawable, Gravity.CENTER, 100, 200); in testGetChangingConfigurations()
[all …]
DClipDrawableTest.java80 Drawable mockDrawable = spy(new ColorDrawable(Color.GREEN)); in testDraw() local
81 mockDrawable.setLevel(5000); in testDraw()
82 ClipDrawable clipDrawable = new ClipDrawable(mockDrawable, in testDraw()
86 verify(mockDrawable, never()).draw(any()); in testDraw()
88 verify(mockDrawable, times(1)).draw(any()); in testDraw()
118 Drawable mockDrawable = spy(new ColorDrawable(Color.GREEN)); in testGetConstantState() local
119 doReturn(null).when(mockDrawable).getConstantState(); in testGetConstantState()
120 ClipDrawable clipDrawable = new ClipDrawable(mockDrawable, in testGetConstantState()
124 doReturn(new MockConstantState()).when(mockDrawable).getConstantState(); in testGetConstantState()
125 clipDrawable = new ClipDrawable(mockDrawable, Gravity.BOTTOM, ClipDrawable.HORIZONTAL); in testGetConstantState()
[all …]
DDrawableContainerTest.java231 Drawable mockDrawable = spy(new ColorDrawable(Color.BLACK)); in testSetAlpha() local
232 addAndSelectDrawable(mockDrawable); in testSetAlpha()
235 reset(mockDrawable); in testSetAlpha()
237 verify(mockDrawable, times(1)).setAlpha(1); in testSetAlpha()
240 reset(mockDrawable); in testSetAlpha()
242 verify(mockDrawable, never()).setAlpha(anyInt()); in testSetAlpha()
309 Drawable mockDrawable = spy(new ColorDrawable(Color.MAGENTA)); in testSetColorFilter() local
310 addAndSelectDrawable(mockDrawable); in testSetColorFilter()
313 reset(mockDrawable); in testSetColorFilter()
315 verify(mockDrawable, times(1)).setColorFilter(null); in testSetColorFilter()
[all …]
/cts/tests/tests/widget/src/android/widget/cts/
DCompoundButtonTest.java402 Drawable mockDrawable = spy(new ColorDrawable(Color.GREEN)); in testButtonTint() local
404 mCompoundButton.setButtonDrawable(mockDrawable); in testButtonTint()
406 verify(mockDrawable, never()).setTintList(any(ColorStateList.class)); in testButtonTint()
410 verify(mockDrawable, times(1)).setTintList(TestUtils.colorStateListOf(Color.WHITE)); in testButtonTint()
412 reset(mockDrawable); in testButtonTint()
414 mCompoundButton.setButtonDrawable(mockDrawable); in testButtonTint()
416 verify(mockDrawable, times(1)).setTintList(TestUtils.colorStateListOf(Color.WHITE)); in testButtonTint()
429 Drawable mockDrawable = spy(new ColorDrawable(Color.GREEN)); in testButtonTintBlendMode() local
431 mCompoundButton.setButtonDrawable(mockDrawable); in testButtonTintBlendMode()
433 verify(mockDrawable, never()).setTintList(any(ColorStateList.class)); in testButtonTintBlendMode()
[all …]
DImageViewTest.java587 MockDrawable mockDrawable = new MockDrawable(); in testSetColorFilterPreservesDrawableProperties() local
588 mockDrawable.setAlpha(colorAlpha); in testSetColorFilterPreservesDrawableProperties()
589 mockDrawable.setXfermode(new PorterDuffXfermode(Mode.SRC_IN)); in testSetColorFilterPreservesDrawableProperties()
591 imageView.setImageDrawable(mockDrawable); in testSetColorFilterPreservesDrawableProperties()
594 assertEquals(colorAlpha, mockDrawable.getAlpha()); in testSetColorFilterPreservesDrawableProperties()
595 assertNotNull(mockDrawable.getXfermode()); in testSetColorFilterPreservesDrawableProperties()
603 MockDrawable mockDrawable = new MockDrawable(); in testSetColorFilterPreservesDrawablePropertiesTintBlendMode() local
604 mockDrawable.setAlpha(colorAlpha); in testSetColorFilterPreservesDrawablePropertiesTintBlendMode()
605 mockDrawable.setTintBlendMode(BlendMode.SRC_IN); in testSetColorFilterPreservesDrawablePropertiesTintBlendMode()
607 imageView.setImageDrawable(mockDrawable); in testSetColorFilterPreservesDrawablePropertiesTintBlendMode()
[all …]