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

Unified Diff: content/shell/renderer/test_runner/test_runner.cc

Issue 312103004: Content Shell test_runner hooks for <audio> and <video> blocking. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 months 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/renderer/test_runner/test_runner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/test_runner/test_runner.cc
diff --git a/content/shell/renderer/test_runner/test_runner.cc b/content/shell/renderer/test_runner/test_runner.cc
index c4c81a913c5dc29890b38067e5c2ca03a9c3712f..92ee2dcf3b7b8ad5f945532f2daf7eeaaaeb3676 100644
--- a/content/shell/renderer/test_runner/test_runner.cc
+++ b/content/shell/renderer/test_runner/test_runner.cc
@@ -211,6 +211,7 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> {
void DumpResourceRequestCallbacks();
void DumpResourceResponseMIMETypes();
void SetImagesAllowed(bool allowed);
+ void SetMediaAllowed(bool allowed);
void SetScriptsAllowed(bool allowed);
void SetStorageAllowed(bool allowed);
void SetPluginsAllowed(bool allowed);
@@ -429,6 +430,7 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
.SetMethod("dumpResourceResponseMIMETypes",
&TestRunnerBindings::DumpResourceResponseMIMETypes)
.SetMethod("setImagesAllowed", &TestRunnerBindings::SetImagesAllowed)
+ .SetMethod("setMediaAllowed", &TestRunnerBindings::SetMediaAllowed)
.SetMethod("setScriptsAllowed", &TestRunnerBindings::SetScriptsAllowed)
.SetMethod("setStorageAllowed", &TestRunnerBindings::SetStorageAllowed)
.SetMethod("setPluginsAllowed", &TestRunnerBindings::SetPluginsAllowed)
@@ -1063,6 +1065,11 @@ void TestRunnerBindings::SetImagesAllowed(bool allowed) {
runner_->SetImagesAllowed(allowed);
}
+void TestRunnerBindings::SetMediaAllowed(bool allowed) {
+ if (runner_)
+ runner_->SetMediaAllowed(allowed);
+}
+
void TestRunnerBindings::SetScriptsAllowed(bool allowed) {
if (runner_)
runner_->SetScriptsAllowed(allowed);
@@ -2499,6 +2506,10 @@ void TestRunner::SetImagesAllowed(bool allowed) {
web_permissions_->setImagesAllowed(allowed);
}
+void TestRunner::SetMediaAllowed(bool allowed) {
+ web_permissions_->setMediaAllowed(allowed);
+}
+
void TestRunner::SetScriptsAllowed(bool allowed) {
web_permissions_->setScriptsAllowed(allowed);
}
« no previous file with comments | « content/shell/renderer/test_runner/test_runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698