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

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: updates 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
« no previous file with comments | « content/shell/webkit_test_runner.h ('k') | content/shell/webkit_test_runner.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..8fadf627c9459c4bb2ca371fc0b6a8aa05f89a44 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,21 @@ void WebKitTestRunner::Display() {
DisplayRepaintMask();
}
+void WebKitTestRunner::SetXSSAuditorEnabled(bool enabled) {
+ prefs_.xss_auditor_enabled = enabled;
+ webkit_glue::WebPreferences prefs = render_view()->GetWebkitPreferences();
+ prefs_.Apply(&prefs);
+ render_view()->SetWebkitPreferences(prefs);
+ Send(new ShellViewHostMsg_OverridePreferences(routing_id(), prefs_));
+}
+
+void WebKitTestRunner::Reset() {
+ prefs_ = ShellWebPreferences();
+ webkit_glue::WebPreferences prefs = render_view()->GetWebkitPreferences();
+ prefs_.Apply(&prefs);
+ render_view()->SetWebkitPreferences(prefs);
+}
+
// Private methods -----------------------------------------------------------
void WebKitTestRunner::OnCaptureTextDump(bool as_text,
« no previous file with comments | « content/shell/webkit_test_runner.h ('k') | content/shell/webkit_test_runner.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698