Package org.robolectric.fakes
Class RoboWebSettings
java.lang.Object
android.webkit.WebSettings
org.robolectric.fakes.RoboWebSettings
Robolectric implementation of
WebSettings.-
Nested Class Summary
Nested classes/interfaces inherited from class android.webkit.WebSettings
WebSettings.CacheMode, WebSettings.ForceDark, WebSettings.LayoutAlgorithm, WebSettings.PluginState, WebSettings.RenderPriority, WebSettings.TextSize, WebSettings.ZoomDensity -
Field Summary
Fields inherited from class android.webkit.WebSettings
ENABLE_SIMPLIFIED_DARK_MODE, ENABLE_USER_AGENT_REDUCTION, FORCE_DARK_AUTO, FORCE_DARK_OFF, FORCE_DARK_ON, LOAD_CACHE_ELSE_NETWORK, LOAD_CACHE_ONLY, LOAD_DEFAULT, LOAD_NO_CACHE, LOAD_NORMAL, MENU_ITEM_NONE, MENU_ITEM_PROCESS_TEXT, MENU_ITEM_SHARE, MENU_ITEM_WEB_SEARCH, MIXED_CONTENT_ALWAYS_ALLOW, MIXED_CONTENT_COMPATIBILITY_MODE, MIXED_CONTENT_NEVER_ALLOW -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbooleanbooleanbooleanbooleanbooleanlongbooleanbooleanbooleanintbooleanintintstatic StringReturns the default User-Agent used by a WebView.intbooleanbooleanintbooleanbooleanbooleanbooleanbooleanbooleanbooleanintintintbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanintintbooleanbooleanbooleanvoidsetAcceptThirdPartyCookies(boolean acceptThirdPartyCookies) voidsetAllowContentAccess(boolean allow) voidsetAllowFileAccess(boolean allow) voidsetAllowFileAccessFromFileURLs(boolean allow) voidsetAllowUniversalAccessFromFileURLs(boolean allow) voidsetAppCacheEnabled(boolean appCacheEnabled) voidsetAppCacheMaxSize(long appCacheMaxSize) voidsetAppCachePath(String appCachePath) voidsetBlockNetworkImage(boolean flag) voidsetBlockNetworkLoads(boolean flag) voidsetBuiltInZoomControls(boolean enabled) voidsetCacheMode(int mode) voidsetCursiveFontFamily(String cursiveFontFamily) voidsetDatabaseEnabled(boolean flag) voidsetDatabasePath(String path) voidsetDefaultFixedFontSize(int defaultFixedFontSize) voidsetDefaultFontSize(int defaultFontSize) voidsetDefaultTextEncodingName(String defaultTextEncoding) static voidsetDefaultUserAgentOverride(String defaultUserAgent) Overrides the default user agent for all WebViews.voidvoidsetDisabledActionModeMenuItems(int menuItems) voidsetDisplayZoomControls(boolean enabled) voidsetDomStorageEnabled(boolean flag) voidsetEnableSmoothTransition(boolean enableSmoothTransition) voidsetFantasyFontFamily(String fantasyFontFamily) voidsetFixedFontFamily(String fixedFontFamily) voidsetForceDark(int forceDark) voidsetGeolocationDatabasePath(String geolocationDatabasePath) voidsetGeolocationEnabled(boolean geolocationEnabled) voidsetJavaScriptCanOpenWindowsAutomatically(boolean javaScriptCanOpenWindowAutomatically) voidsetJavaScriptEnabled(boolean flag) voidsetLayoutAlgorithm(WebSettings.LayoutAlgorithm algorithm) voidsetLightTouchEnabled(boolean flag) voidsetLoadsImagesAutomatically(boolean loadsImagesAutomatically) voidsetLoadWithOverviewMode(boolean flag) voidsetMediaPlaybackRequiresUserGesture(boolean require) voidsetMinimumFontSize(int minimumFontSize) voidsetMinimumLogicalFontSize(int minimumLogicalFontSize) voidsetMixedContentMode(int mixedContentMode) voidsetNavDump(boolean navDump) voidsetNeedInitialFocus(boolean flag) voidsetOffscreenPreRaster(boolean enabled) voidsetPluginsEnabled(boolean flag) voidvoidsetRenderPriority(WebSettings.RenderPriority priority) voidsetSafeBrowsingEnabled(boolean enabled) voidsetSansSerifFontFamily(String sansSerifFontFamily) voidsetSaveFormData(boolean saveFormData) voidsetSavePassword(boolean savePassword) voidsetSerifFontFamily(String serifFontFamily) voidsetStandardFontFamily(String standardFontFamily) voidsetSupportMultipleWindows(boolean support) voidsetSupportZoom(boolean support) voidsetTextZoom(int textZoom) voidsetUserAgent(int userAgent) voidvoidsetUseWebViewBackgroundForOverscrollBackground(boolean useWebViewBackgroundForOverscrollBackground) voidsetUseWideViewPort(boolean useWideViewPort) voidbooleanbooleanMethods inherited from class android.webkit.WebSettings
getDefaultUserAgent, getPluginsPath, getTextSize, getUseDoubleTree, isAlgorithmicDarkeningAllowed, setAlgorithmicDarkeningAllowed, setPluginsPath, setTextSize, setUseDoubleTree
-
Constructor Details
-
RoboWebSettings
public RoboWebSettings()
-
-
Method Details
-
getBlockNetworkImage
public boolean getBlockNetworkImage()- Specified by:
getBlockNetworkImagein classWebSettings
-
setBlockNetworkImage
public void setBlockNetworkImage(boolean flag) - Specified by:
setBlockNetworkImagein classWebSettings
-
getJavaScriptEnabled
public boolean getJavaScriptEnabled()- Specified by:
getJavaScriptEnabledin classWebSettings
-
setJavaScriptEnabled
public void setJavaScriptEnabled(boolean flag) - Specified by:
setJavaScriptEnabledin classWebSettings
-
getLightTouchEnabled
public boolean getLightTouchEnabled()- Specified by:
getLightTouchEnabledin classWebSettings
-
setLightTouchEnabled
public void setLightTouchEnabled(boolean flag) - Specified by:
setLightTouchEnabledin classWebSettings
-
getNeedInitialFocus
public boolean getNeedInitialFocus() -
setNeedInitialFocus
public void setNeedInitialFocus(boolean flag) - Specified by:
setNeedInitialFocusin classWebSettings
-
setRenderPriority
- Specified by:
setRenderPriorityin classWebSettings
-
getRenderPriority
-
getPluginsEnabled
public boolean getPluginsEnabled()- Specified by:
getPluginsEnabledin classWebSettings
-
setPluginsEnabled
public void setPluginsEnabled(boolean flag) - Specified by:
setPluginsEnabledin classWebSettings
-
getSupportMultipleWindows
public boolean getSupportMultipleWindows() -
setSupportMultipleWindows
public void setSupportMultipleWindows(boolean support) - Specified by:
setSupportMultipleWindowsin classWebSettings
-
getSupportZoom
public boolean getSupportZoom() -
setSupportZoom
public void setSupportZoom(boolean support) - Specified by:
setSupportZoomin classWebSettings
-
setCacheMode
public void setCacheMode(int mode) - Specified by:
setCacheModein classWebSettings
-
getCacheMode
public int getCacheMode()- Specified by:
getCacheModein classWebSettings
-
getUseWideViewPort
public boolean getUseWideViewPort()- Specified by:
getUseWideViewPortin classWebSettings
-
setUseWideViewPort
public void setUseWideViewPort(boolean useWideViewPort) - Specified by:
setUseWideViewPortin classWebSettings
-
getSaveFormData
public boolean getSaveFormData()- Specified by:
getSaveFormDatain classWebSettings
-
setSaveFormData
public void setSaveFormData(boolean saveFormData) - Specified by:
setSaveFormDatain classWebSettings
-
setJavaScriptCanOpenWindowsAutomatically
public void setJavaScriptCanOpenWindowsAutomatically(boolean javaScriptCanOpenWindowAutomatically) - Specified by:
setJavaScriptCanOpenWindowsAutomaticallyin classWebSettings
-
getJavaScriptCanOpenWindowsAutomatically
public boolean getJavaScriptCanOpenWindowsAutomatically()- Specified by:
getJavaScriptCanOpenWindowsAutomaticallyin classWebSettings
-
setLayoutAlgorithm
- Specified by:
setLayoutAlgorithmin classWebSettings
-
getDefaultTextEncodingName
- Specified by:
getDefaultTextEncodingNamein classWebSettings
-
setDefaultTextEncodingName
- Specified by:
setDefaultTextEncodingNamein classWebSettings
-
getDefaultFontSize
public int getDefaultFontSize()- Specified by:
getDefaultFontSizein classWebSettings
-
setDefaultFontSize
public void setDefaultFontSize(int defaultFontSize) - Specified by:
setDefaultFontSizein classWebSettings
-
getLoadsImagesAutomatically
public boolean getLoadsImagesAutomatically()- Specified by:
getLoadsImagesAutomaticallyin classWebSettings
-
setLoadsImagesAutomatically
public void setLoadsImagesAutomatically(boolean loadsImagesAutomatically) - Specified by:
setLoadsImagesAutomaticallyin classWebSettings
-
getDefaultFixedFontSize
public int getDefaultFixedFontSize()- Specified by:
getDefaultFixedFontSizein classWebSettings
-
setDefaultFixedFontSize
public void setDefaultFixedFontSize(int defaultFixedFontSize) - Specified by:
setDefaultFixedFontSizein classWebSettings
-
getMinimumLogicalFontSize
public int getMinimumLogicalFontSize()- Specified by:
getMinimumLogicalFontSizein classWebSettings
-
setMinimumLogicalFontSize
public void setMinimumLogicalFontSize(int minimumLogicalFontSize) - Specified by:
setMinimumLogicalFontSizein classWebSettings
-
getMinimumFontSize
public int getMinimumFontSize()- Specified by:
getMinimumFontSizein classWebSettings
-
setMinimumFontSize
public void setMinimumFontSize(int minimumFontSize) - Specified by:
setMinimumFontSizein classWebSettings
-
getFantasyFontFamily
- Specified by:
getFantasyFontFamilyin classWebSettings
-
setFantasyFontFamily
- Specified by:
setFantasyFontFamilyin classWebSettings
-
getCursiveFontFamily
- Specified by:
getCursiveFontFamilyin classWebSettings
-
setCursiveFontFamily
- Specified by:
setCursiveFontFamilyin classWebSettings
-
getSerifFontFamily
- Specified by:
getSerifFontFamilyin classWebSettings
-
setSerifFontFamily
- Specified by:
setSerifFontFamilyin classWebSettings
-
getSansSerifFontFamily
- Specified by:
getSansSerifFontFamilyin classWebSettings
-
setSansSerifFontFamily
- Specified by:
setSansSerifFontFamilyin classWebSettings
-
getFixedFontFamily
- Specified by:
getFixedFontFamilyin classWebSettings
-
setFixedFontFamily
- Specified by:
setFixedFontFamilyin classWebSettings
-
getStandardFontFamily
- Specified by:
getStandardFontFamilyin classWebSettings
-
setStandardFontFamily
- Specified by:
setStandardFontFamilyin classWebSettings
-
getLayoutAlgorithm
- Specified by:
getLayoutAlgorithmin classWebSettings
-
supportMultipleWindows
public boolean supportMultipleWindows()- Specified by:
supportMultipleWindowsin classWebSettings
-
getSavePassword
public boolean getSavePassword()- Specified by:
getSavePasswordin classWebSettings
-
setSavePassword
public void setSavePassword(boolean savePassword) - Specified by:
setSavePasswordin classWebSettings
-
supportZoom
public boolean supportZoom()- Specified by:
supportZoomin classWebSettings
-
getUserAgent
public int getUserAgent()- Specified by:
getUserAgentin classWebSettings
-
setUserAgent
public void setUserAgent(int userAgent) - Specified by:
setUserAgentin classWebSettings
-
getAllowFileAccess
public boolean getAllowFileAccess()- Specified by:
getAllowFileAccessin classWebSettings
-
setAllowFileAccess
public void setAllowFileAccess(boolean allow) - Specified by:
setAllowFileAccessin classWebSettings
-
getBuiltInZoomControls
public boolean getBuiltInZoomControls()- Specified by:
getBuiltInZoomControlsin classWebSettings
-
setBuiltInZoomControls
public void setBuiltInZoomControls(boolean enabled) - Specified by:
setBuiltInZoomControlsin classWebSettings
-
setUserAgentString
- Specified by:
setUserAgentStringin classWebSettings
-
getUserAgentString
- Specified by:
getUserAgentStringin classWebSettings
-
getDatabaseEnabled
public boolean getDatabaseEnabled()- Specified by:
getDatabaseEnabledin classWebSettings
-
setDatabaseEnabled
public void setDatabaseEnabled(boolean flag) - Specified by:
setDatabaseEnabledin classWebSettings
-
setDatabasePath
- Specified by:
setDatabasePathin classWebSettings
-
getDatabasePath
- Specified by:
getDatabasePathin classWebSettings
-
getGeolocationDatabasePath
-
setGeolocationDatabasePath
- Specified by:
setGeolocationDatabasePathin classWebSettings
-
getGeolocationEnabled
public boolean getGeolocationEnabled() -
setGeolocationEnabled
public void setGeolocationEnabled(boolean geolocationEnabled) - Specified by:
setGeolocationEnabledin classWebSettings
-
setDefaultZoom
- Specified by:
setDefaultZoomin classWebSettings
-
getDefaultZoom
- Specified by:
getDefaultZoomin classWebSettings
-
getDomStorageEnabled
public boolean getDomStorageEnabled()- Specified by:
getDomStorageEnabledin classWebSettings
-
setDomStorageEnabled
public void setDomStorageEnabled(boolean flag) - Specified by:
setDomStorageEnabledin classWebSettings
-
getLoadWithOverviewMode
public boolean getLoadWithOverviewMode()- Specified by:
getLoadWithOverviewModein classWebSettings
-
setLoadWithOverviewMode
public void setLoadWithOverviewMode(boolean flag) - Specified by:
setLoadWithOverviewModein classWebSettings
-
getAppCacheEnabled
public boolean getAppCacheEnabled() -
setAppCacheEnabled
public void setAppCacheEnabled(boolean appCacheEnabled) - Overrides:
setAppCacheEnabledin classWebSettings
-
setAppCacheMaxSize
public void setAppCacheMaxSize(long appCacheMaxSize) - Overrides:
setAppCacheMaxSizein classWebSettings
-
getAppCacheMaxSize
public long getAppCacheMaxSize() -
getAppCachePath
-
setAppCachePath
- Overrides:
setAppCachePathin classWebSettings
-
getBlockNetworkLoads
public boolean getBlockNetworkLoads()- Specified by:
getBlockNetworkLoadsin classWebSettings
-
setBlockNetworkLoads
public void setBlockNetworkLoads(boolean flag) - Specified by:
setBlockNetworkLoadsin classWebSettings
-
getPluginState
- Specified by:
getPluginStatein classWebSettings
-
setPluginState
- Specified by:
setPluginStatein classWebSettings
-
getUseWebViewBackgroundForOverscrollBackground
public boolean getUseWebViewBackgroundForOverscrollBackground()- Specified by:
getUseWebViewBackgroundForOverscrollBackgroundin classWebSettings
-
setUseWebViewBackgroundForOverscrollBackground
public void setUseWebViewBackgroundForOverscrollBackground(boolean useWebViewBackgroundForOverscrollBackground) - Specified by:
setUseWebViewBackgroundForOverscrollBackgroundin classWebSettings
-
enableSmoothTransition
public boolean enableSmoothTransition()- Specified by:
enableSmoothTransitionin classWebSettings
-
setEnableSmoothTransition
public void setEnableSmoothTransition(boolean enableSmoothTransition) - Specified by:
setEnableSmoothTransitionin classWebSettings
-
setAllowContentAccess
public void setAllowContentAccess(boolean allow) - Specified by:
setAllowContentAccessin classWebSettings
-
getAllowContentAccess
public boolean getAllowContentAccess()- Specified by:
getAllowContentAccessin classWebSettings
-
setDisplayZoomControls
public void setDisplayZoomControls(boolean enabled) - Specified by:
setDisplayZoomControlsin classWebSettings
-
getDisplayZoomControls
public boolean getDisplayZoomControls()- Specified by:
getDisplayZoomControlsin classWebSettings
-
getTextZoom
public int getTextZoom()- Specified by:
getTextZoomin classWebSettings
-
setTextZoom
public void setTextZoom(int textZoom) - Specified by:
setTextZoomin classWebSettings
-
getAllowFileAccessFromFileURLs
public boolean getAllowFileAccessFromFileURLs()- Specified by:
getAllowFileAccessFromFileURLsin classWebSettings
-
setAllowFileAccessFromFileURLs
public void setAllowFileAccessFromFileURLs(boolean allow) - Specified by:
setAllowFileAccessFromFileURLsin classWebSettings
-
getAllowUniversalAccessFromFileURLs
public boolean getAllowUniversalAccessFromFileURLs()- Specified by:
getAllowUniversalAccessFromFileURLsin classWebSettings
-
setAllowUniversalAccessFromFileURLs
public void setAllowUniversalAccessFromFileURLs(boolean allow) - Specified by:
setAllowUniversalAccessFromFileURLsin classWebSettings
-
getMediaPlaybackRequiresUserGesture
public boolean getMediaPlaybackRequiresUserGesture()- Specified by:
getMediaPlaybackRequiresUserGesturein classWebSettings
-
setMediaPlaybackRequiresUserGesture
public void setMediaPlaybackRequiresUserGesture(boolean require) - Specified by:
setMediaPlaybackRequiresUserGesturein classWebSettings
-
setMixedContentMode
public void setMixedContentMode(int mixedContentMode) - Specified by:
setMixedContentModein classWebSettings
-
getMixedContentMode
public int getMixedContentMode()- Specified by:
getMixedContentModein classWebSettings
-
setVideoOverlayForEmbeddedEncryptedVideoEnabled
public void setVideoOverlayForEmbeddedEncryptedVideoEnabled(boolean b) - Specified by:
setVideoOverlayForEmbeddedEncryptedVideoEnabledin classWebSettings
-
getVideoOverlayForEmbeddedEncryptedVideoEnabled
public boolean getVideoOverlayForEmbeddedEncryptedVideoEnabled()- Specified by:
getVideoOverlayForEmbeddedEncryptedVideoEnabledin classWebSettings
-
getAcceptThirdPartyCookies
public boolean getAcceptThirdPartyCookies()- Specified by:
getAcceptThirdPartyCookiesin classWebSettings
-
setAcceptThirdPartyCookies
public void setAcceptThirdPartyCookies(boolean acceptThirdPartyCookies) - Specified by:
setAcceptThirdPartyCookiesin classWebSettings
-
setOffscreenPreRaster
public void setOffscreenPreRaster(boolean enabled) - Specified by:
setOffscreenPreRasterin classWebSettings
-
getOffscreenPreRaster
public boolean getOffscreenPreRaster()- Specified by:
getOffscreenPreRasterin classWebSettings
-
getDisabledActionModeMenuItems
public int getDisabledActionModeMenuItems()- Specified by:
getDisabledActionModeMenuItemsin classWebSettings
-
setDisabledActionModeMenuItems
public void setDisabledActionModeMenuItems(int menuItems) - Specified by:
setDisabledActionModeMenuItemsin classWebSettings
-
getSafeBrowsingEnabled
public boolean getSafeBrowsingEnabled()- Specified by:
getSafeBrowsingEnabledin classWebSettings
-
setSafeBrowsingEnabled
public void setSafeBrowsingEnabled(boolean enabled) - Specified by:
setSafeBrowsingEnabledin classWebSettings
-
getForceDark
public int getForceDark()- Overrides:
getForceDarkin classWebSettings
-
setForceDark
public void setForceDark(int forceDark) - Overrides:
setForceDarkin classWebSettings
-
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).The default User-Agent can be overridden (for the entire application) by calling
setDefaultUserAgentOverride(String). -
setDefaultUserAgentOverride
Overrides the default user agent for all WebViews. The value set here is returned fromgetDefaultUserAgent().Note that particular WebView instances will ignore this value if they have been configured with a custom user agent via
WebSettings.setUserAgentString(String).If the value is null, the default user agent will be provided by Robolectric.
-