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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringgetDefaultUserAgent(Context context) Returns the default User-Agent used by a WebView.static voidreset()static voidsetDefaultUserAgent(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
-