From f46fd991fa0b67dc449c898b0b2a9353f6ed1244 Mon Sep 17 00:00:00 2001 From: Yi-Ling Chuang Date: Wed, 11 Mar 2020 19:12:31 +0800 Subject: [PATCH] Fix DevelopmentSettingsDashboardFragmentTest Fixes: 151206654 Bug: 150907639 Test: robotests Change-Id: I36a1dacc7fe2ccd3b724a9aa135447db97fa3d41 --- .../DevelopmentSettingsDashboardFragmentTest.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/robotests/src/com/android/settings/development/DevelopmentSettingsDashboardFragmentTest.java b/tests/robotests/src/com/android/settings/development/DevelopmentSettingsDashboardFragmentTest.java index 83a48809681..101297b8f89 100644 --- a/tests/robotests/src/com/android/settings/development/DevelopmentSettingsDashboardFragmentTest.java +++ b/tests/robotests/src/com/android/settings/development/DevelopmentSettingsDashboardFragmentTest.java @@ -49,9 +49,9 @@ import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; import org.robolectric.annotation.Implementation; import org.robolectric.annotation.Implements; -import org.robolectric.shadows.androidx.fragment.FragmentController; import org.robolectric.shadow.api.Shadow; import org.robolectric.shadows.ShadowUserManager; +import org.robolectric.shadows.androidx.fragment.FragmentController; import org.robolectric.util.ReflectionHelpers; import java.util.List; @@ -133,7 +133,8 @@ public class DevelopmentSettingsDashboardFragmentTest { @Config(shadows = { ShadowPictureColorModePreferenceController.class, ShadowAdbPreferenceController.class, - ShadowClearAdbKeysPreferenceController.class + ShadowClearAdbKeysPreferenceController.class, + ShadowWirelessDebuggingPreferenceController.class }) public void searchIndex_pageEnabled_shouldNotAddKeysToNonIndexable() { final Context appContext = RuntimeEnvironment.application; @@ -325,4 +326,12 @@ public class DevelopmentSettingsDashboardFragmentTest { return true; } } + + @Implements(WirelessDebuggingPreferenceController.class) + public static class ShadowWirelessDebuggingPreferenceController { + @Implementation + protected boolean isAvailable() { + return true; + } + } }