use of androidx.test.filters.FlakyTest in project android_frameworks_opt_telephony by LineageOS.
the class RILTest method testSetSimCardPowerForPowerUpState.
@FlakyTest
@Test
public void testSetSimCardPowerForPowerUpState() throws Exception {
mRILUnderTest.setSimCardPower(TelephonyManager.CARD_POWER_UP, obtainMessage(), new WorkSource());
verify(mRadioProxy).setSimCardPower(mSerialNumberCaptor.capture(), eq(true));
verifyRILResponse(mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_SET_SIM_CARD_POWER);
}
use of androidx.test.filters.FlakyTest in project android_frameworks_opt_telephony by LineageOS.
the class RILTest method testGetModemActivityInfoTimeout.
@FlakyTest
@Test
public void testGetModemActivityInfoTimeout() {
mRILUnderTest.getModemActivityInfo(obtainMessage(), new WorkSource());
assertEquals(1, mRILUnderTest.getRilRequestList().size());
moveTimeForward(DEFAULT_BLOCKING_MESSAGE_RESPONSE_TIMEOUT_MS);
processAllMessages();
assertEquals(0, mRILUnderTest.getRilRequestList().size());
}
use of androidx.test.filters.FlakyTest in project android_frameworks_opt_telephony by LineageOS.
the class RILTest method testSendRetryImsCdmaSms.
@FlakyTest
@Test
public void testSendRetryImsCdmaSms() throws Exception {
CdmaSmsMessage cdmaMsg = new CdmaSmsMessage();
ImsSmsMessage firstMsg = new ImsSmsMessage();
firstMsg.tech = RILConstants.CDMA_PHONE;
firstMsg.retry = false;
firstMsg.messageRef = 0;
firstMsg.cdmaMessage.add(cdmaMsg);
ImsSmsMessage retryMsg = new ImsSmsMessage();
retryMsg.tech = RILConstants.CDMA_PHONE;
retryMsg.retry = true;
retryMsg.messageRef = 0;
retryMsg.cdmaMessage.add(cdmaMsg);
int maxRetryCount = 3;
int firstTransmission = 0;
byte[] pdu = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
for (int i = 0; i <= maxRetryCount; i++) {
mRILUnderTest.sendImsCdmaSms(pdu, i, 0, obtainMessage());
if (i == firstTransmission) {
verify(mRadioProxy, times(1)).sendImsSms(mSerialNumberCaptor.capture(), eq(firstMsg));
verifyRILResponse(mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_IMS_SEND_SMS);
} else {
verify(mRadioProxy, times(i)).sendImsSms(mSerialNumberCaptor.capture(), eq(retryMsg));
verifyRILResponse(mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_IMS_SEND_SMS);
}
}
}
use of androidx.test.filters.FlakyTest in project android_frameworks_opt_telephony by LineageOS.
the class RILTest method testSetSimCardPowerForPowerDownState.
@FlakyTest
@Test
public void testSetSimCardPowerForPowerDownState() throws Exception {
mRILUnderTest.setSimCardPower(TelephonyManager.CARD_POWER_DOWN, obtainMessage(), new WorkSource());
verify(mRadioProxy).setSimCardPower(mSerialNumberCaptor.capture(), eq(false));
verifyRILResponse(mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_SET_SIM_CARD_POWER);
}
use of androidx.test.filters.FlakyTest in project android_frameworks_opt_telephony by LineageOS.
the class ServiceStateTrackerTest method testSpnUpdateShowPlmnOnly.
@FlakyTest
@Ignore
@Test
@MediumTest
public void testSpnUpdateShowPlmnOnly() {
doReturn(0).when(mSimRecords).getCarrierNameDisplayCondition();
doReturn(IccCardApplicationStatus.AppState.APPSTATE_UNKNOWN).when(mUiccCardApplication3gpp).getState();
sst.sendMessage(sst.obtainMessage(ServiceStateTracker.EVENT_NETWORK_STATE_CHANGED, null));
waitForLastHandlerAction(mSSTTestHandler.getThreadHandler());
ArgumentCaptor<Intent> intentArgumentCaptor = ArgumentCaptor.forClass(Intent.class);
verify(mContextFixture.getTestDouble(), times(3)).sendStickyBroadcastAsUser(intentArgumentCaptor.capture(), eq(UserHandle.ALL));
// We only want to verify the intent SERVICE_PROVIDERS_UPDATED.
List<Intent> intents = intentArgumentCaptor.getAllValues();
logd("Total " + intents.size() + " intents");
for (Intent intent : intents) {
logd(" " + intent.getAction());
}
Intent intent = intents.get(2);
assertEquals(TelephonyManager.ACTION_SERVICE_PROVIDERS_UPDATED, intent.getAction());
Bundle b = intent.getExtras();
// For boolean we need to make sure the key exists first
assertTrue(b.containsKey(TelephonyManager.EXTRA_SHOW_SPN));
assertFalse(b.getBoolean(TelephonyManager.EXTRA_SHOW_SPN));
assertEquals(null, b.getString(TelephonyManager.EXTRA_SPN));
assertEquals(null, b.getString(TelephonyManager.EXTRA_DATA_SPN));
// For boolean we need to make sure the key exists first
assertTrue(b.containsKey(TelephonyManager.EXTRA_SHOW_PLMN));
assertTrue(b.getBoolean(TelephonyManager.EXTRA_SHOW_PLMN));
assertEquals(SimulatedCommands.FAKE_LONG_NAME, b.getString(TelephonyManager.EXTRA_PLMN));
ArgumentCaptor<Integer> intArgumentCaptor = ArgumentCaptor.forClass(Integer.class);
verify(mTelephonyManager).setDataNetworkTypeForPhone(anyInt(), intArgumentCaptor.capture());
assertEquals(ServiceState.RIL_RADIO_TECHNOLOGY_HSPA, intArgumentCaptor.getValue().intValue());
}
Aggregations