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

Side by Side 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, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/test_runner/test_runner.h" 5 #include "components/test_runner/test_runner.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 void ResetTestHelperControllers(); 193 void ResetTestHelperControllers();
194 void ResolveBeforeInstallPromptPromise(int request_id, 194 void ResolveBeforeInstallPromptPromise(int request_id,
195 const std::string& platform); 195 const std::string& platform);
196 void RunIdleTasks(v8::Local<v8::Function> callback); 196 void RunIdleTasks(v8::Local<v8::Function> callback);
197 void SendBluetoothManualChooserEvent(const std::string& event, 197 void SendBluetoothManualChooserEvent(const std::string& event,
198 const std::string& argument); 198 const std::string& argument);
199 void SetAcceptLanguages(const std::string& accept_languages); 199 void SetAcceptLanguages(const std::string& accept_languages);
200 void SetAllowDisplayOfInsecureContent(bool allowed); 200 void SetAllowDisplayOfInsecureContent(bool allowed);
201 void SetAllowFileAccessFromFileURLs(bool allow); 201 void SetAllowFileAccessFromFileURLs(bool allow);
202 void SetAllowRunningOfInsecureContent(bool allowed); 202 void SetAllowRunningOfInsecureContent(bool allowed);
203 void SetAutoplayAllowed(bool allowed);
203 void SetAllowUniversalAccessFromFileURLs(bool allow); 204 void SetAllowUniversalAccessFromFileURLs(bool allow);
204 void SetAlwaysAcceptCookies(bool accept); 205 void SetAlwaysAcceptCookies(bool accept);
205 void SetAudioData(const gin::ArrayBufferView& view); 206 void SetAudioData(const gin::ArrayBufferView& view);
206 void SetBackingScaleFactor(double value, v8::Local<v8::Function> callback); 207 void SetBackingScaleFactor(double value, v8::Local<v8::Function> callback);
207 void SetBluetoothFakeAdapter(const std::string& adapter_name, 208 void SetBluetoothFakeAdapter(const std::string& adapter_name,
208 v8::Local<v8::Function> callback); 209 v8::Local<v8::Function> callback);
209 void SetBluetoothManualChooser(bool enable); 210 void SetBluetoothManualChooser(bool enable);
210 void SetCanOpenWindows(); 211 void SetCanOpenWindows();
211 void SetCloseRemainingWindowsWhenComplete(gin::Arguments* args); 212 void SetCloseRemainingWindowsWhenComplete(gin::Arguments* args);
212 void SetColorProfile(const std::string& name, 213 void SetColorProfile(const std::string& name,
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 // https://webbluetoothcg.github.io/web-bluetooth/tests/. 493 // https://webbluetoothcg.github.io/web-bluetooth/tests/.
493 .SetMethod("sendBluetoothManualChooserEvent", 494 .SetMethod("sendBluetoothManualChooserEvent",
494 &TestRunnerBindings::SendBluetoothManualChooserEvent) 495 &TestRunnerBindings::SendBluetoothManualChooserEvent)
495 .SetMethod("setAcceptLanguages", &TestRunnerBindings::SetAcceptLanguages) 496 .SetMethod("setAcceptLanguages", &TestRunnerBindings::SetAcceptLanguages)
496 .SetMethod("setAllowDisplayOfInsecureContent", 497 .SetMethod("setAllowDisplayOfInsecureContent",
497 &TestRunnerBindings::SetAllowDisplayOfInsecureContent) 498 &TestRunnerBindings::SetAllowDisplayOfInsecureContent)
498 .SetMethod("setAllowFileAccessFromFileURLs", 499 .SetMethod("setAllowFileAccessFromFileURLs",
499 &TestRunnerBindings::SetAllowFileAccessFromFileURLs) 500 &TestRunnerBindings::SetAllowFileAccessFromFileURLs)
500 .SetMethod("setAllowRunningOfInsecureContent", 501 .SetMethod("setAllowRunningOfInsecureContent",
501 &TestRunnerBindings::SetAllowRunningOfInsecureContent) 502 &TestRunnerBindings::SetAllowRunningOfInsecureContent)
503 .SetMethod("setAutoplayAllowed",
504 &TestRunnerBindings::SetAutoplayAllowed)
502 .SetMethod("setAllowUniversalAccessFromFileURLs", 505 .SetMethod("setAllowUniversalAccessFromFileURLs",
503 &TestRunnerBindings::SetAllowUniversalAccessFromFileURLs) 506 &TestRunnerBindings::SetAllowUniversalAccessFromFileURLs)
504 .SetMethod("setAlwaysAcceptCookies", 507 .SetMethod("setAlwaysAcceptCookies",
505 &TestRunnerBindings::SetAlwaysAcceptCookies) 508 &TestRunnerBindings::SetAlwaysAcceptCookies)
506 .SetMethod("setAudioData", &TestRunnerBindings::SetAudioData) 509 .SetMethod("setAudioData", &TestRunnerBindings::SetAudioData)
507 .SetMethod("setBackingScaleFactor", 510 .SetMethod("setBackingScaleFactor",
508 &TestRunnerBindings::SetBackingScaleFactor) 511 &TestRunnerBindings::SetBackingScaleFactor)
509 // The Bluetooth functions are specified at 512 // The Bluetooth functions are specified at
510 // https://webbluetoothcg.github.io/web-bluetooth/tests/. 513 // https://webbluetoothcg.github.io/web-bluetooth/tests/.
511 .SetMethod("setBluetoothFakeAdapter", 514 .SetMethod("setBluetoothFakeAdapter",
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 void TestRunnerBindings::SetAllowDisplayOfInsecureContent(bool allowed) { 1139 void TestRunnerBindings::SetAllowDisplayOfInsecureContent(bool allowed) {
1137 if (runner_) 1140 if (runner_)
1138 runner_->SetAllowDisplayOfInsecureContent(allowed); 1141 runner_->SetAllowDisplayOfInsecureContent(allowed);
1139 } 1142 }
1140 1143
1141 void TestRunnerBindings::SetAllowRunningOfInsecureContent(bool allowed) { 1144 void TestRunnerBindings::SetAllowRunningOfInsecureContent(bool allowed) {
1142 if (runner_) 1145 if (runner_)
1143 runner_->SetAllowRunningOfInsecureContent(allowed); 1146 runner_->SetAllowRunningOfInsecureContent(allowed);
1144 } 1147 }
1145 1148
1149 void TestRunnerBindings::SetAutoplayAllowed(bool allowed) {
1150 if (runner_)
1151 runner_->SetAutoplayAllowed(allowed);
1152 }
1153
1146 void TestRunnerBindings::DumpPermissionClientCallbacks() { 1154 void TestRunnerBindings::DumpPermissionClientCallbacks() {
1147 if (runner_) 1155 if (runner_)
1148 runner_->DumpPermissionClientCallbacks(); 1156 runner_->DumpPermissionClientCallbacks();
1149 } 1157 }
1150 1158
1151 void TestRunnerBindings::DumpWindowStatusChanges() { 1159 void TestRunnerBindings::DumpWindowStatusChanges() {
1152 if (runner_) 1160 if (runner_)
1153 runner_->DumpWindowStatusChanges(); 1161 runner_->DumpWindowStatusChanges();
1154 } 1162 }
1155 1163
(...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after
2804 void TestRunner::SetAllowDisplayOfInsecureContent(bool allowed) { 2812 void TestRunner::SetAllowDisplayOfInsecureContent(bool allowed) {
2805 layout_test_runtime_flags_.set_displaying_insecure_content_allowed(allowed); 2813 layout_test_runtime_flags_.set_displaying_insecure_content_allowed(allowed);
2806 OnLayoutTestRuntimeFlagsChanged(); 2814 OnLayoutTestRuntimeFlagsChanged();
2807 } 2815 }
2808 2816
2809 void TestRunner::SetAllowRunningOfInsecureContent(bool allowed) { 2817 void TestRunner::SetAllowRunningOfInsecureContent(bool allowed) {
2810 layout_test_runtime_flags_.set_running_insecure_content_allowed(allowed); 2818 layout_test_runtime_flags_.set_running_insecure_content_allowed(allowed);
2811 OnLayoutTestRuntimeFlagsChanged(); 2819 OnLayoutTestRuntimeFlagsChanged();
2812 } 2820 }
2813 2821
2822 void TestRunner::SetAutoplayAllowed(bool allowed) {
2823 layout_test_runtime_flags_.set_autoplay_allowed(allowed);
2824 OnLayoutTestRuntimeFlagsChanged();
2825 }
2826
2814 void TestRunner::DumpPermissionClientCallbacks() { 2827 void TestRunner::DumpPermissionClientCallbacks() {
2815 layout_test_runtime_flags_.set_dump_web_content_settings_client_callbacks( 2828 layout_test_runtime_flags_.set_dump_web_content_settings_client_callbacks(
2816 true); 2829 true);
2817 OnLayoutTestRuntimeFlagsChanged(); 2830 OnLayoutTestRuntimeFlagsChanged();
2818 } 2831 }
2819 2832
2820 void TestRunner::DumpWindowStatusChanges() { 2833 void TestRunner::DumpWindowStatusChanges() {
2821 dump_window_status_changes_ = true; 2834 dump_window_status_changes_ = true;
2822 } 2835 }
2823 2836
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
3364 3377
3365 blink::WebView* TestRunnerForSpecificView::web_view() { 3378 blink::WebView* TestRunnerForSpecificView::web_view() {
3366 return web_test_proxy_base_->web_view(); 3379 return web_test_proxy_base_->web_view();
3367 } 3380 }
3368 3381
3369 WebTestDelegate* TestRunnerForSpecificView::delegate() { 3382 WebTestDelegate* TestRunnerForSpecificView::delegate() {
3370 return web_test_proxy_base_->delegate(); 3383 return web_test_proxy_base_->delegate();
3371 } 3384 }
3372 3385
3373 } // namespace test_runner 3386 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698