Fix failing test cases
Test: Run robo test Fix: 148200531 Change-Id: I73698515d6b6572b2d81eb4ca34a3dd7c370968a
This commit is contained in:
@@ -28,14 +28,13 @@ import androidx.appcompat.app.AlertDialog;
|
|||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.robolectric.RobolectricTestRunner;
|
import org.robolectric.RobolectricTestRunner;
|
||||||
import org.robolectric.RuntimeEnvironment;
|
import org.robolectric.RuntimeEnvironment;
|
||||||
|
import org.robolectric.shadows.ShadowLooper;
|
||||||
|
|
||||||
@RunWith(RobolectricTestRunner.class)
|
@RunWith(RobolectricTestRunner.class)
|
||||||
@Ignore
|
|
||||||
public class ListWithEntrySummaryPreferenceTest {
|
public class ListWithEntrySummaryPreferenceTest {
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
@@ -55,6 +54,7 @@ public class ListWithEntrySummaryPreferenceTest {
|
|||||||
public void setUp() {
|
public void setUp() {
|
||||||
mContext = RuntimeEnvironment.application;
|
mContext = RuntimeEnvironment.application;
|
||||||
mContext.setTheme(R.style.Theme_Settings_Home);
|
mContext.setTheme(R.style.Theme_Settings_Home);
|
||||||
|
ShadowLooper.pauseMainLooper();
|
||||||
mPreference = new ListWithEntrySummaryPreference(mContext, null);
|
mPreference = new ListWithEntrySummaryPreference(mContext, null);
|
||||||
mPreference.setEntries(mDefaultEntries);
|
mPreference.setEntries(mDefaultEntries);
|
||||||
mPreference.setEntryValues(mDefaultEntryValues);
|
mPreference.setEntryValues(mDefaultEntryValues);
|
||||||
@@ -62,7 +62,7 @@ public class ListWithEntrySummaryPreferenceTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void initialize_defaultEntries_shouldDisplayDefalutEntries() {
|
public void initialize_defaultEntries_shouldDisplayDefaultEntries() {
|
||||||
AlertDialog dialog = showDialog(mPreference);
|
AlertDialog dialog = showDialog(mPreference);
|
||||||
ListAdapter adapter = dialog.getListView().getAdapter();
|
ListAdapter adapter = dialog.getListView().getAdapter();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user