use of android.support.test.filters.MediumTest in project android_frameworks_opt_telephony by LineageOS.
the class GsmInboundSmsHandlerTest method testWaitingStateTimeout.
@FlakyTest
@Ignore
@Test
@MediumTest
public void testWaitingStateTimeout() throws Exception {
transitionFromStartupToIdle();
// send new SMS to state machine and verify that triggers SMS_DELIVER_ACTION
mGsmInboundSmsHandler.sendMessage(InboundSmsHandler.EVENT_NEW_SMS, new AsyncResult(null, mSmsMessage, null));
waitForMs(100);
ArgumentCaptor<Intent> intentArgumentCaptor = ArgumentCaptor.forClass(Intent.class);
verify(mContext, times(1)).sendBroadcast(intentArgumentCaptor.capture());
assertEquals(Telephony.Sms.Intents.SMS_DELIVER_ACTION, intentArgumentCaptor.getAllValues().get(0).getAction());
assertEquals("WaitingState", getCurrentState().getName());
waitForMs(InboundSmsHandler.STATE_TIMEOUT + 300);
assertEquals("IdleState", getCurrentState().getName());
}
use of android.support.test.filters.MediumTest in project android_frameworks_opt_telephony by LineageOS.
the class GsmInboundSmsHandlerTest method testNewSms.
@FlakyTest
@Ignore
@Test
@MediumTest
public void testNewSms() {
transitionFromStartupToIdle();
// send new SMS to state machine and verify that triggers SMS_DELIVER_ACTION
mGsmInboundSmsHandler.sendMessage(InboundSmsHandler.EVENT_NEW_SMS, new AsyncResult(null, mSmsMessage, null));
waitForMs(100);
verifySmsIntentBroadcasts(0);
// send same SMS again, verify no broadcasts are sent
mGsmInboundSmsHandler.sendMessage(InboundSmsHandler.EVENT_NEW_SMS, new AsyncResult(null, mSmsMessage, null));
waitForMs(100);
verify(mContext, times(2)).sendBroadcast(any(Intent.class));
assertEquals("IdleState", getCurrentState().getName());
}
Aggregations