Setup external/robolectric for SettingsRoboTests

Current failing tests: ab/I64100010182936387
Had to Ignore some of com.android.settings.accessibility tests, which will be fixed separately

Bug: 261728063
Test: atest SettingsRoboTests -- --test-arg com.android.tradefed.testtype.IsolatedHostTest:java-flags:-XX:CompressedClassSpaceSize=3g

Change-Id: I4a0cb992db924936826e0c9808accc78dddb5f30
This commit is contained in:
Rex Hoffman
2023-06-07 20:20:58 +00:00
committed by Kevin Liu
parent 4f510190b3
commit 3c961e1c0e
180 changed files with 1339 additions and 157 deletions

View File

@@ -40,7 +40,6 @@ import androidx.preference.PreferenceManager;
import androidx.preference.PreferenceScreen;
import com.android.settings.testutils.FakeFeatureFactory;
import com.android.settings.testutils.shadow.ShadowFragment;
import com.android.settings.widget.WorkOnlyCategory;
import org.junit.After;
@@ -55,6 +54,9 @@ import org.robolectric.annotation.Config;
import org.robolectric.util.ReflectionHelpers;
@RunWith(RobolectricTestRunner.class)
@Config(shadows = {
com.android.settings.testutils.shadow.ShadowFragment.class,
})
public class SettingsPreferenceFragmentTest {
private static final int ITEM_COUNT = 5;
@@ -166,7 +168,6 @@ public class SettingsPreferenceFragmentTest {
}
@Test
@Config(shadows = ShadowFragment.class)
public void onCreate_hasExtraFragmentKey_shouldExpandPreferences() {
doReturn(mContext.getTheme()).when(mActivity).getTheme();
doReturn(mContext.getResources()).when(mFragment).getResources();
@@ -181,7 +182,6 @@ public class SettingsPreferenceFragmentTest {
}
@Test
@Config(shadows = ShadowFragment.class)
public void onCreate_noPreferenceScreen_shouldNotCrash() {
doReturn(mContext.getTheme()).when(mActivity).getTheme();
doReturn(mContext.getResources()).when(mFragment).getResources();