diff options
| -rw-r--r-- | tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestController.java | 4 | ||||
| -rw-r--r-- | tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestController.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestController.java index ec8409a..e608e2d 100644 --- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestController.java +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestController.java @@ -106,6 +106,10 @@ public class LayoutTestController { MockGeolocation.getInstance().setPosition(latitude, longitude, accuracy); } + public void setXSSAuditorEnabled(boolean flag) { + mLayoutTestsExecutor.setXSSAuditorEnabled(flag); + } + public void waitUntilDone() { mLayoutTestsExecutor.waitUntilDone(); } diff --git a/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java b/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java index 4c7124b..9a82f84 100644 --- a/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java +++ b/tests/DumpRenderTree2/src/com/android/dumprendertree2/LayoutTestsExecutor.java @@ -508,6 +508,7 @@ public class LayoutTestsExecutor extends Activity { private static final int MSG_DUMP_DATABASE_CALLBACKS = 5; private static final int MSG_SET_GEOLOCATION_PERMISSION = 6; private static final int MSG_OVERRIDE_PREFERENCE = 7; + private static final int MSG_SET_XSS_AUDITOR_ENABLED = 8; /** String constants for use with layoutTestController.overridePreference() */ private final String WEBKIT_OFFLINE_WEB_APPLICATION_CACHE_ENABLED = @@ -585,6 +586,10 @@ public class LayoutTestsExecutor extends Activity { } break; + case MSG_SET_XSS_AUDITOR_ENABLED: + mCurrentWebView.getSettings().setXSSAuditorEnabled(msg.arg1 == 1); + break; + case MSG_WAIT_UNTIL_DONE: mCurrentState = CurrentState.WAITING_FOR_ASYNCHRONOUS_TEST; break; @@ -658,6 +663,13 @@ public class LayoutTestsExecutor extends Activity { canProvideGamma, gamma); } + public void setXSSAuditorEnabled(boolean flag) { + Log.i(LOG_TAG, mCurrentTestRelativePath + ": setXSSAuditorEnabled(" + flag + ") called"); + Message msg = mLayoutTestControllerHandler.obtainMessage(MSG_SET_XSS_AUDITOR_ENABLED); + msg.arg1 = flag ? 1 : 0; + msg.sendToTarget(); + } + public void waitUntilDone() { Log.i(LOG_TAG, mCurrentTestRelativePath + ": waitUntilDone() called"); mLayoutTestControllerHandler.sendEmptyMessage(MSG_WAIT_UNTIL_DONE); |
