|
24 | 24 | import com.google.android.material.shape.CornerTreatment; |
25 | 25 | import com.google.android.material.shape.CutCornerTreatment; |
26 | 26 | import com.google.android.material.shape.ShapeAppearanceModel; |
27 | | -import androidx.core.content.ContextCompat; |
28 | 27 | import androidx.test.core.app.ApplicationProvider; |
29 | 28 | import org.junit.Before; |
30 | 29 | import org.junit.Test; |
31 | 30 | import org.junit.runner.RunWith; |
32 | 31 | import org.robolectric.RobolectricTestRunner; |
33 | 32 | import org.robolectric.annotation.internal.DoNotInstrument; |
34 | | -import android.graphics.drawable.Drawable; |
35 | | -import android.view.View.MeasureSpec; |
36 | 33 |
|
37 | 34 | /** Tests for {@link com.google.android.material.button.MaterialButton}. */ |
38 | 35 | @RunWith(RobolectricTestRunner.class) |
@@ -94,27 +91,6 @@ public void testGetShapeAppearanceModel() { |
94 | 91 | materialButton.getShapeAppearanceModel(), CUT_CORNER_FAMILY_CLASS); |
95 | 92 | } |
96 | 93 |
|
97 | | - @Test |
98 | | - public void setIcon_IconUpdated_whenCalledTwice() { |
99 | | - MaterialButton materialButton = new MaterialButton(context); |
100 | | - materialButton.setText("test"); |
101 | | - int measureSpec = |
102 | | - MeasureSpec.makeMeasureSpec(200, MeasureSpec.AT_MOST); |
103 | | - |
104 | | - Drawable drawable1 = ContextCompat.getDrawable(context, android.R.drawable.btn_plus); |
105 | | - materialButton.setIcon(drawable1); |
106 | | - materialButton.setIconGravity(MaterialButton.ICON_GRAVITY_START); |
107 | | - materialButton.measure(measureSpec, measureSpec); |
108 | | - |
109 | | - assertThat(materialButton.getIcon()).isEqualTo(drawable1); |
110 | | - |
111 | | - Drawable drawable2 = ContextCompat.getDrawable(context, android.R.drawable.btn_minus); |
112 | | - materialButton.setIcon(drawable2); |
113 | | - materialButton.measure(measureSpec, measureSpec); |
114 | | - |
115 | | - assertThat(materialButton.getIcon()).isEqualTo(drawable2); |
116 | | - } |
117 | | - |
118 | 94 | private void assertThatCornerFamilyMatches( |
119 | 95 | ShapeAppearanceModel shapeAppearanceModel, |
120 | 96 | Class<? extends CornerTreatment> expectedCornerFamily) { |
|
0 commit comments