Class DummyMainThread


  • public final class DummyMainThread
    extends Object
    Helper class to simulate main/UI thread in tests.
    • Constructor Detail

      • DummyMainThread

        public DummyMainThread()
    • Method Detail

      • runOnMainThread

        public void runOnMainThread​(Runnable runnable)
        Runs the provided Runnable on the main thread, blocking until execution completes or until TIMEOUT_MS milliseconds have passed.
        Parameters:
        runnable - The Runnable to run.
      • runOnMainThread

        public void runOnMainThread​(int timeoutMs,
                                    Runnable runnable)
        Runs the provided Runnable on the main thread, blocking until execution completes or until timeout milliseconds have passed.
        Parameters:
        timeoutMs - The maximum time to wait in milliseconds.
        runnable - The Runnable to run.
      • release

        public void release()