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

Unified Diff: components/test_runner/mock_content_settings_client.cc

Issue 1926773002: TestRunner: add method to instrument autoplay settings and set default value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@autoplay-htmlmedialement
Patch Set: fix tests Created 4 years, 8 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 | « components/test_runner/mock_content_settings_client.h ('k') | components/test_runner/test_runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test_runner/mock_content_settings_client.cc
diff --git a/components/test_runner/mock_content_settings_client.cc b/components/test_runner/mock_content_settings_client.cc
index 6bcee665f4b851484e0866d617cc035cc1c61619..4aa8c004314369c97fbb3bb83afc25a86a9ba37a 100644
--- a/components/test_runner/mock_content_settings_client.cc
+++ b/components/test_runner/mock_content_settings_client.cc
@@ -21,9 +21,10 @@ bool MockContentSettingsClient::allowImage(bool enabled_per_settings,
const blink::WebURL& image_url) {
bool allowed = enabled_per_settings && flags_->images_allowed();
if (flags_->dump_web_content_settings_client_callbacks() && delegate_) {
- delegate_->PrintMessage(std::string("PERMISSION CLIENT: allowImage(") +
- NormalizeLayoutTestURL(image_url.string().utf8()) +
- "): " + (allowed ? "true" : "false") + "\n");
+ delegate_->PrintMessage(
+ std::string("MockContentSettingsClient: allowImage(") +
+ NormalizeLayoutTestURL(image_url.string().utf8()) +
+ "): " + (allowed ? "true" : "false") + "\n");
}
return allowed;
}
@@ -31,9 +32,10 @@ bool MockContentSettingsClient::allowImage(bool enabled_per_settings,
bool MockContentSettingsClient::allowMedia(const blink::WebURL& image_url) {
bool allowed = flags_->media_allowed();
if (flags_->dump_web_content_settings_client_callbacks() && delegate_)
- delegate_->PrintMessage(std::string("PERMISSION CLIENT: allowMedia(") +
- NormalizeLayoutTestURL(image_url.string().utf8()) +
- "): " + (allowed ? "true" : "false") + "\n");
+ delegate_->PrintMessage(
+ std::string("MockContentSettingsClient: allowMedia(") +
+ NormalizeLayoutTestURL(image_url.string().utf8()) +
+ "): " + (allowed ? "true" : "false") + "\n");
return allowed;
}
@@ -43,7 +45,7 @@ bool MockContentSettingsClient::allowScriptFromSource(
bool allowed = enabled_per_settings && flags_->scripts_allowed();
if (flags_->dump_web_content_settings_client_callbacks() && delegate_) {
delegate_->PrintMessage(
- std::string("PERMISSION CLIENT: allowScriptFromSource(") +
+ std::string("MockContentSettingsClient: allowScriptFromSource(") +
NormalizeLayoutTestURL(scriptURL.string().utf8()) + "): " +
(allowed ? "true" : "false") + "\n");
}
@@ -71,6 +73,10 @@ bool MockContentSettingsClient::allowRunningInsecureContent(
return enabled_per_settings || flags_->running_insecure_content_allowed();
}
+bool MockContentSettingsClient::allowAutoplay(bool defaultValue) {
+ return defaultValue || flags_->autoplay_allowed();
+}
+
void MockContentSettingsClient::SetDelegate(WebTestDelegate* delegate) {
delegate_ = delegate;
}
« no previous file with comments | « components/test_runner/mock_content_settings_client.h ('k') | components/test_runner/test_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698