use of org.robolectric.internal.ResourcesMode in project robolectric by robolectric.
the class RobolectricTestRunner method getSandbox.
@Override
@Nonnull
protected AndroidSandbox getSandbox(FrameworkMethod method) {
RobolectricFrameworkMethod roboMethod = (RobolectricFrameworkMethod) method;
Sdk sdk = roboMethod.getSdk();
InstrumentationConfiguration classLoaderConfig = createClassLoaderConfig(method);
ResourcesMode resourcesMode = roboMethod.getResourcesMode();
if (resourcesMode == ResourcesMode.LEGACY && sdk.getApiLevel() > Build.VERSION_CODES.P) {
throw new AssumptionViolatedException("Robolectric doesn't support legacy mode after P");
}
LooperMode.Mode looperMode = roboMethod.configuration == null ? Mode.LEGACY : roboMethod.configuration.get(LooperMode.Mode.class);
sdk.verifySupportedSdk(method.getDeclaringClass().getName());
return sandboxManager.getAndroidSandbox(classLoaderConfig, sdk, resourcesMode, looperMode);
}
Aggregations