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

Unified Diff: content/shell/webkit_test_runner_bindings.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.js ('k') | content/shell/webkit_test_runner_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/webkit_test_runner_bindings.cc
diff --git a/content/shell/webkit_test_runner_bindings.cc b/content/shell/webkit_test_runner_bindings.cc
index e658f18058e6f45849f9eb3fab4fe338cb9c5f3e..4e4f597b945fe92be973e77a0689967b329ef39f 100644
--- a/content/shell/webkit_test_runner_bindings.cc
+++ b/content/shell/webkit_test_runner_bindings.cc
@@ -112,6 +112,23 @@ v8::Handle<v8::Value> SetWaitUntilDone(const v8::Arguments& args) {
return v8::Undefined();
}
+v8::Handle<v8::Value> SetXSSAuditorEnabled(
+ const v8::Arguments& args) {
+ RenderView* view = GetCurrentRenderView();
+ if (!view)
+ return v8::Undefined();
+
+ if (args.Length() != 1 || !args[0]->IsBoolean())
+ return v8::Undefined();
+
+ WebKitTestRunner* runner = WebKitTestRunner::Get(view);
+ if (!runner)
+ return v8::Undefined();
+
+ runner->SetXSSAuditorEnabled(args[0]->BooleanValue());
+ return v8::Undefined();
+}
+
v8::Handle<v8::Value> GetWorkerThreadCount(const v8::Arguments& args) {
RenderView* view = GetCurrentRenderView();
if (!view)
@@ -169,6 +186,8 @@ WebKitTestRunnerBindings::GetNativeFunction(v8::Handle<v8::String> name) {
}
if (name->Equals(v8::String::New("SetWaitUntilDone")))
return v8::FunctionTemplate::New(SetWaitUntilDone);
+ if (name->Equals(v8::String::New("SetXSSAuditorEnabled")))
+ return v8::FunctionTemplate::New(SetXSSAuditorEnabled);
if (name->Equals(v8::String::New("GetWorkerThreadCount")))
return v8::FunctionTemplate::New(GetWorkerThreadCount);
if (name->Equals(v8::String::New("NotImplemented")))
« no previous file with comments | « content/shell/webkit_test_runner.js ('k') | content/shell/webkit_test_runner_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698