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

Unified Diff: content/shell/renderer/test_runner/WebPermissions.cpp

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
Index: content/shell/renderer/test_runner/WebPermissions.cpp
diff --git a/content/shell/renderer/test_runner/WebPermissions.cpp b/content/shell/renderer/test_runner/WebPermissions.cpp
index b2cfd74978a6ce1b9b6b1276616ec86759211c4d..3e32aa2ac169c3667ef7101ae6adfcb4dd167f4e 100644
--- a/content/shell/renderer/test_runner/WebPermissions.cpp
+++ b/content/shell/renderer/test_runner/WebPermissions.cpp
@@ -31,6 +31,14 @@ bool WebPermissions::allowImage(bool enabledPerSettings, const blink::WebURL& im
return allowed;
}
+bool WebPermissions::allowMedia(const blink::WebURL& imageURL)
+{
+ bool allowed = m_mediaAllowed;
+ if (m_dumpCallbacks && m_delegate)
+ m_delegate->printMessage(std::string("PERMISSION CLIENT: allowMedia(") + normalizeLayoutTestURL(imageURL.spec()) + "): " + (allowed ? "true" : "false") + "\n");
+ return allowed;
+}
+
bool WebPermissions::allowScriptFromSource(bool enabledPerSettings, const blink::WebURL& scriptURL)
{
bool allowed = enabledPerSettings && m_scriptsAllowed;
@@ -64,6 +72,11 @@ void WebPermissions::setImagesAllowed(bool imagesAllowed)
m_imagesAllowed = imagesAllowed;
}
+void WebPermissions::setMediaAllowed(bool mediaAllowed)
+{
+ m_mediaAllowed = mediaAllowed;
+}
+
void WebPermissions::setScriptsAllowed(bool scriptsAllowed)
{
m_scriptsAllowed = scriptsAllowed;
@@ -103,6 +116,7 @@ void WebPermissions::reset()
{
m_dumpCallbacks = false;
m_imagesAllowed = true;
+ m_mediaAllowed = true;
m_scriptsAllowed = true;
m_storageAllowed = true;
m_pluginsAllowed = true;
« no previous file with comments | « content/shell/renderer/test_runner/WebPermissions.h ('k') | content/shell/renderer/test_runner/test_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698