New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support WebSettings.getDefaultUserAgent #2128
Comments
Can you show us the code? I do not understand the |
Just came across this same issue using PowerMock @jaredsburrows
and in my test...
Exception.. |
Argh - sorry I didn't see this email the first time around. We have a class that's passed a We ended up modifying our test to set |
Can you try this with binary resource mode and Robolectric 4.0, its likely that it should "just work" as we've done a lot of work to get the resources / manifest / package names right:- We've revamped resources in Robolectric 4.0 to process the binary resource files + arsc table produced by aapt and the resource handling code is now much closer to that of the framework. This includes changes to parse the merged manifest using the Android platform code and an overhaul of our PackageManager support. Mind giving this a try with 4.0 + binary resources by configuring your gradle.build as follows:- testImplementation "org.robolectric:robolectric:4.0"
android {
enableUnitTestBinaryResources=true
testOptions {
unitTests {
includeAndroidResources = true
}
}
} We're doing a big bug scrub and trying to be aggressive about it so apologies if this was closed in error, in which case feel free to reopen. If this is still an issue an example project with failing test would be most helpful. |
This should be reopened. Still a bug as of Robolectric 4.0.2. |
We have some code that calls WebSettings#getDefaultUserAgent(), which is not faked in Robolectric 3.0. This leads to exceptions in the PackageManager when trying to load WebViewFactory:
The text was updated successfully, but these errors were encountered: