Use external/robolectric-shadows/run_robotests.mk

This allows Settings to test against the latest framework changes.

Also replaced TestConfig with traditional robolectric.properties.

Bug: 73173204
Bug: 73892008
Test: make -j56 RunSettingsRoboTests
Change-Id: I3135b4fa5f095ba79b282a76f45dd9baa2584bc7
This commit is contained in:
James Lemieux
2018-02-26 00:51:42 -08:00
parent 229a6a2bc4
commit 22a39c2b93
752 changed files with 5096 additions and 9182 deletions

View File

@@ -27,7 +27,6 @@ import android.view.View;
import android.view.ViewGroup;
import com.android.settings.R;
import com.android.settings.TestConfig;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.testutils.shadow.SettingsShadowResources;
import com.android.settings.widget.SwitchBar;
@@ -38,11 +37,7 @@ import org.robolectric.annotation.Config;
import org.robolectric.util.FragmentTestUtil;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION,
shadows = {
SettingsShadowResources.class,
SettingsShadowResources.SettingsShadowTheme.class,
})
@Config(shadows = SettingsShadowResources.SettingsShadowTheme.class)
public class ToggleFeaturePreferenceFragmentTest {
private ToggleFeaturePreferenceFragmentTestable mFragment;
@@ -50,14 +45,12 @@ public class ToggleFeaturePreferenceFragmentTest {
@Test
public void createFragment_shouldOnlyAddPreferencesOnce() {
mFragment = spy(new ToggleFeaturePreferenceFragmentTestable());
FragmentTestUtil.startFragment(mFragment);
// execute exactly once
verify(mFragment).addPreferencesFromResource(R.xml.placeholder_prefs);
}
public static class ToggleFeaturePreferenceFragmentTestable
extends ToggleFeaturePreferenceFragment {