@Test
public void onCallStateChanged_CALL_STATE_OFFHOOK_returnOnCallTrue() {
CallStateListener instance = getInstance(true, false, mockReactContext);
instance.onCallStateChanged(TelephonyManager.CALL_STATE_OFFHOOK, "8675309");
//always set the return flags
verify(mockIntent).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
//Should always fire the event back to Javascript
WritableMap expected = new MockWritableMap();
expected.putString("phonenumber", "8675309");
expected.putString("state", "CALL_STATE_OFFHOOK");
verify(mockEmitter).emit("callStatusUpdate", expected);
//should launch the app
verify(mockApplicationContext).startActivity(mockIntent);
}
CallStateListenerTest.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:react-native-call-events
作者:
评论列表
文章目录