1818import android .os .Message ;
1919
2020import io .reactivex .rxjava3 .android .testutil .CountingRunnable ;
21- import io .reactivex .rxjava3 .android .schedulers .HandlerScheduler ;
2221import io .reactivex .rxjava3 .core .Scheduler ;
2322import io .reactivex .rxjava3 .core .Scheduler .Worker ;
2423import io .reactivex .rxjava3 .disposables .Disposable ;
4948import static org .junit .Assert .assertTrue ;
5049import static org .junit .Assert .fail ;
5150import static org .robolectric .Shadows .shadowOf ;
51+ import static org .robolectric .shadows .ShadowLooper .idleMainLooper ;
5252import static org .robolectric .shadows .ShadowLooper .pauseMainLooper ;
5353import static org .robolectric .shadows .ShadowLooper .runUiThreadTasks ;
5454import static org .robolectric .shadows .ShadowLooper .runUiThreadTasksIncludingDelayedTasks ;
@@ -66,8 +66,8 @@ public static Collection<Object[]> data() {
6666 });
6767 }
6868
69- private Scheduler scheduler ;
70- private boolean async ;
69+ private final Scheduler scheduler ;
70+ private final boolean async ;
7171
7272 public HandlerSchedulerTest (boolean async ) {
7373 this .scheduler = new HandlerScheduler (new Handler (Looper .getMainLooper ()), async );
@@ -822,9 +822,4 @@ public void workerSchedulePeriodicallySetAsync() {
822822 Message message = mainMessageQueue .getHead ();
823823 assertEquals (async , message .isAsynchronous ());
824824 }
825-
826- private static void idleMainLooper (long amount , TimeUnit unit ) {
827- // TODO delete this when https://github.com/robolectric/robolectric/pull/2592 is released.
828- ShadowLooper .idleMainLooper (unit .toMillis (amount ));
829- }
830825}
0 commit comments