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

@@ -16,33 +16,30 @@
package com.android.settings.notification;
import static com.google.common.truth.Truth.assertThat;
import android.content.Context;
import android.telephony.TelephonyManager;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import com.android.settings.TestConfig;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.annotation.Config;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.shadows.ShadowApplication;
import java.util.ArrayList;
import java.util.List;
import static com.google.common.truth.Truth.assertThat;
@RunWith(SettingsRobolectricTestRunner.class)
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
public class CastPreferenceControllerTest {
@Mock
private TelephonyManager mTelephonyManager;
private Context mContext;
private CastPreferenceController mController;
@Before
@@ -50,8 +47,7 @@ public class CastPreferenceControllerTest {
MockitoAnnotations.initMocks(this);
ShadowApplication shadowContext = ShadowApplication.getInstance();
shadowContext.setSystemService(Context.TELEPHONY_SERVICE, mTelephonyManager);
mContext = shadowContext.getApplicationContext();
mController = new CastPreferenceController(mContext);
mController = new CastPreferenceController(RuntimeEnvironment.application);
}
@Test
@@ -67,5 +63,4 @@ public class CastPreferenceControllerTest {
assertThat(keys).isEmpty();
}
}