本文整理汇总了Java中org.robolectric.shadows.ShadowLooper.unPauseMainLooper方法的典型用法代码示例。如果您正苦于以下问题:Java ShadowLooper.unPauseMainLooper方法的具体用法?Java ShadowLooper.unPauseMainLooper怎么用?Java ShadowLooper.unPauseMainLooper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.robolectric.shadows.ShadowLooper
的用法示例。
在下文中一共展示了ShadowLooper.unPauseMainLooper方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSimpleExecute
import org.robolectric.shadows.ShadowLooper; //导入方法依赖的package包/类
@Test
public void testSimpleExecute() {
ShadowLooper.pauseMainLooper();
mExecutorService.execute(mIncrementCounterRunnable);
Assert.assertEquals(0, mCounter.get());
ShadowLooper.unPauseMainLooper();
Assert.assertEquals(1, mCounter.get());
}
示例2: testQueueSignalOnMainLooper
import org.robolectric.shadows.ShadowLooper; //导入方法依赖的package包/类
@Test
public void testQueueSignalOnMainLooper() {
Looper looper = ShadowLooper.getMainLooper();
SignalQueue queue = new SignalQueueImpl(looper);
Assert.assertEquals(0, queue.getCurrentQueueSize());
ShadowLooper.pauseMainLooper();
queue.queueSignal(new LocalEvent());
queue.queueSignal(new LocalEvent());
queue.queueSignal(new DeviceEvent());
Assert.assertEquals(3, queue.getCurrentQueueSize());
ShadowLooper.unPauseMainLooper();
Assert.assertEquals(0, queue.getCurrentQueueSize());
}
示例3: tearDown
import org.robolectric.shadows.ShadowLooper; //导入方法依赖的package包/类
@After
public void tearDown() {
RxAndroidPlugins.getInstance().reset();
ShadowLooper.unPauseMainLooper();
}
示例4: unPauseMainLooper
import org.robolectric.shadows.ShadowLooper; //导入方法依赖的package包/类
public static void unPauseMainLooper() {
ShadowLooper.unPauseMainLooper();
}