Package org.robolectric.shadows
Class ShadowWebSettings
java.lang.Object
org.robolectric.shadows.ShadowWebSettings
Shadow of
WebSettings
which returns a dummy user a stub instance rather than the
User-Agent used by a WebView.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static String
getDefaultUserAgent
(Context context) Returns the default User-Agent used by a WebView.static void
reset()
static void
setDefaultUserAgent
(String defaultUserAgent) Sets the default user agent for the WebView.
-
Constructor Details
-
ShadowWebSettings
public ShadowWebSettings()
-
-
Method Details
-
getDefaultUserAgent
Returns the default User-Agent used by a WebView. An instance of WebView could use a different User-Agent if a call is made toWebSettings.setUserAgentString(String)
.- Parameters:
context
- a Context object used to access application assets
-
setDefaultUserAgent
Sets the default user agent for the WebView. The value set here is returned fromgetDefaultUserAgent(Context)
. -
reset
-