diff options
author | Steve Block <steveblock@google.com> | 2010-10-13 18:44:31 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-10-14 12:43:44 +0100 |
commit | 5f37cc4308438bcac45d06d07d77a56911620046 (patch) | |
tree | 91b6e7a8c1ea931feebc3058fbd566543daa006e /tests/DumpRenderTree2 | |
parent | ff4031bcb5c387900acf63b46211ba00fa52d417 (diff) | |
download | frameworks_base-5f37cc4308438bcac45d06d07d77a56911620046.zip frameworks_base-5f37cc4308438bcac45d06d07d77a56911620046.tar.gz frameworks_base-5f37cc4308438bcac45d06d07d77a56911620046.tar.bz2 |
Implement LayoutTestController.overridePreference('WebKitUsesPageCachePreferenceKey')
This is required for tests that test PageCache behaviour, eg
- fast/dom/DeviceMotion/no-page-cache.html
- fast/dom/DeviceOrientation/no-page-cache.html
- fast/dom/Geolocation/no-page-cache.html
Change-Id: Ie5862f6c86718142c949be81a85358ca6fac628a
Diffstat (limited to 'tests/DumpRenderTree2')
-rw-r--r-- | tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java index 97d7cca..af8f6ea 100644 --- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java @@ -394,6 +394,7 @@ public class LayoutTestsExecutor extends Activity { webViewSettings.setDomStorageEnabled(true); webViewSettings.setWorkersEnabled(false); webViewSettings.setXSSAuditorEnabled(false); + webViewSettings.setPageCacheCapacity(0); // This is asynchronous, but it gets processed by WebCore before it starts loading pages. mCurrentWebView.useMockDeviceOrientation(); @@ -565,6 +566,7 @@ public class LayoutTestsExecutor extends Activity { /** String constants for use with layoutTestController.overridePreference() */ private final String WEBKIT_OFFLINE_WEB_APPLICATION_CACHE_ENABLED = "WebKitOfflineWebApplicationCacheEnabled"; + private final String WEBKIT_USES_PAGE_CACHE_PREFERENCE_KEY = "WebKitUsesPageCachePreferenceKey"; Handler mLayoutTestControllerHandler = new Handler() { @Override @@ -609,12 +611,16 @@ public class LayoutTestsExecutor extends Activity { * WebView for the main frame. EventSender suffers from the same * problem. */ - if (msg.getData().getString("key").equals( - WEBKIT_OFFLINE_WEB_APPLICATION_CACHE_ENABLED)) { - mCurrentWebView.getSettings().setAppCacheEnabled(msg.getData().getBoolean( - "value")); + String key = msg.getData().getString("key"); + boolean value = msg.getData().getBoolean("value"); + if (WEBKIT_OFFLINE_WEB_APPLICATION_CACHE_ENABLED.equals(key)) { + mCurrentWebView.getSettings().setAppCacheEnabled(value); + } else if (WEBKIT_USES_PAGE_CACHE_PREFERENCE_KEY.equals(key)) { + // Cache the maximum possible number of pages. + mCurrentWebView.getSettings().setPageCacheCapacity(Integer.MAX_VALUE); } else { - Log.w(LOG_TAG, "MSG_OVERRIDE_PREFERENCE: unsupported preference!"); + Log.w(LOG_TAG, "LayoutTestController.overridePreference(): " + + "Unsupported preference '" + key + "'"); } break; |