| Index: components/test_runner/test_runner.cc
|
| diff --git a/components/test_runner/test_runner.cc b/components/test_runner/test_runner.cc
|
| index 72cbe6df6a8b433745921be0ef16ee682393abb5..ed1bbb98919ebfd737438335baea5e7f3258834c 100644
|
| --- a/components/test_runner/test_runner.cc
|
| +++ b/components/test_runner/test_runner.cc
|
| @@ -20,6 +20,7 @@
|
| #include "components/test_runner/mock_content_settings_client.h"
|
| #include "components/test_runner/mock_credential_manager_client.h"
|
| #include "components/test_runner/mock_screen_orientation_client.h"
|
| +#include "components/test_runner/mock_web_document_subresource_filter.h"
|
| #include "components/test_runner/mock_web_speech_recognizer.h"
|
| #include "components/test_runner/mock_web_user_media_client.h"
|
| #include "components/test_runner/pixel_dump.h"
|
| @@ -210,6 +211,8 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> {
|
| void SetCustomPolicyDelegate(gin::Arguments* args);
|
| void SetCustomTextOutput(const std::string& output);
|
| void SetDatabaseQuota(int quota);
|
| + void SetDisallowedSubresourcePathSuffixes(
|
| + const std::vector<std::string>& suffixes);
|
| void SetDomainRelaxationForbiddenForURLScheme(bool forbidden,
|
| const std::string& scheme);
|
| void SetGeofencingMockPosition(double latitude, double longitude);
|
| @@ -370,6 +373,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
|
| &TestRunnerBindings::DisableAutoResizeMode)
|
| .SetMethod("disableMockScreenOrientation",
|
| &TestRunnerBindings::DisableMockScreenOrientation)
|
| + .SetMethod("setDisallowedSubresourcePathSuffixes",
|
| + &TestRunnerBindings::SetDisallowedSubresourcePathSuffixes)
|
| .SetMethod("dispatchBeforeInstallPromptEvent",
|
| &TestRunnerBindings::DispatchBeforeInstallPromptEvent)
|
| .SetMethod("dumpAsMarkup", &TestRunnerBindings::DumpAsMarkup)
|
| @@ -480,8 +485,7 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
|
| &TestRunnerBindings::ResetTestHelperControllers)
|
| .SetMethod("resolveBeforeInstallPromptPromise",
|
| &TestRunnerBindings::ResolveBeforeInstallPromptPromise)
|
| - .SetMethod("runIdleTasks",
|
| - &TestRunnerBindings::RunIdleTasks)
|
| + .SetMethod("runIdleTasks", &TestRunnerBindings::RunIdleTasks)
|
| .SetMethod("selectionAsMarkup", &TestRunnerBindings::SelectionAsMarkup)
|
|
|
| // The Bluetooth functions are specified at
|
| @@ -495,8 +499,7 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
|
| &TestRunnerBindings::SetAllowFileAccessFromFileURLs)
|
| .SetMethod("setAllowRunningOfInsecureContent",
|
| &TestRunnerBindings::SetAllowRunningOfInsecureContent)
|
| - .SetMethod("setAutoplayAllowed",
|
| - &TestRunnerBindings::SetAutoplayAllowed)
|
| + .SetMethod("setAutoplayAllowed", &TestRunnerBindings::SetAutoplayAllowed)
|
| .SetMethod("setAllowUniversalAccessFromFileURLs",
|
| &TestRunnerBindings::SetAllowUniversalAccessFromFileURLs)
|
| .SetMethod("setAlwaysAcceptCookies",
|
| @@ -945,6 +948,12 @@ void TestRunnerBindings::DisableMockScreenOrientation() {
|
| runner_->DisableMockScreenOrientation();
|
| }
|
|
|
| +void TestRunnerBindings::SetDisallowedSubresourcePathSuffixes(
|
| + const std::vector<std::string>& suffixes) {
|
| + if (runner_)
|
| + runner_->SetDisallowedSubresourcePathSuffixes(suffixes);
|
| +}
|
| +
|
| void TestRunnerBindings::DidAcquirePointerLock() {
|
| if (view_runner_)
|
| view_runner_->DidAcquirePointerLock();
|
| @@ -2544,6 +2553,14 @@ void TestRunner::DumpPermissionClientCallbacks() {
|
| OnLayoutTestRuntimeFlagsChanged();
|
| }
|
|
|
| +void TestRunner::SetDisallowedSubresourcePathSuffixes(
|
| + const std::vector<std::string>& suffixes) {
|
| + DCHECK(main_view_);
|
| + WebDataSource* data_source = main_view_->mainFrame()->dataSource();
|
| + data_source->setSubresourceFilter(
|
| + new MockWebDocumentSubresourceFilter(suffixes));
|
| +}
|
| +
|
| void TestRunner::DumpWindowStatusChanges() {
|
| dump_window_status_changes_ = true;
|
| }
|
|
|