diff options
author | Elliott Slaughter <eds@google.com> | 2010-06-22 11:31:54 -0700 |
---|---|---|
committer | Elliott Slaughter <eds@google.com> | 2010-06-22 14:56:54 -0700 |
commit | 5dc0c8253b368239a90d7176ff6325ae5ba371b3 (patch) | |
tree | 8c3c7469c9d47bb2985033d2f664f9387b5e1788 /tests/DumpRenderTree | |
parent | 75d41c96a74eb344d17c72136fe20ff66833c591 (diff) | |
download | frameworks_base-5dc0c8253b368239a90d7176ff6325ae5ba371b3.zip frameworks_base-5dc0c8253b368239a90d7176ff6325ae5ba371b3.tar.gz frameworks_base-5dc0c8253b368239a90d7176ff6325ae5ba371b3.tar.bz2 |
Add setXSSAuditorEnabled support in WebSettings.
Change-Id: I6f74589b28960b91093acf8219a55e98f93b1881
Diffstat (limited to 'tests/DumpRenderTree')
3 files changed, 17 insertions, 0 deletions
diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/CallbackProxy.java b/tests/DumpRenderTree/src/com/android/dumprendertree/CallbackProxy.java index f0c1054..742b1a0 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/CallbackProxy.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/CallbackProxy.java @@ -75,6 +75,7 @@ public class CallbackProxy extends Handler implements EventSender, LayoutTestCon private static final int SET_GEOLOCATION_PERMISSION = 43; private static final int OVERRIDE_PREFERENCE = 44; private static final int LAYOUT_DUMP_CHILD_FRAMES_TEXT = 45; + private static final int SET_XSS_AUDITOR_ENABLED = 46; CallbackProxy(EventSender eventSender, LayoutTestController layoutTestController) { @@ -278,6 +279,11 @@ public class CallbackProxy extends Handler implements EventSender, LayoutTestCon boolean value = msg.getData().getBoolean("value"); mLayoutTestController.overridePreference(key, value); break; + + case SET_XSS_AUDITOR_ENABLED: + mLayoutTestController.setXSSAuditorEnabled( + msg.arg1 == 1 ? true : false); + break; } } @@ -507,4 +513,8 @@ public class CallbackProxy extends Handler implements EventSender, LayoutTestCon message.getData().putBoolean("value", value); message.sendToTarget(); } + + public void setXSSAuditorEnabled(boolean flag) { + obtainMessage(SET_XSS_AUDITOR_ENABLED, flag ? 1 : 0, 0).sendToTarget(); + } } diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestController.java b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestController.java index 57ae487..83460bd 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestController.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestController.java @@ -68,4 +68,7 @@ public interface LayoutTestController { public void setGeolocationPermission(boolean allow); public void overridePreference(String key, boolean value); + + // For XSSAuditor tests + public void setXSSAuditorEnabled(boolean flag); } diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java b/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java index d805b8a..44f8640 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java @@ -497,6 +497,10 @@ public class TestShellActivity extends Activity implements LayoutTestController } } + public void setXSSAuditorEnabled (boolean flag) { + mWebView.getSettings().setXSSAuditorEnabled(flag); + } + private final WebViewClient mViewClient = new WebViewClient(){ @Override public void onPageFinished(WebView view, String url) { |