org.robolectric.util.Scheduler.idleConstantly()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(134)

本文整理了Java中org.robolectric.util.Scheduler.idleConstantly()方法的一些代码示例,展示了Scheduler.idleConstantly()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Scheduler.idleConstantly()方法的具体详情如下:
包路径:org.robolectric.util.Scheduler
类名称:Scheduler
方法名:idleConstantly

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);
}

相关文章