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

Unified Diff: components/test_runner/test_runner.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
Index: components/test_runner/test_runner.cc
diff --git a/components/test_runner/test_runner.cc b/components/test_runner/test_runner.cc
index 2d0597ab35ef5f5941235f9e3da67d9e2a826413..429bf34a2cfd122d66c0e568c6c060effdad5bfa 100644
--- a/components/test_runner/test_runner.cc
+++ b/components/test_runner/test_runner.cc
@@ -200,6 +200,7 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> {
void SetAllowDisplayOfInsecureContent(bool allowed);
void SetAllowFileAccessFromFileURLs(bool allow);
void SetAllowRunningOfInsecureContent(bool allowed);
+ void SetAutoplayAllowed(bool allowed);
void SetAllowUniversalAccessFromFileURLs(bool allow);
void SetAlwaysAcceptCookies(bool accept);
void SetAudioData(const gin::ArrayBufferView& view);
@@ -499,6 +500,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
&TestRunnerBindings::SetAllowFileAccessFromFileURLs)
.SetMethod("setAllowRunningOfInsecureContent",
&TestRunnerBindings::SetAllowRunningOfInsecureContent)
+ .SetMethod("setAutoplayAllowed",
+ &TestRunnerBindings::SetAutoplayAllowed)
.SetMethod("setAllowUniversalAccessFromFileURLs",
&TestRunnerBindings::SetAllowUniversalAccessFromFileURLs)
.SetMethod("setAlwaysAcceptCookies",
@@ -1143,6 +1146,11 @@ void TestRunnerBindings::SetAllowRunningOfInsecureContent(bool allowed) {
runner_->SetAllowRunningOfInsecureContent(allowed);
}
+void TestRunnerBindings::SetAutoplayAllowed(bool allowed) {
+ if (runner_)
+ runner_->SetAutoplayAllowed(allowed);
+}
+
void TestRunnerBindings::DumpPermissionClientCallbacks() {
if (runner_)
runner_->DumpPermissionClientCallbacks();
@@ -2811,6 +2819,11 @@ void TestRunner::SetAllowRunningOfInsecureContent(bool allowed) {
OnLayoutTestRuntimeFlagsChanged();
}
+void TestRunner::SetAutoplayAllowed(bool allowed) {
+ layout_test_runtime_flags_.set_autoplay_allowed(allowed);
+ OnLayoutTestRuntimeFlagsChanged();
+}
+
void TestRunner::DumpPermissionClientCallbacks() {
layout_test_runtime_flags_.set_dump_web_content_settings_client_callbacks(
true);

Powered by Google App Engine
This is Rietveld 408576698