
org.robolectric.shadows.LooperShadowPicker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of shadows-framework Show documentation
Show all versions of shadows-framework Show documentation
An alternative Android testing framework.
The newest version!
package org.robolectric.shadows;
import org.robolectric.shadow.api.ShadowPicker;
public class LooperShadowPicker implements ShadowPicker {
private Class extends T> legacyShadowClass;
private Class extends T> pausedShadowClass;
public LooperShadowPicker(
Class extends T> legacyShadowClass, Class extends T> pausedShadowClass) {
this.legacyShadowClass = legacyShadowClass;
this.pausedShadowClass = pausedShadowClass;
}
@Override
@SuppressWarnings("deprecation") // This is Robolectric library code
public Class extends T> pickShadowClass() {
switch (ShadowLooper.looperMode()) {
case LEGACY:
return legacyShadowClass;
case PAUSED:
case INSTRUMENTATION_TEST:
return pausedShadowClass;
}
throw new UnsupportedOperationException("Unrecognized looperMode " + ShadowLooper.looperMode());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy