TrackRecordingServiceTest.java 文件源码

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

项目:mytracks 作者:
@MediumTest
public void disabledTestResumeAfterReboot_simulateReboot() throws Exception {
  updateAutoResumePrefs(PreferencesUtils.AUTO_RESUME_TRACK_CURRENT_RETRY_DEFAULT,
      PreferencesUtils.AUTO_RESUME_TRACK_TIMEOUT_DEFAULT);
  ITrackRecordingService service = bindAndGetService(createStartIntent());
  assertFalse(service.isRecording());

  // Simulate recording a track.
  long id = service.startNewTrack();
  assertTrue(service.isRecording());
  assertEquals(id, service.getRecordingTrackId());
  shutdownService();
  assertEquals(id, PreferencesUtils.getLong(context, R.string.recording_track_id_key));

  // Start the service in "resume" mode (simulates the on-reboot action).
  Intent startIntent = createStartIntent();
  startIntent.putExtra(TrackRecordingService.RESUME_TRACK_EXTRA_NAME, true);
  startService(startIntent);
  assertNotNull(getService());

  assertTrue(getService().isRecording());
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号