AnnouncementPeriodicTaskTest.java 文件源码

java
阅读 17 收藏 0 点赞 0 评论 0

项目:mytracks 作者:
public void testRun_ringWhileSpeaking() throws Exception {
  startTask(TextToSpeech.SUCCESS);

  expect(tts.isSpeaking()).andStubReturn(true);
  expect(tts.stop()).andReturn(TextToSpeech.SUCCESS);

  AndroidMock.replay(tts);

  // Update the state to ringing - this should stop the current announcement.
  PhoneStateListener phoneListener = phoneListenerCapture.getValue();
  phoneListener.onCallStateChanged(TelephonyManager.CALL_STATE_RINGING, null);

  // Run the announcement - this should do nothing.
  task.run(null);

  AndroidMock.verify(mockTask, tts);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号