OLD | NEW |
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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 bool allow_destination_subdomains); | 185 bool allow_destination_subdomains); |
186 void RemoveWebPageOverlay(); | 186 void RemoveWebPageOverlay(); |
187 void ResetDeviceLight(); | 187 void ResetDeviceLight(); |
188 void ResetTestHelperControllers(); | 188 void ResetTestHelperControllers(); |
189 void ResolveBeforeInstallPromptPromise(int request_id, | 189 void ResolveBeforeInstallPromptPromise(int request_id, |
190 const std::string& platform); | 190 const std::string& platform); |
191 void RunIdleTasks(v8::Local<v8::Function> callback); | 191 void RunIdleTasks(v8::Local<v8::Function> callback); |
192 void SendBluetoothManualChooserEvent(const std::string& event, | 192 void SendBluetoothManualChooserEvent(const std::string& event, |
193 const std::string& argument); | 193 const std::string& argument); |
194 void SetAcceptLanguages(const std::string& accept_languages); | 194 void SetAcceptLanguages(const std::string& accept_languages); |
195 void SetAllowDisplayOfInsecureContent(bool allowed); | |
196 void SetAllowFileAccessFromFileURLs(bool allow); | 195 void SetAllowFileAccessFromFileURLs(bool allow); |
197 void SetAllowRunningOfInsecureContent(bool allowed); | 196 void SetAllowRunningOfInsecureContent(bool allowed); |
198 void SetAutoplayAllowed(bool allowed); | 197 void SetAutoplayAllowed(bool allowed); |
199 void SetAllowUniversalAccessFromFileURLs(bool allow); | 198 void SetAllowUniversalAccessFromFileURLs(bool allow); |
200 void SetBlockThirdPartyCookies(bool block); | 199 void SetBlockThirdPartyCookies(bool block); |
201 void SetAudioData(const gin::ArrayBufferView& view); | 200 void SetAudioData(const gin::ArrayBufferView& view); |
202 void SetBackingScaleFactor(double value, v8::Local<v8::Function> callback); | 201 void SetBackingScaleFactor(double value, v8::Local<v8::Function> callback); |
203 void SetBluetoothFakeAdapter(const std::string& adapter_name, | 202 void SetBluetoothFakeAdapter(const std::string& adapter_name, |
204 v8::Local<v8::Function> callback); | 203 v8::Local<v8::Function> callback); |
205 void SetBluetoothManualChooser(bool enable); | 204 void SetBluetoothManualChooser(bool enable); |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 .SetMethod("resolveBeforeInstallPromptPromise", | 475 .SetMethod("resolveBeforeInstallPromptPromise", |
477 &TestRunnerBindings::ResolveBeforeInstallPromptPromise) | 476 &TestRunnerBindings::ResolveBeforeInstallPromptPromise) |
478 .SetMethod("runIdleTasks", &TestRunnerBindings::RunIdleTasks) | 477 .SetMethod("runIdleTasks", &TestRunnerBindings::RunIdleTasks) |
479 .SetMethod("selectionAsMarkup", &TestRunnerBindings::SelectionAsMarkup) | 478 .SetMethod("selectionAsMarkup", &TestRunnerBindings::SelectionAsMarkup) |
480 | 479 |
481 // The Bluetooth functions are specified at | 480 // The Bluetooth functions are specified at |
482 // https://webbluetoothcg.github.io/web-bluetooth/tests/. | 481 // https://webbluetoothcg.github.io/web-bluetooth/tests/. |
483 .SetMethod("sendBluetoothManualChooserEvent", | 482 .SetMethod("sendBluetoothManualChooserEvent", |
484 &TestRunnerBindings::SendBluetoothManualChooserEvent) | 483 &TestRunnerBindings::SendBluetoothManualChooserEvent) |
485 .SetMethod("setAcceptLanguages", &TestRunnerBindings::SetAcceptLanguages) | 484 .SetMethod("setAcceptLanguages", &TestRunnerBindings::SetAcceptLanguages) |
486 .SetMethod("setAllowDisplayOfInsecureContent", | |
487 &TestRunnerBindings::SetAllowDisplayOfInsecureContent) | |
488 .SetMethod("setAllowFileAccessFromFileURLs", | 485 .SetMethod("setAllowFileAccessFromFileURLs", |
489 &TestRunnerBindings::SetAllowFileAccessFromFileURLs) | 486 &TestRunnerBindings::SetAllowFileAccessFromFileURLs) |
490 .SetMethod("setAllowRunningOfInsecureContent", | 487 .SetMethod("setAllowRunningOfInsecureContent", |
491 &TestRunnerBindings::SetAllowRunningOfInsecureContent) | 488 &TestRunnerBindings::SetAllowRunningOfInsecureContent) |
492 .SetMethod("setAutoplayAllowed", &TestRunnerBindings::SetAutoplayAllowed) | 489 .SetMethod("setAutoplayAllowed", &TestRunnerBindings::SetAutoplayAllowed) |
493 .SetMethod("setAllowUniversalAccessFromFileURLs", | 490 .SetMethod("setAllowUniversalAccessFromFileURLs", |
494 &TestRunnerBindings::SetAllowUniversalAccessFromFileURLs) | 491 &TestRunnerBindings::SetAllowUniversalAccessFromFileURLs) |
495 .SetMethod("setBlockThirdPartyCookies", | 492 .SetMethod("setBlockThirdPartyCookies", |
496 &TestRunnerBindings::SetBlockThirdPartyCookies) | 493 &TestRunnerBindings::SetBlockThirdPartyCookies) |
497 .SetMethod("setAudioData", &TestRunnerBindings::SetAudioData) | 494 .SetMethod("setAudioData", &TestRunnerBindings::SetAudioData) |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 void TestRunnerBindings::SetStorageAllowed(bool allowed) { | 1117 void TestRunnerBindings::SetStorageAllowed(bool allowed) { |
1121 if (runner_) | 1118 if (runner_) |
1122 runner_->SetStorageAllowed(allowed); | 1119 runner_->SetStorageAllowed(allowed); |
1123 } | 1120 } |
1124 | 1121 |
1125 void TestRunnerBindings::SetPluginsAllowed(bool allowed) { | 1122 void TestRunnerBindings::SetPluginsAllowed(bool allowed) { |
1126 if (runner_) | 1123 if (runner_) |
1127 runner_->SetPluginsAllowed(allowed); | 1124 runner_->SetPluginsAllowed(allowed); |
1128 } | 1125 } |
1129 | 1126 |
1130 void TestRunnerBindings::SetAllowDisplayOfInsecureContent(bool allowed) { | |
1131 if (runner_) | |
1132 runner_->SetAllowDisplayOfInsecureContent(allowed); | |
1133 } | |
1134 | |
1135 void TestRunnerBindings::SetAllowRunningOfInsecureContent(bool allowed) { | 1127 void TestRunnerBindings::SetAllowRunningOfInsecureContent(bool allowed) { |
1136 if (runner_) | 1128 if (runner_) |
1137 runner_->SetAllowRunningOfInsecureContent(allowed); | 1129 runner_->SetAllowRunningOfInsecureContent(allowed); |
1138 } | 1130 } |
1139 | 1131 |
1140 void TestRunnerBindings::SetAutoplayAllowed(bool allowed) { | 1132 void TestRunnerBindings::SetAutoplayAllowed(bool allowed) { |
1141 if (runner_) | 1133 if (runner_) |
1142 runner_->SetAutoplayAllowed(allowed); | 1134 runner_->SetAutoplayAllowed(allowed); |
1143 } | 1135 } |
1144 | 1136 |
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2308 } else if (key == "WebKitTabToLinksPreferenceKey") { | 2300 } else if (key == "WebKitTabToLinksPreferenceKey") { |
2309 prefs->tabs_to_links = value->BooleanValue(); | 2301 prefs->tabs_to_links = value->BooleanValue(); |
2310 } else if (key == "WebKitWebGLEnabled") { | 2302 } else if (key == "WebKitWebGLEnabled") { |
2311 prefs->experimental_webgl_enabled = value->BooleanValue(); | 2303 prefs->experimental_webgl_enabled = value->BooleanValue(); |
2312 } else if (key == "WebKitCSSGridLayoutEnabled") { | 2304 } else if (key == "WebKitCSSGridLayoutEnabled") { |
2313 prefs->experimental_css_grid_layout_enabled = value->BooleanValue(); | 2305 prefs->experimental_css_grid_layout_enabled = value->BooleanValue(); |
2314 } else if (key == "WebKitHyperlinkAuditingEnabled") { | 2306 } else if (key == "WebKitHyperlinkAuditingEnabled") { |
2315 prefs->hyperlink_auditing_enabled = value->BooleanValue(); | 2307 prefs->hyperlink_auditing_enabled = value->BooleanValue(); |
2316 } else if (key == "WebKitEnableCaretBrowsing") { | 2308 } else if (key == "WebKitEnableCaretBrowsing") { |
2317 prefs->caret_browsing_enabled = value->BooleanValue(); | 2309 prefs->caret_browsing_enabled = value->BooleanValue(); |
2318 } else if (key == "WebKitAllowDisplayingInsecureContent") { | |
2319 prefs->allow_display_of_insecure_content = value->BooleanValue(); | |
2320 } else if (key == "WebKitAllowRunningInsecureContent") { | 2310 } else if (key == "WebKitAllowRunningInsecureContent") { |
2321 prefs->allow_running_of_insecure_content = value->BooleanValue(); | 2311 prefs->allow_running_of_insecure_content = value->BooleanValue(); |
2322 } else if (key == "WebKitDisableReadingFromCanvas") { | 2312 } else if (key == "WebKitDisableReadingFromCanvas") { |
2323 prefs->disable_reading_from_canvas = value->BooleanValue(); | 2313 prefs->disable_reading_from_canvas = value->BooleanValue(); |
2324 } else if (key == "WebKitStrictMixedContentChecking") { | 2314 } else if (key == "WebKitStrictMixedContentChecking") { |
2325 prefs->strict_mixed_content_checking = value->BooleanValue(); | 2315 prefs->strict_mixed_content_checking = value->BooleanValue(); |
2326 } else if (key == "WebKitStrictPowerfulFeatureRestrictions") { | 2316 } else if (key == "WebKitStrictPowerfulFeatureRestrictions") { |
2327 prefs->strict_powerful_feature_restrictions = value->BooleanValue(); | 2317 prefs->strict_powerful_feature_restrictions = value->BooleanValue(); |
2328 } else if (key == "WebKitShouldRespectImageOrientation") { | 2318 } else if (key == "WebKitShouldRespectImageOrientation") { |
2329 prefs->should_respect_image_orientation = value->BooleanValue(); | 2319 prefs->should_respect_image_orientation = value->BooleanValue(); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2476 void TestRunner::SetStorageAllowed(bool allowed) { | 2466 void TestRunner::SetStorageAllowed(bool allowed) { |
2477 layout_test_runtime_flags_.set_storage_allowed(allowed); | 2467 layout_test_runtime_flags_.set_storage_allowed(allowed); |
2478 OnLayoutTestRuntimeFlagsChanged(); | 2468 OnLayoutTestRuntimeFlagsChanged(); |
2479 } | 2469 } |
2480 | 2470 |
2481 void TestRunner::SetPluginsAllowed(bool allowed) { | 2471 void TestRunner::SetPluginsAllowed(bool allowed) { |
2482 layout_test_runtime_flags_.set_plugins_allowed(allowed); | 2472 layout_test_runtime_flags_.set_plugins_allowed(allowed); |
2483 OnLayoutTestRuntimeFlagsChanged(); | 2473 OnLayoutTestRuntimeFlagsChanged(); |
2484 } | 2474 } |
2485 | 2475 |
2486 void TestRunner::SetAllowDisplayOfInsecureContent(bool allowed) { | |
2487 layout_test_runtime_flags_.set_displaying_insecure_content_allowed(allowed); | |
2488 OnLayoutTestRuntimeFlagsChanged(); | |
2489 } | |
2490 | |
2491 void TestRunner::SetAllowRunningOfInsecureContent(bool allowed) { | 2476 void TestRunner::SetAllowRunningOfInsecureContent(bool allowed) { |
2492 layout_test_runtime_flags_.set_running_insecure_content_allowed(allowed); | 2477 layout_test_runtime_flags_.set_running_insecure_content_allowed(allowed); |
2493 OnLayoutTestRuntimeFlagsChanged(); | 2478 OnLayoutTestRuntimeFlagsChanged(); |
2494 } | 2479 } |
2495 | 2480 |
2496 void TestRunner::SetAutoplayAllowed(bool allowed) { | 2481 void TestRunner::SetAutoplayAllowed(bool allowed) { |
2497 layout_test_runtime_flags_.set_autoplay_allowed(allowed); | 2482 layout_test_runtime_flags_.set_autoplay_allowed(allowed); |
2498 OnLayoutTestRuntimeFlagsChanged(); | 2483 OnLayoutTestRuntimeFlagsChanged(); |
2499 } | 2484 } |
2500 | 2485 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2744 | 2729 |
2745 void TestRunner::NotifyDone() { | 2730 void TestRunner::NotifyDone() { |
2746 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2731 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
2747 !will_navigate_ && work_queue_.is_empty()) | 2732 !will_navigate_ && work_queue_.is_empty()) |
2748 delegate_->TestFinished(); | 2733 delegate_->TestFinished(); |
2749 layout_test_runtime_flags_.set_wait_until_done(false); | 2734 layout_test_runtime_flags_.set_wait_until_done(false); |
2750 OnLayoutTestRuntimeFlagsChanged(); | 2735 OnLayoutTestRuntimeFlagsChanged(); |
2751 } | 2736 } |
2752 | 2737 |
2753 } // namespace test_runner | 2738 } // namespace test_runner |
OLD | NEW |