diff options
author | Steve Block <steveblock@google.com> | 2010-03-19 18:48:35 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-03-22 10:52:56 +0000 |
commit | fb0de34a47a435b57075d7a72cbc40a2daf5ee6c (patch) | |
tree | 6915d0323919bdc157d94ed696b358b7a984ae65 /tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java | |
parent | cd90b15cb8cd3347c58dc0fe3a30ea3e1b17ab6e (diff) |
Implements layoutTestController.overridePreference()
This change provides the infrastructure for
layoutTestController.overridePreference(). Currently, we only provide an
implementation for the preference 'WebKitOfflineWebApplicationCacheEnabled',
which is required by the layout test http/tests/appcache/disabled.html.
Change-Id: I8552f2f4e23b982db2d067ffa20c052e56d8fb7f
Diffstat (limited to 'tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java')
-rw-r--r-- | tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java b/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java index 02a7046313db..24f58b228486 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java @@ -61,6 +61,9 @@ public class TestShellActivity extends Activity implements LayoutTestController static enum DumpDataType {DUMP_AS_TEXT, EXT_REPR, NO_OP} + // String constants for use with layoutTestController.overridePreferences + private final String WEBKIT_OFFLINE_WEB_APPLICATION_CACHE_ENABLED = "WebKitOfflineWebApplicationCacheEnabled"; + public class AsyncHandler extends Handler { @Override public void handleMessage(Message msg) { @@ -459,6 +462,16 @@ public class TestShellActivity extends Activity implements LayoutTestController mGeolocationPermission = allow; } + public void overridePreference(String key, boolean value) { + // TODO: We should look up the correct WebView for the frame which + // called the layoutTestController method. Currently, we just use the + // WebView for the main frame. EventSender suffers from the same + // problem. + if (key.equals(WEBKIT_OFFLINE_WEB_APPLICATION_CACHE_ENABLED)) { + mWebView.getSettings().setAppCacheEnabled(value); + } + } + private final WebViewClient mViewClient = new WebViewClient(){ @Override public void onPageFinished(WebView view, String url) { |