I have the problem with idling resources while testing using Espresso
.
It doesn't work. It is called only twice and that's all, even if return false
.
public class MyIdlingResource implements IdlingResource {
private boolean mIdle;
private ResourceCallback mResourceCallback;
public MyIdlingResource () {
this.mIdle = false;
this.mResourceCallback = null;
}
@Override
public final String getName() {
return ViewAvailabilityClassIdlingResource.class.getSimpleName();
}
@Override
public final boolean isIdleNow() {
ArrayList<View> views = doStuff();
mIdle = views != null && !views.isEmpty();
if (mIdle) {
if (mResourceCallback != null) {
mResourceCallback.onTransitionToIdle();
}
}
return false;
}
@Override
public void registerIdleTransitionCallback(ResourceCallback resourceCallback) {
mResourceCallback = resourceCallback;
}
}
So in this case I return false
all the time, but it doesn't work either.
What is wrong ?
Aucun commentaire:
Enregistrer un commentaire