Index: android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java |
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java |
index c85061db8dcd270279c8000ef219f5b808eaaa67..e3fc61663993e2da009f1a60f3eaafd0450b1465 100644 |
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java |
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwSettingsTest.java |
@@ -18,6 +18,7 @@ import org.apache.http.Header; |
import org.apache.http.HttpRequest; |
import org.chromium.android_webview.AndroidProtocolHandler; |
import org.chromium.android_webview.AwContents; |
+import org.chromium.android_webview.AwSettings.LayoutAlgorithm; |
import org.chromium.android_webview.AwSettings; |
import org.chromium.android_webview.InterceptedRequestData; |
import org.chromium.android_webview.test.util.CommonResources; |
@@ -28,8 +29,6 @@ import org.chromium.base.test.util.DisabledTest; |
import org.chromium.base.test.util.Feature; |
import org.chromium.base.test.util.TestFileUtil; |
import org.chromium.base.test.util.UrlUtils; |
-import org.chromium.content.browser.ContentSettings; |
-import org.chromium.content.browser.ContentSettings.LayoutAlgorithm; |
import org.chromium.content.browser.ContentViewCore; |
import org.chromium.content.browser.test.util.CallbackHelper; |
import org.chromium.content.browser.test.util.Criteria; |
@@ -46,7 +45,7 @@ import java.util.ArrayList; |
import java.util.List; |
/** |
- * A test suite for ContentSettings class. The key objective is to verify that each |
+ * A test suite for AwSettings class. The key objective is to verify that each |
* settings applies either to each individual view or to all views of the |
* application |
*/ |
@@ -58,7 +57,7 @@ public class AwSettingsTest extends AwTestBase { |
private static final boolean DISABLED = false; |
/** |
- * A helper class for testing a particular preference from ContentSettings. |
+ * A helper class for testing a particular preference from AwSettings. |
* The generic type T is the type of the setting. Usually, to test an |
* effect of the preference, JS code is executed that sets document's title. |
* In this case, requiresJsEnabled constructor argument must be set to true. |
@@ -66,16 +65,16 @@ public class AwSettingsTest extends AwTestBase { |
abstract class AwSettingsTestHelper<T> { |
protected final AwContents mAwContents; |
protected final TestAwContentsClient mContentViewClient; |
- protected final ContentSettings mContentSettings; |
+ protected final AwSettings mAwSettings; |
AwSettingsTestHelper(AwContents awContents, |
TestAwContentsClient contentViewClient, |
boolean requiresJsEnabled) throws Throwable { |
mAwContents = awContents; |
mContentViewClient = contentViewClient; |
- mContentSettings = getContentSettingsOnUiThread(mAwContents); |
+ mAwSettings = AwSettingsTest.this.getAwSettingsOnUiThread(awContents); |
if (requiresJsEnabled) { |
- mContentSettings.setJavaScriptEnabled(true); |
+ mAwSettings.setJavaScriptEnabled(true); |
} |
} |
@@ -165,12 +164,12 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected Boolean getCurrentValue() { |
- return mContentSettings.getJavaScriptEnabled(); |
+ return mAwSettings.getJavaScriptEnabled(); |
} |
@Override |
protected void setCurrentValue(Boolean value) { |
- mContentSettings.setJavaScriptEnabled(value); |
+ mAwSettings.setJavaScriptEnabled(value); |
} |
@Override |
@@ -233,12 +232,12 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected Boolean getCurrentValue() { |
- return mContentSettings.getPluginsEnabled(); |
+ return mAwSettings.getPluginsEnabled(); |
} |
@Override |
protected void setCurrentValue(Boolean value) { |
- mContentSettings.setPluginsEnabled(value); |
+ mAwSettings.setPluginsEnabled(value); |
} |
@Override |
@@ -274,12 +273,12 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected String getCurrentValue() { |
- return mContentSettings.getStandardFontFamily(); |
+ return mAwSettings.getStandardFontFamily(); |
} |
@Override |
protected void setCurrentValue(String value) { |
- mContentSettings.setStandardFontFamily(value); |
+ mAwSettings.setStandardFontFamily(value); |
} |
@Override |
@@ -314,12 +313,12 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected Integer getCurrentValue() { |
- return mContentSettings.getDefaultFontSize(); |
+ return mAwSettings.getDefaultFontSize(); |
} |
@Override |
protected void setCurrentValue(Integer value) { |
- mContentSettings.setDefaultFontSize(value); |
+ mAwSettings.setDefaultFontSize(value); |
} |
@Override |
@@ -358,12 +357,12 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected Boolean getCurrentValue() { |
- return mContentSettings.getLoadsImagesAutomatically(); |
+ return mAwSettings.getLoadsImagesAutomatically(); |
} |
@Override |
protected void setCurrentValue(Boolean value) { |
- mContentSettings.setLoadsImagesAutomatically(value); |
+ mAwSettings.setLoadsImagesAutomatically(value); |
} |
@Override |
@@ -395,12 +394,12 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected String getCurrentValue() { |
- return mContentSettings.getDefaultTextEncodingName(); |
+ return mAwSettings.getDefaultTextEncodingName(); |
} |
@Override |
protected void setCurrentValue(String value) { |
- mContentSettings.setDefaultTextEncodingName(value); |
+ mAwSettings.setDefaultTextEncodingName(value); |
} |
@Override |
@@ -423,7 +422,7 @@ public class AwSettingsTest extends AwTestBase { |
AwContents awContents, |
TestAwContentsClient contentViewClient) throws Throwable { |
super(awContents, contentViewClient, true); |
- mDefaultUa = mContentSettings.getUserAgentString(); |
+ mDefaultUa = mAwSettings.getUserAgentString(); |
} |
@Override |
@@ -443,13 +442,13 @@ public class AwSettingsTest extends AwTestBase { |
// and getUserAgentString returns the default UA string afterwards. |
// To align with the framework, we return an empty string instead of |
// the default UA. |
- String currentUa = mContentSettings.getUserAgentString(); |
+ String currentUa = mAwSettings.getUserAgentString(); |
return mDefaultUa.equals(currentUa) ? DEFAULT_UA : currentUa; |
} |
@Override |
protected void setCurrentValue(String value) { |
- mContentSettings.setUserAgentString(value); |
+ mAwSettings.setUserAgentString(value); |
} |
@Override |
@@ -487,12 +486,12 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected Boolean getCurrentValue() { |
- return mContentSettings.getDomStorageEnabled(); |
+ return mAwSettings.getDomStorageEnabled(); |
} |
@Override |
protected void setCurrentValue(Boolean value) { |
- mContentSettings.setDomStorageEnabled(value); |
+ mAwSettings.setDomStorageEnabled(value); |
} |
@Override |
@@ -528,12 +527,12 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected Boolean getCurrentValue() { |
- return mContentSettings.getDatabaseEnabled(); |
+ return mAwSettings.getDatabaseEnabled(); |
} |
@Override |
protected void setCurrentValue(Boolean value) { |
- mContentSettings.setDatabaseEnabled(value); |
+ mAwSettings.setDatabaseEnabled(value); |
} |
@Override |
@@ -560,11 +559,11 @@ public class AwSettingsTest extends AwTestBase { |
mIframeContainerUrl = UrlUtils.getTestFileUrl("webview/iframe_access.html"); |
mIframeUrl = UrlUtils.getTestFileUrl("webview/hello_world.html"); |
// The value of the setting depends on the SDK version. |
- mContentSettings.setAllowUniversalAccessFromFileURLs(false); |
+ mAwSettings.setAllowUniversalAccessFromFileURLs(false); |
// If universal access is true, the value of file access doesn't |
// matter. While if universal access is false, having file access |
// enabled will allow file loading. |
- mContentSettings.setAllowFileAccessFromFileURLs(false); |
+ mAwSettings.setAllowFileAccessFromFileURLs(false); |
} |
@Override |
@@ -579,12 +578,12 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected Boolean getCurrentValue() { |
- return mContentSettings.getAllowUniversalAccessFromFileURLs(); |
+ return mAwSettings.getAllowUniversalAccessFromFileURLs(); |
} |
@Override |
protected void setCurrentValue(Boolean value) { |
- mContentSettings.setAllowUniversalAccessFromFileURLs(value); |
+ mAwSettings.setAllowUniversalAccessFromFileURLs(value); |
} |
@Override |
@@ -610,9 +609,9 @@ public class AwSettingsTest extends AwTestBase { |
super(awContents, contentViewClient, true); |
mIframeContainerUrl = UrlUtils.getTestFileUrl("webview/iframe_access.html"); |
mIframeUrl = UrlUtils.getTestFileUrl("webview/hello_world.html"); |
- mContentSettings.setAllowUniversalAccessFromFileURLs(false); |
+ mAwSettings.setAllowUniversalAccessFromFileURLs(false); |
// The value of the setting depends on the SDK version. |
- mContentSettings.setAllowFileAccessFromFileURLs(false); |
+ mAwSettings.setAllowFileAccessFromFileURLs(false); |
} |
@Override |
@@ -627,12 +626,12 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected Boolean getCurrentValue() { |
- return mContentSettings.getAllowFileAccessFromFileURLs(); |
+ return mAwSettings.getAllowFileAccessFromFileURLs(); |
} |
@Override |
protected void setCurrentValue(Boolean value) { |
- mContentSettings.setAllowFileAccessFromFileURLs(value); |
+ mAwSettings.setAllowFileAccessFromFileURLs(value); |
} |
@Override |
@@ -656,9 +655,9 @@ public class AwSettingsTest extends AwTestBase { |
TestAwContentsClient contentViewClient) throws Throwable { |
super(awContents, contentViewClient, true); |
mXhrContainerUrl = UrlUtils.getTestFileUrl("webview/xhr_access.html"); |
- mContentSettings.setAllowUniversalAccessFromFileURLs(false); |
+ mAwSettings.setAllowUniversalAccessFromFileURLs(false); |
// The value of the setting depends on the SDK version. |
- mContentSettings.setAllowFileAccessFromFileURLs(false); |
+ mAwSettings.setAllowFileAccessFromFileURLs(false); |
} |
@Override |
@@ -673,12 +672,12 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected Boolean getCurrentValue() { |
- return mContentSettings.getAllowFileAccessFromFileURLs(); |
+ return mAwSettings.getAllowFileAccessFromFileURLs(); |
} |
@Override |
protected void setCurrentValue(Boolean value) { |
- mContentSettings.setAllowFileAccessFromFileURLs(value); |
+ mAwSettings.setAllowFileAccessFromFileURLs(value); |
} |
@Override |
@@ -692,20 +691,7 @@ public class AwSettingsTest extends AwTestBase { |
private final String mXhrContainerUrl; |
} |
- // A helper super class for test cases that need to access AwSettings. |
- abstract class AwSettingsWithSettingsTestHelper<T> extends AwSettingsTestHelper<T> { |
- protected AwSettings mAwSettings; |
- |
- AwSettingsWithSettingsTestHelper( |
- AwContents awContents, |
- TestAwContentsClient contentViewClient, |
- boolean requiresJsEnabled) throws Throwable { |
- super(awContents, contentViewClient, requiresJsEnabled); |
- mAwSettings = AwSettingsTest.this.getAwSettingsOnUiThread(awContents); |
- } |
- } |
- |
- class AwSettingsFileUrlAccessTestHelper extends AwSettingsWithSettingsTestHelper<Boolean> { |
+ class AwSettingsFileUrlAccessTestHelper extends AwSettingsTestHelper<Boolean> { |
private static final String ACCESS_GRANTED_TITLE = "Hello, World!"; |
AwSettingsFileUrlAccessTestHelper( |
@@ -752,7 +738,7 @@ public class AwSettingsTest extends AwTestBase { |
private int mIndex; |
} |
- class AwSettingsContentUrlAccessTestHelper extends AwSettingsWithSettingsTestHelper<Boolean> { |
+ class AwSettingsContentUrlAccessTestHelper extends AwSettingsTestHelper<Boolean> { |
AwSettingsContentUrlAccessTestHelper( |
AwContents awContents, |
@@ -796,8 +782,7 @@ public class AwSettingsTest extends AwTestBase { |
private final String mTarget; |
} |
- class AwSettingsContentUrlAccessFromFileTestHelper |
- extends AwSettingsWithSettingsTestHelper<Boolean> { |
+ class AwSettingsContentUrlAccessFromFileTestHelper extends AwSettingsTestHelper<Boolean> { |
private static final String TARGET = "content_from_file"; |
AwSettingsContentUrlAccessFromFileTestHelper( |
@@ -859,8 +844,7 @@ public class AwSettingsTest extends AwTestBase { |
// This class provides helper methods for testing of settings related to |
// the text autosizing feature. |
- abstract class AwSettingsTextAutosizingTestHelper<T> |
- extends AwSettingsWithSettingsTestHelper<T> { |
+ abstract class AwSettingsTextAutosizingTestHelper<T> extends AwSettingsTestHelper<T> { |
protected static final float PARAGRAPH_FONT_SIZE = 14.0f; |
AwSettingsTextAutosizingTestHelper( |
@@ -937,7 +921,7 @@ public class AwSettingsTest extends AwTestBase { |
TestAwContentsClient contentViewClient) throws Throwable { |
super(awContents, contentViewClient); |
// Font autosizing doesn't step in for narrow layout widths. |
- mContentSettings.setUseWideViewPort(true); |
+ mAwSettings.setUseWideViewPort(true); |
} |
@Override |
@@ -952,13 +936,13 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected LayoutAlgorithm getCurrentValue() { |
- return mContentSettings.getLayoutAlgorithm(); |
+ return mAwSettings.getLayoutAlgorithm(); |
} |
@Override |
protected void setCurrentValue(LayoutAlgorithm value) throws Throwable { |
super.setCurrentValue(value); |
- mContentSettings.setLayoutAlgorithm(value); |
+ mAwSettings.setLayoutAlgorithm(value); |
} |
@Override |
@@ -997,13 +981,12 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected Integer getCurrentValue() { |
- return mContentSettings.getTextZoom(); |
+ return mAwSettings.getTextZoom(); |
} |
@Override |
protected void setCurrentValue(Integer value) throws Throwable { |
super.setCurrentValue(value); |
- mContentSettings.setTextZoom(value); |
mAwSettings.setTextZoom(value); |
} |
@@ -1031,7 +1014,7 @@ public class AwSettingsTest extends AwTestBase { |
AwContents awContents, |
TestAwContentsClient contentViewClient) throws Throwable { |
super(awContents, contentViewClient); |
- mContentSettings.setLayoutAlgorithm(LayoutAlgorithm.TEXT_AUTOSIZING); |
+ mAwSettings.setLayoutAlgorithm(LayoutAlgorithm.TEXT_AUTOSIZING); |
// The initial font size can be adjusted by font autosizer depending on the page's |
// viewport width. |
mInitialActualFontSize = getActualFontSize(); |
@@ -1049,15 +1032,13 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected Integer getCurrentValue() { |
- return mContentSettings.getTextZoom(); |
+ return mAwSettings.getTextZoom(); |
} |
@Override |
protected void setCurrentValue(Integer value) throws Throwable { |
super.setCurrentValue(value); |
- mContentSettings.setTextZoom(value); |
- // This is to verify that AwSettings will not affect font boosting by Autosizer. |
- mAwSettings.setTextZoom(-1); |
+ mAwSettings.setTextZoom(value); |
} |
@Override |
@@ -1097,12 +1078,12 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected Boolean getCurrentValue() { |
- return mContentSettings.getJavaScriptCanOpenWindowsAutomatically(); |
+ return mAwSettings.getJavaScriptCanOpenWindowsAutomatically(); |
} |
@Override |
protected void setCurrentValue(Boolean value) { |
- mContentSettings.setJavaScriptCanOpenWindowsAutomatically(value); |
+ mAwSettings.setJavaScriptCanOpenWindowsAutomatically(value); |
} |
@Override |
@@ -1140,7 +1121,7 @@ public class AwSettingsTest extends AwTestBase { |
} |
} |
- class AwSettingsCacheModeTestHelper extends AwSettingsWithSettingsTestHelper<Integer> { |
+ class AwSettingsCacheModeTestHelper extends AwSettingsTestHelper<Integer> { |
AwSettingsCacheModeTestHelper( |
AwContents awContents, |
@@ -1197,7 +1178,7 @@ public class AwSettingsTest extends AwTestBase { |
// "viewport" tag is ignored, and the layout width is set to device width in DIP pixels. |
// We specify a very high width value to make sure that it doesn't intersect with |
// device screen widths (in DIP pixels). |
- class AwSettingsUseWideViewportTestHelper extends AwSettingsWithSettingsTestHelper<Boolean> { |
+ class AwSettingsUseWideViewportTestHelper extends AwSettingsTestHelper<Boolean> { |
static private final String VIEWPORT_TAG_LAYOUT_WIDTH = "3000"; |
AwSettingsUseWideViewportTestHelper( |
@@ -1218,12 +1199,12 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected Boolean getCurrentValue() { |
- return mContentSettings.getUseWideViewPort(); |
+ return mAwSettings.getUseWideViewPort(); |
} |
@Override |
protected void setCurrentValue(Boolean value) { |
- mContentSettings.setUseWideViewPort(value); |
+ mAwSettings.setUseWideViewPort(value); |
} |
@Override |
@@ -1254,7 +1235,7 @@ public class AwSettingsTest extends AwTestBase { |
boolean withViewPortTag) throws Throwable { |
super(awContents, contentViewClient, true); |
mWithViewPortTag = withViewPortTag; |
- mContentSettings.setUseWideViewPort(true); |
+ mAwSettings.setUseWideViewPort(true); |
} |
@Override |
@@ -1269,18 +1250,17 @@ public class AwSettingsTest extends AwTestBase { |
@Override |
protected Boolean getCurrentValue() { |
- return mContentSettings.getLoadWithOverviewMode(); |
+ return mAwSettings.getLoadWithOverviewMode(); |
} |
@Override |
protected void setCurrentValue(Boolean value) { |
- mExpectScaleChange = mContentSettings.getLoadWithOverviewMode() != value; |
+ mExpectScaleChange = mAwSettings.getLoadWithOverviewMode() != value; |
if (mExpectScaleChange) { |
mOnScaleChangedCallCount = |
mContentViewClient.getOnScaleChangedHelper().getCallCount(); |
} |
- mContentSettings.setLoadWithOverviewMode(value); |
- mAwContents.getSettings().resetScrollAndScaleState(); |
+ mAwSettings.setLoadWithOverviewMode(value); |
} |
@Override |
@@ -1313,7 +1293,7 @@ public class AwSettingsTest extends AwTestBase { |
} |
// The test verifies that JavaScript is disabled upon WebView |
- // creation without accessing ContentSettings. If the test passes, |
+ // creation without accessing AwSettings. If the test passes, |
// it means that WebView-specific web preferences configuration |
// is applied on WebView creation. JS state is used, because it is |
// enabled by default in Chrome, but must be disabled by default |
@@ -1393,9 +1373,9 @@ public class AwSettingsTest extends AwTestBase { |
@SmallTest |
public void testLoadsImagesAutomaticallyWithCachedImage() throws Throwable { |
ViewPair views = createViews(); |
- ContentSettings settings0 = getContentSettingsOnUiThread(views.getContents0()); |
+ AwSettings settings0 = getAwSettingsOnUiThread(views.getContents0()); |
settings0.setJavaScriptEnabled(true); |
- ContentSettings settings1 = getContentSettingsOnUiThread(views.getContents1()); |
+ AwSettings settings1 = getAwSettingsOnUiThread(views.getContents1()); |
settings1.setJavaScriptEnabled(true); |
ImagePageGenerator generator = new ImagePageGenerator(0, false); |
@@ -1466,7 +1446,7 @@ public class AwSettingsTest extends AwTestBase { |
final AwTestContainerView testContainerView = |
createAwTestContainerViewOnMainSync(contentClient); |
final AwContents awContents = testContainerView.getAwContents(); |
- ContentSettings settings = getContentSettingsOnUiThread(awContents); |
+ AwSettings settings = getAwSettingsOnUiThread(awContents); |
settings.setJavaScriptEnabled(true); |
ImagePageGenerator generator = new ImagePageGenerator(0, false); |
settings.setLoadsImagesAutomatically(false); |
@@ -1526,7 +1506,7 @@ public class AwSettingsTest extends AwTestBase { |
final AwTestContainerView testContainerView = |
createAwTestContainerViewOnMainSync(contentClient); |
final AwContents awContents = testContainerView.getAwContents(); |
- ContentSettings settings = getContentSettingsOnUiThread(awContents); |
+ AwSettings settings = getAwSettingsOnUiThread(awContents); |
final String actualUserAgentString = settings.getUserAgentString(); |
final String patternString = |
"Mozilla/5\\.0 \\(Linux;( U;)? Android ([^;]+);( (\\w+)-(\\w+);)?" + |
@@ -1555,7 +1535,7 @@ public class AwSettingsTest extends AwTestBase { |
final AwTestContainerView testContainerView = |
createAwTestContainerViewOnMainSync(contentClient); |
final AwContents awContents = testContainerView.getAwContents(); |
- ContentSettings settings = getContentSettingsOnUiThread(awContents); |
+ AwSettings settings = getAwSettingsOnUiThread(awContents); |
final String defaultUserAgentString = settings.getUserAgentString(); |
// Check that an attempt to reset the default UA string has no effect. |
@@ -1569,7 +1549,7 @@ public class AwSettingsTest extends AwTestBase { |
assertEquals(defaultUserAgentString, settings.getUserAgentString()); |
// Set a custom UA string, verify that it can be reset back to default. |
- final String customUserAgentString = "ContentSettingsTest"; |
+ final String customUserAgentString = "AwSettingsTest"; |
settings.setUserAgentString(customUserAgentString); |
assertEquals(customUserAgentString, settings.getUserAgentString()); |
settings.setUserAgentString(null); |
@@ -1587,10 +1567,10 @@ public class AwSettingsTest extends AwTestBase { |
final AwContents awContents = testContainerView.getAwContents(); |
final ContentViewCore contentView = testContainerView.getContentViewCore(); |
CallbackHelper onPageFinishedHelper = contentClient.getOnPageFinishedHelper(); |
- ContentSettings settings = getContentSettingsOnUiThread(awContents); |
+ AwSettings settings = getAwSettingsOnUiThread(awContents); |
settings.setJavaScriptEnabled(true); |
final String defaultUserAgentString = settings.getUserAgentString(); |
- final String customUserAgentString = "ContentSettingsTest"; |
+ final String customUserAgentString = "AwSettingsTest"; |
// We are using different page titles to make sure that we are really |
// going back and forward between them. |
final String pageTemplate = |
@@ -1634,7 +1614,7 @@ public class AwSettingsTest extends AwTestBase { |
final AwTestContainerView testContainerView = |
createAwTestContainerViewOnMainSync(contentClient); |
AwContents awContents = testContainerView.getAwContents(); |
- ContentSettings settings = getContentSettingsOnUiThread(awContents); |
+ AwSettings settings = getAwSettingsOnUiThread(awContents); |
final String customUserAgentString = |
"testUserAgentWithTestServerUserAgent"; |
@@ -1731,7 +1711,7 @@ public class AwSettingsTest extends AwTestBase { |
final AwTestContainerView testContainerView = |
createAwTestContainerViewOnMainSync(contentClient); |
final AwContents awContents = testContainerView.getAwContents(); |
- ContentSettings settings = getContentSettingsOnUiThread(awContents); |
+ AwSettings settings = getAwSettingsOnUiThread(awContents); |
settings.setJavaScriptEnabled(true); |
settings.setAllowUniversalAccessFromFileURLs(false); |
settings.setAllowFileAccessFromFileURLs(false); |
@@ -1819,7 +1799,7 @@ public class AwSettingsTest extends AwTestBase { |
final AwTestContainerView testContainerView = |
createAwTestContainerViewOnMainSync(contentClient); |
final AwContents awContents = testContainerView.getAwContents(); |
- final ContentSettings settings = getContentSettingsOnUiThread(awContents); |
+ final AwSettings settings = getAwSettingsOnUiThread(awContents); |
ImagePageGenerator generator = new ImagePageGenerator(0, false); |
settings.setJavaScriptEnabled(true); |
@@ -1839,7 +1819,7 @@ public class AwSettingsTest extends AwTestBase { |
final AwTestContainerView testContainerView = |
createAwTestContainerViewOnMainSync(contentClient); |
final AwContents awContents = testContainerView.getAwContents(); |
- final ContentSettings settings = getContentSettingsOnUiThread(awContents); |
+ final AwSettings settings = getAwSettingsOnUiThread(awContents); |
settings.setJavaScriptEnabled(true); |
ImagePageGenerator generator = new ImagePageGenerator(0, false); |
@@ -1885,9 +1865,8 @@ public class AwSettingsTest extends AwTestBase { |
final AwTestContainerView testContainer = |
createAwTestContainerViewOnMainSync(contentClient); |
final AwContents awContents = testContainer.getAwContents(); |
- final ContentSettings contentSettings = getContentSettingsOnUiThread(awContents); |
- final AwSettings awSettings = getAwSettingsOnUiThread(testContainer.getAwContents()); |
- contentSettings.setJavaScriptEnabled(true); |
+ final AwSettings awSettings = getAwSettingsOnUiThread(awContents); |
+ awSettings.setJavaScriptEnabled(true); |
ImagePageGenerator generator = new ImagePageGenerator(0, false); |
TestWebServer webServer = null; |
@@ -2213,7 +2192,7 @@ public class AwSettingsTest extends AwTestBase { |
final AwTestContainerView testContainer = |
createAwTestContainerViewOnMainSync(contentClient); |
final AwContents awContents = testContainer.getAwContents(); |
- final ContentSettings settings = getContentSettingsOnUiThread(awContents); |
+ final AwSettings settings = getAwSettingsOnUiThread(awContents); |
settings.setJavaScriptEnabled(true); |
// Note that the cache isn't actually enabled until the call to setAppCachePath. |
settings.setAppCacheEnabled(true); |
@@ -2255,11 +2234,11 @@ public class AwSettingsTest extends AwTestBase { |
// will take about 20 seconds. |
ViewPair views = createViews(); |
- ContentSettings settings0 = getContentSettingsOnUiThread(views.getContents0()); |
+ AwSettings settings0 = getAwSettingsOnUiThread(views.getContents0()); |
settings0.setJavaScriptEnabled(true); |
settings0.setAppCachePath("whatever"); |
settings0.setAppCacheEnabled(true); |
- ContentSettings settings1 = getContentSettingsOnUiThread(views.getContents1()); |
+ AwSettings settings1 = getAwSettingsOnUiThread(views.getContents1()); |
settings1.setJavaScriptEnabled(true); |
// AppCachePath setting is global, no need to set it for the second view. |
settings1.setAppCacheEnabled(true); |
@@ -2321,7 +2300,7 @@ public class AwSettingsTest extends AwTestBase { |
final AwTestContainerView testContainerView = |
createAwTestContainerViewOnMainSync(contentClient); |
final AwContents awContents = testContainerView.getAwContents(); |
- ContentSettings settings = getContentSettingsOnUiThread(awContents); |
+ AwSettings settings = getAwSettingsOnUiThread(awContents); |
CallbackHelper onPageFinishedHelper = contentClient.getOnPageFinishedHelper(); |
final String pageTemplate = "<html><head>%s</head>" + |
@@ -2382,7 +2361,7 @@ public class AwSettingsTest extends AwTestBase { |
final AwTestContainerView testContainerView = |
createAwTestContainerViewOnMainSync(contentClient); |
final AwContents awContents = testContainerView.getAwContents(); |
- ContentSettings settings = getContentSettingsOnUiThread(awContents); |
+ AwSettings settings = getAwSettingsOnUiThread(awContents); |
CallbackHelper onPageFinishedHelper = contentClient.getOnPageFinishedHelper(); |
final String page = "<html><body>Page Text</body></html>"; |
@@ -2483,10 +2462,9 @@ public class AwSettingsTest extends AwTestBase { |
getInstrumentation().runOnMainSync(new Runnable() { |
@Override |
public void run() { |
- ContentSettings contentSettings = |
- awContents.getContentViewCore().getContentSettings(); |
- contentSettings.setJavaScriptEnabled(true); |
- contentSettings.setMediaPlaybackRequiresUserGesture(requiredUserGesture); |
+ AwSettings awSettings = awContents.getSettings(); |
+ awSettings.setJavaScriptEnabled(true); |
+ awSettings.setMediaPlaybackRequiresUserGesture(requiredUserGesture); |
observer.register(awContents.getContentViewCore(), "javaObserver"); |
} |
}); |
@@ -2546,9 +2524,8 @@ public class AwSettingsTest extends AwTestBase { |
getInstrumentation().runOnMainSync(new Runnable() { |
@Override |
public void run() { |
- ContentSettings contentSettings = |
- awContents.getContentViewCore().getContentSettings(); |
- contentSettings.setDefaultVideoPosterURL(DEFAULT_VIDEO_POSTER_URL); |
+ AwSettings awSettings = awContents.getSettings(); |
+ awSettings.setDefaultVideoPosterURL(DEFAULT_VIDEO_POSTER_URL); |
} |
}); |
VideoTestWebServer webServer = new VideoTestWebServer( |