use of androidx.test.filters.FlakyTest in project android_frameworks_opt_telephony by LineageOS.
the class ServiceStateTrackerTest method testCdmaCellLocation.
@FlakyTest
/* flakes 0.86% of the time */
@Test
@MediumTest
public // TODO(nharold): we probably should remove support for this procedure (GET_LOC)
void testCdmaCellLocation() {
CellIdentityCdma cellIdentityCdma = new CellIdentityCdma(1, 2, 3, 4, 5, "test", "tst");
NetworkRegistrationInfo result = new NetworkRegistrationInfo.Builder().setDomain(NetworkRegistrationInfo.DOMAIN_CS).setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN).setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_HOME).setCellIdentity(cellIdentityCdma).build();
sst.sendMessage(sst.obtainMessage(ServiceStateTracker.EVENT_GET_LOC_DONE, new AsyncResult(null, result, null)));
waitForLastHandlerAction(mSSTTestHandler.getThreadHandler());
WorkSource workSource = new WorkSource(Process.myUid(), mContext.getPackageName());
CdmaCellLocation cl = (CdmaCellLocation) sst.getCellIdentity().asCellLocation();
assertEquals(5, cl.getBaseStationLatitude());
assertEquals(4, cl.getBaseStationLongitude());
}
use of androidx.test.filters.FlakyTest in project android_frameworks_opt_telephony by LineageOS.
the class RILTest method testSendRetryImsGsmSms.
@FlakyTest
@Test
public void testSendRetryImsGsmSms() throws Exception {
String smscPdu = "smscPdu";
String pdu = "pdu";
GsmSmsMessage gsmMsg = new GsmSmsMessage();
gsmMsg.smscPdu = smscPdu;
gsmMsg.pdu = pdu;
ImsSmsMessage firstMsg = new ImsSmsMessage();
firstMsg.tech = RILConstants.GSM_PHONE;
firstMsg.retry = false;
firstMsg.messageRef = 0;
firstMsg.gsmMessage.add(gsmMsg);
ImsSmsMessage retryMsg = new ImsSmsMessage();
retryMsg.tech = RILConstants.GSM_PHONE;
retryMsg.retry = true;
retryMsg.messageRef = 0;
retryMsg.gsmMessage.add(gsmMsg);
int maxRetryCount = 3;
int firstTransmission = 0;
for (int i = 0; i <= maxRetryCount; i++) {
mRILUnderTest.sendImsGsmSms(smscPdu, 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 testSendSMSExpectMore.
@FlakyTest
@Test
public void testSendSMSExpectMore() throws Exception {
String smscPdu = "smscPdu";
String pdu = "pdu";
GsmSmsMessage msg = new GsmSmsMessage();
msg.smscPdu = smscPdu;
msg.pdu = pdu;
mRILUnderTest.sendSMSExpectMore(smscPdu, pdu, obtainMessage());
verify(mRadioProxy).sendSMSExpectMore(mSerialNumberCaptor.capture(), eq(msg));
verifyRILResponse(mRILUnderTest, mSerialNumberCaptor.getValue(), RIL_REQUEST_SEND_SMS_EXPECT_MORE);
}
use of androidx.test.filters.FlakyTest in project android_frameworks_opt_telephony by LineageOS.
the class CdmaSmsCbTest method testCmasUnsupportedCharSet.
// VZW requirement is to discard message with unsupported charset. Verify that we return null
// for this unsupported character set.
@FlakyTest
@Ignore
@Test
@SmallTest
public void testCmasUnsupportedCharSet() throws Exception {
SmsMessage msg = createCmasSmsMessage(SmsEnvelope.SERVICE_CATEGORY_CMAS_EXTREME_THREAT, 12345, BearerData.PRIORITY_EMERGENCY, BearerData.LANGUAGE_ENGLISH, 0x1F, EXTREME_ALERT, -1, -1, -1, -1, -1);
SmsCbMessage cbMessage = msg.parseBroadcastSms("", 0, 1);
assertNull("expected null for unsupported charset", cbMessage);
}
use of androidx.test.filters.FlakyTest in project android_frameworks_opt_telephony by LineageOS.
the class ImsPhoneTest method testCallForwardingOption.
@FlakyTest
@Test
@Ignore
public void testCallForwardingOption() throws Exception {
Message msg = mTestHandler.obtainMessage();
mImsPhoneUT.getCallForwardingOption(CF_REASON_UNCONDITIONAL, msg);
ArgumentCaptor<Message> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class);
verify(mImsUtInterface).queryCallForward(eq(ImsUtInterface.CDIV_CF_UNCONDITIONAL), (String) eq(null), messageArgumentCaptor.capture());
assertEquals(msg, messageArgumentCaptor.getValue().obj);
mImsPhoneUT.setCallForwardingOption(CF_ACTION_ENABLE, CF_REASON_UNCONDITIONAL, "1234", 0, msg);
verify(mImsUtInterface).updateCallForward(eq(ImsUtInterface.ACTION_ACTIVATION), eq(ImsUtInterface.CDIV_CF_UNCONDITIONAL), eq("1234"), eq(CommandsInterface.SERVICE_CLASS_VOICE), eq(0), eq(msg));
}
Aggregations