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

@@ -17,34 +17,20 @@
package com.android.settings;
import static com.android.settings.testutils.ResIdSubject.assertResId;
import static com.google.common.truth.Truth.assertThat;
import android.content.Intent;
import android.os.SystemProperties;
import com.android.settings.testutils.shadow.SettingsShadowSystemProperties;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.setupwizardlib.util.WizardManagerHelper;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.Config;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(
manifest = TestConfig.MANIFEST_PATH,
sdk = TestConfig.SDK_VERSION,
shadows = {
SettingsShadowSystemProperties.class
})
public class SetupWizardUtilsTest {
@After
public void tearDown() {
SettingsShadowSystemProperties.clear();
}
@Test
public void testCopySetupExtras() throws Throwable {
Intent fromIntent = new Intent();
@@ -61,7 +47,7 @@ public class SetupWizardUtilsTest {
@Test
public void testGetTheme_withIntentExtra_shouldReturnExtraTheme() {
SettingsShadowSystemProperties.set(SetupWizardUtils.SYSTEM_PROP_SETUPWIZARD_THEME,
SystemProperties.set(SetupWizardUtils.SYSTEM_PROP_SETUPWIZARD_THEME,
WizardManagerHelper.THEME_GLIF);
Intent intent = new Intent();
intent.putExtra(WizardManagerHelper.EXTRA_THEME, WizardManagerHelper.THEME_GLIF_V2);
@@ -71,7 +57,7 @@ public class SetupWizardUtilsTest {
@Test
public void testGetTheme_withEmptyIntent_shouldReturnSystemProperty() {
SettingsShadowSystemProperties.set(SetupWizardUtils.SYSTEM_PROP_SETUPWIZARD_THEME,
SystemProperties.set(SetupWizardUtils.SYSTEM_PROP_SETUPWIZARD_THEME,
WizardManagerHelper.THEME_GLIF_V2_LIGHT);
Intent intent = new Intent();
@@ -80,7 +66,7 @@ public class SetupWizardUtilsTest {
@Test
public void testGetTheme_glifV3Light_shouldReturnThemeResource() {
SettingsShadowSystemProperties.set(SetupWizardUtils.SYSTEM_PROP_SETUPWIZARD_THEME,
SystemProperties.set(SetupWizardUtils.SYSTEM_PROP_SETUPWIZARD_THEME,
WizardManagerHelper.THEME_GLIF_V3_LIGHT);
Intent intent = new Intent();