Use binary resource support in robolectric

The resources available to tests are now exactly the merged resources
located in the APK under test.

Bug: 74359828
Test: make -j56 RunSettingsRoboTests
Change-Id: I050db81a92decefea23314b5ec7a62f77ff4bb2b
This commit is contained in:
James Lemieux
2018-12-07 12:56:49 -08:00
committed by Fan Zhang
parent 1f5fab1480
commit f1dade40d2
1005 changed files with 3187 additions and 5478 deletions

View File

@@ -18,17 +18,15 @@ package com.android.settings.wifi.calling;
import static com.google.common.truth.Truth.assertThat;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
@RunWith(SettingsRobolectricTestRunner.class)
@RunWith(RobolectricTestRunner.class)
public class WifiCallingSettingsForSubTest {
@Test
public void getHelpResource_shouldReturn0() {
assertThat(new WifiCallingSettingsForSub().getHelpResource())
.isEqualTo(0);
assertThat(new WifiCallingSettingsForSub().getHelpResource()).isEqualTo(0);
}
}

View File

@@ -55,7 +55,6 @@ import com.android.settings.slices.SliceBroadcastReceiver;
import com.android.settings.slices.SliceData;
import com.android.settings.slices.SlicesFeatureProvider;
import com.android.settings.testutils.FakeFeatureFactory;
import com.android.settings.testutils.SettingsRobolectricTestRunner;
import org.junit.Before;
import org.junit.Test;
@@ -63,12 +62,13 @@ import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import java.util.ArrayList;
import java.util.List;
@RunWith(SettingsRobolectricTestRunner.class)
@RunWith(RobolectricTestRunner.class)
public class WifiCallingSliceHelperTest {
private Context mContext;
@@ -387,7 +387,6 @@ public class WifiCallingSliceHelperTest {
rowContent = (RowContent) rowItems.get(3);
assertThat(rowContent.getTitleItem().getText()).isEqualTo(mContext.getText(
com.android.internal.R.string.wfc_mode_cellular_preferred_summary));
}
private PendingIntent getBroadcastIntent(String action) {
@@ -444,7 +443,7 @@ public class WifiCallingSliceHelperTest {
return mSubId;
}
protected void setDefaultVoiceSubId(int id) {
private void setDefaultVoiceSubId(int id) {
mSubId = id;
}
@@ -463,11 +462,11 @@ public class WifiCallingSliceHelperTest {
return defaultValue;
}
public void setActivationAppIntent(Intent intent) {
private void setActivationAppIntent(Intent intent) {
mActivationAppIntent = intent;
}
public void setIsWifiCallingPrefEditable(boolean isWifiCallingPrefEditable) {
private void setIsWifiCallingPrefEditable(boolean isWifiCallingPrefEditable) {
this.isWifiCallingPrefEditable = isWifiCallingPrefEditable;
}
}