Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2265)

Unified Diff: content/shell/webkit_test_runner.cc

Issue 11316244: [content shell] add support for a testRunner.setXSSAuditorEnabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/shell/webkit_test_runner.cc
diff --git a/content/shell/webkit_test_runner.cc b/content/shell/webkit_test_runner.cc
index 122282af219d6f9bfba1cdfe00c1c631128a88bd..bf7d9d97d7bd52914d37af3ecce1e857e2fdf975 100644
--- a/content/shell/webkit_test_runner.cc
+++ b/content/shell/webkit_test_runner.cc
@@ -32,6 +32,7 @@
#include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/WebTask.h"
#include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h"
#include "webkit/glue/webkit_glue.h"
+#include "webkit/glue/webpreferences.h"
using WebKit::WebContextMenuData;
using WebKit::WebElement;
@@ -272,6 +273,18 @@ void WebKitTestRunner::Display() {
DisplayRepaintMask();
}
+void WebKitTestRunner::SetXSSAuditorEnabled(bool enabled) {
+ webkit_glue::WebPreferences prefs = render_view()->GetWebkitPreferences();
+ prefs.xss_auditor_enabled = enabled;
+ render_view()->OverrideWebkitPreferences(prefs);
+}
+
+void WebKitTestRunner::Reset() {
+ webkit_glue::WebPreferences prefs = render_view()->GetWebkitPreferences();
+ prefs.xss_auditor_enabled = true;
+ render_view()->OverrideWebkitPreferences(prefs);
+}
+
// Private methods -----------------------------------------------------------
void WebKitTestRunner::OnCaptureTextDump(bool as_text,

Powered by Google App Engine
This is Rietveld 408576698