|
15 | 15 | */
|
16 | 16 | package com.google.android.material.chip;
|
17 | 17 |
|
18 |
| -import com.google.android.material.test.R; |
| 18 | +import com.google.android.material.R; |
19 | 19 |
|
20 |
| -import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; |
21 | 20 | import static com.google.common.truth.Truth.assertThat;
|
22 | 21 | import static org.junit.Assert.assertEquals;
|
23 | 22 | import static org.junit.Assert.assertTrue;
|
24 | 23 |
|
25 | 24 | import android.content.Context;
|
26 | 25 | import androidx.appcompat.app.AppCompatActivity;
|
27 | 26 | import android.view.View;
|
28 |
| -import android.widget.CompoundButton; |
29 | 27 | import androidx.core.view.ViewCompat;
|
30 | 28 | import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
|
31 | 29 | import androidx.core.view.accessibility.AccessibilityNodeInfoCompat.CollectionInfoCompat;
|
@@ -198,29 +196,6 @@ public void onCheckedChanged(ChipGroup group, List<Integer> checkedIds) {
|
198 | 196 | assertThat(checkedIds).contains(second.getId());
|
199 | 197 | }
|
200 | 198 |
|
201 |
| - @Test |
202 |
| - public void multipleSelection_chipListener() { |
203 |
| - chipgroup.setSingleSelection(false); |
204 |
| - |
205 |
| - Chip first = (Chip) chipgroup.getChildAt(0); |
206 |
| - first.setOnCheckedChangeListener(this::onChipCheckedStateChanged); |
207 |
| - |
208 |
| - Chip second = (Chip) chipgroup.getChildAt(1); |
209 |
| - second.setOnCheckedChangeListener(this::onChipCheckedStateChanged); |
210 |
| - |
211 |
| - first.performClick(); |
212 |
| - getInstrumentation().waitForIdleSync(); |
213 |
| - |
214 |
| - assertThat(checkedChangeCallCount).isEqualTo(1); |
215 |
| - assertThat(checkedIds).containsExactly(first.getId()); |
216 |
| - |
217 |
| - second.performClick(); |
218 |
| - getInstrumentation().waitForIdleSync(); |
219 |
| - |
220 |
| - assertThat(checkedChangeCallCount).isEqualTo(2); |
221 |
| - assertThat(checkedIds).containsExactly(first.getId(), second.getId()); |
222 |
| - } |
223 |
| - |
224 | 199 | @Test
|
225 | 200 | public void multiSelection_withSelectionRequired_unSelectsIfTwo() {
|
226 | 201 | chipgroup.setSingleSelection(false);
|
@@ -285,22 +260,4 @@ public void isNotSingleLine_initializesAccessibilityNodeInfo() {
|
285 | 260 | assertEquals(1, itemInfo.getRowIndex());
|
286 | 261 | assertTrue(itemInfo.isSelected());
|
287 | 262 | }
|
288 |
| - |
289 |
| - @Test |
290 |
| - public void getChipAccessibilityClassName_multipleChecked_buttonName() { |
291 |
| - Chip chip = (Chip) chipgroup.getChildAt(0); |
292 |
| - assertEquals("android.widget.Button", chip.getAccessibilityClassName().toString()); |
293 |
| - } |
294 |
| - |
295 |
| - @Test |
296 |
| - public void getChipAccessibilityClassName_singleChecked_radioButtonName() { |
297 |
| - chipgroup.setSingleSelection(true); |
298 |
| - Chip chip = (Chip) chipgroup.getChildAt(0); |
299 |
| - assertEquals("android.widget.RadioButton", chip.getAccessibilityClassName().toString()); |
300 |
| - } |
301 |
| - |
302 |
| - private void onChipCheckedStateChanged(CompoundButton chip, boolean checked) { |
303 |
| - checkedChangeCallCount++; |
304 |
| - checkedIds = chipgroup.getCheckedChipIds(); |
305 |
| - } |
306 | 263 | }
|
0 commit comments