Package org.robolectric.shadows
Class ShadowWebSettings
- java.lang.Object
-
- org.robolectric.shadows.ShadowWebSettings
-
@Implements(android.webkit.WebSettings.class) public class ShadowWebSettings extends Object
Shadow ofWebSettings
which returns a dummy user a stub instance rather than the User-Agent used by a WebView.
-
-
Constructor Summary
Constructors Constructor Description ShadowWebSettings()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected 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.
-
-
-
Method Detail
-
getDefaultUserAgent
@Implementation(minSdk=18) protected static String getDefaultUserAgent(Context context)
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
public static void setDefaultUserAgent(String defaultUserAgent)
Sets the default user agent for the WebView. The value set here is returned fromgetDefaultUserAgent(Context)
.
-
reset
@Resetter public static void reset()
-
-