-
-
Save BartoszJarocki/80ecd01c5e0ad30df5ad7b8cf322711b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void registerRxJavaIdlingResources() { | |
RxIdlingResource rxIdlingResource = new RxIdlingResource(); | |
RxJavaHooks.setOnObservableStart((observable, onSubscribe) -> { | |
rxIdlingResource.incrementActiveSubscriptionsCount(); | |
return onSubscribe; | |
}); | |
RxJavaHooks.setOnObservableReturn(subscription -> { | |
rxIdlingResource.decrementActiveSubscriptionsCount(); | |
return subscription; | |
}); | |
RxJavaHooks.setOnObservableSubscribeError(throwable -> { | |
rxIdlingResource.decrementActiveSubscriptionsCount(); | |
return throwable; | |
}); | |
Espresso.registerIdlingResources(rxIdlingResource); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment