Merge "Fix failing test cases in MobileNetworkSummaryControllerTest" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b7b444896e
@@ -133,18 +133,12 @@ public class MobileNetworkSummaryControllerTest {
|
|||||||
assertThat(mController.isAvailable()).isFalse();
|
assertThat(mController.isAvailable()).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
public void getSummary_noSubscriptions_correctSummaryAndClickHandler() {
|
public void getSummary_noSubscriptions_returnSummaryCorrectly() {
|
||||||
mController.displayPreference(mPreferenceScreen);
|
mController.displayPreference(mPreferenceScreen);
|
||||||
mController.onResume();
|
mController.onResume();
|
||||||
assertThat(mController.getSummary()).isEqualTo("Add a network");
|
|
||||||
|
|
||||||
final ArgumentCaptor<Intent> intentCaptor = ArgumentCaptor.forClass(Intent.class);
|
assertThat(mController.getSummary()).isEqualTo("Add a network");
|
||||||
doNothing().when(mContext).startActivity(intentCaptor.capture());
|
|
||||||
mPreference.getOnPreferenceClickListener().onPreferenceClick(mPreference);
|
|
||||||
assertThat(intentCaptor.getValue().getAction()).isEqualTo(
|
|
||||||
EuiccManager.ACTION_PROVISION_EMBEDDED_SUBSCRIPTION);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -300,15 +294,13 @@ public class MobileNetworkSummaryControllerTest {
|
|||||||
assertThat(captor.getValue()).isFalse();
|
assertThat(captor.getValue()).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
public void onResume_noSubscriptionEsimDisabled_isDisabled() {
|
public void onAvailableSubInfoChanged_noSubscriptionEsimDisabled_isDisabled() {
|
||||||
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 0);
|
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 0);
|
||||||
SubscriptionUtil.setAvailableSubscriptionsForTesting(null);
|
|
||||||
when(mEuiccManager.isEnabled()).thenReturn(false);
|
when(mEuiccManager.isEnabled()).thenReturn(false);
|
||||||
mController.displayPreference(mPreferenceScreen);
|
mController.displayPreference(mPreferenceScreen);
|
||||||
|
|
||||||
mController.onResume();
|
mController.onAvailableSubInfoChanged(null);
|
||||||
|
|
||||||
assertThat(mPreference.isEnabled()).isFalse();
|
assertThat(mPreference.isEnabled()).isFalse();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user