本文整理了Java中org.robolectric.util.Scheduler.idleConstantly()
方法的一些代码示例,展示了Scheduler.idleConstantly()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Scheduler.idleConstantly()
方法的具体详情如下:
包路径:org.robolectric.util.Scheduler
类名称:Scheduler
方法名:idleConstantly
[英]Set the idle state of the Scheduler. If necessary, the clock will be advanced and runnables executed as required by the newly-set state.
[中]设置计划程序的空闲状态。如有必要,时钟将按照新设置状态的要求提前并可运行。
代码示例来源:origin: robolectric/robolectric
public void idleConstantly(boolean shouldIdleConstantly) {
getScheduler().idleConstantly(shouldIdleConstantly);
}
代码示例来源:origin: robolectric/robolectric
@Test
@SuppressWarnings("deprecation")
public void idleConstantly_setsIdleState() {
scheduler.setIdleState(UNPAUSED);
scheduler.idleConstantly(true);
assertThat(scheduler.getIdleState()).isSameAs(CONSTANT_IDLE);
scheduler.idleConstantly(false);
assertThat(scheduler.getIdleState()).isSameAs(UNPAUSED);
}
代码示例来源:origin: robolectric/robolectric
@Test
@SuppressWarnings("deprecation")
public void idleConstantlyTrue_shouldRunAllTasks() {
scheduler.postDelayed(new AddToTranscript("one"), 0);
scheduler.postDelayed(new AddToTranscript("two"), 0);
scheduler.postDelayed(new AddToTranscript("three"), 1000);
assertThat(transcript).isEmpty();
final long time = scheduler.getCurrentTime();
scheduler.idleConstantly(true);
assertThat(transcript).containsExactly("one", "two", "three");
assertThat(scheduler.getCurrentTime()).named("time").isEqualTo(time + 1000);
}
代码示例来源:origin: org.robolectric/shadows-core
public void idleConstantly(boolean shouldIdleConstantly) {
getScheduler().idleConstantly(shouldIdleConstantly);
}
代码示例来源:origin: org.robolectric/shadows-core-v23
public void idleConstantly(boolean shouldIdleConstantly) {
getScheduler().idleConstantly(shouldIdleConstantly);
}
代码示例来源:origin: org.robolectric/framework
public void idleConstantly(boolean shouldIdleConstantly) {
getScheduler().idleConstantly(shouldIdleConstantly);
}
代码示例来源:origin: org.robolectric/shadows-framework
public void idleConstantly(boolean shouldIdleConstantly) {
getScheduler().idleConstantly(shouldIdleConstantly);
}
内容来源于网络,如有侵权,请联系作者删除!