From 79b69f06d2b38927ba9187c698f5f0b6612b7202 Mon Sep 17 00:00:00 2001 From: Hakan Seyalioglu Date: Thu, 12 Jan 2017 17:08:02 -0800 Subject: [PATCH] Only test the empty state in the right test. Test: Ran the test Change-Id: I03908540d85830dd1165f1672fe49716df55d7a0 --- .../com/android/internal/app/ChooserActivityTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/tests/coretests/src/com/android/internal/app/ChooserActivityTest.java b/core/tests/coretests/src/com/android/internal/app/ChooserActivityTest.java index 8a7b881e4ae87..db0347c8608bd 100644 --- a/core/tests/coretests/src/com/android/internal/app/ChooserActivityTest.java +++ b/core/tests/coretests/src/com/android/internal/app/ChooserActivityTest.java @@ -64,9 +64,11 @@ public class ChooserActivityTest { @Test public void customTitle() throws InterruptedException { Intent sendIntent = createSendImageIntent(); + List resolvedComponentInfos = createResolvedComponentsForTest(2); + when(sOverrides.resolverListController.getResolversForIntent(Mockito.anyBoolean(), Mockito.anyBoolean(), - Mockito.isA(List.class))).thenReturn(null); + Mockito.isA(List.class))).thenReturn(resolvedComponentInfos); mActivityRule.launchActivity(Intent.createChooser(sendIntent, "chooser test")); waitForIdle(); onView(withId(R.id.title)).check(matches(withText("chooser test"))); @@ -74,11 +76,12 @@ public class ChooserActivityTest { @Test public void emptyTitle() throws InterruptedException { - sOverrides.isVoiceInteraction = false; Intent sendIntent = createSendImageIntent(); + List resolvedComponentInfos = createResolvedComponentsForTest(2); + when(sOverrides.resolverListController.getResolversForIntent(Mockito.anyBoolean(), Mockito.anyBoolean(), - Mockito.isA(List.class))).thenReturn(null); + Mockito.isA(List.class))).thenReturn(resolvedComponentInfos); mActivityRule.launchActivity(Intent.createChooser(sendIntent, null)); waitForIdle(); onView(withId(R.id.title))