Commit f6b075f9 authored by danakj's avatar danakj Committed by Commit Bot

Restrict //content/renderer/ use in test runner to avoid leaking

Allows usage only in .cc files (which won't leak out of test_runner)
and the Web(Frame|View|Widget)TestProxy headers, which are not included
in non-web-test code.

Also restricts //content/shell from including the
Web(Frame|View|Widget)TestProxy headers.

R=jochen@chromium.org

Bug: 912193
Change-Id: I82528217eeaa363f54f0fc102e1e5a9500f707a8
Reviewed-on: https://chromium-review.googlesource.com/c/1476462
Auto-Submit: danakj <danakj@chromium.org>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: default avatarAlbert J. Wong <ajwong@chromium.org>
Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633867}
parent 5a5811aa
...@@ -3,6 +3,5 @@ include_rules = [ ...@@ -3,6 +3,5 @@ include_rules = [
"+components/cdm", "+components/cdm",
"+components/web_cache/renderer", "+components/web_cache/renderer",
"+components/plugins/renderer", "+components/plugins/renderer",
"+content/shell/test_runner",
"+services/service_manager/public/cpp", "+services/service_manager/public/cpp",
] ]
include_rules = [
# Web test code is interconnected with test_runner. It would be nice to merge
# these two layers and drop extra abstractions between them.
"+content/shell/test_runner",
# These files use //content/renderer/ for web test helpers, but those includes
# should not leak out to other parts of //content/shell unrelated to web
# tests. To avoid transitively including them to //content/shell through
# this directory, we avoid including them.
"-content/shell/test_runner/web_frame_test_proxy.h",
"-content/shell/test_runner/web_view_test_proxy.h",
"-content/shell/test_runner/web_widget_test_proxy.h",
]
specific_include_rules = {
# cc files do not leak includes so they are allowed to reference the test
# helpers that include //content/renderer.
".*\.cc": [
"+content/shell/test_runner/web_frame_test_proxy.h",
"+content/shell/test_runner/web_view_test_proxy.h",
"+content/shell/test_runner/web_widget_test_proxy.h",
],
}
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
#include "content/shell/test_runner/pixel_dump.h" #include "content/shell/test_runner/pixel_dump.h"
#include "content/shell/test_runner/web_test_interfaces.h" #include "content/shell/test_runner/web_test_interfaces.h"
#include "content/shell/test_runner/web_test_runner.h" #include "content/shell/test_runner/web_test_runner.h"
#include "content/shell/test_runner/web_view_test_proxy.h"
#include "media/base/audio_capturer_source.h" #include "media/base/audio_capturer_source.h"
#include "media/base/audio_parameters.h" #include "media/base/audio_parameters.h"
#include "media/capture/video_capturer_source.h" #include "media/capture/video_capturer_source.h"
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include "third_party/blink/public/platform/web_rtc_peer_connection_handler.h" #include "third_party/blink/public/platform/web_rtc_peer_connection_handler.h"
#include "third_party/blink/public/platform/web_runtime_features.h" #include "third_party/blink/public/platform/web_runtime_features.h"
#include "third_party/blink/public/web/blink.h" #include "third_party/blink/public/web/blink.h"
#include "third_party/blink/public/web/web_frame_widget.h"
#include "third_party/blink/public/web/web_plugin_params.h" #include "third_party/blink/public/web/web_plugin_params.h"
#include "third_party/blink/public/web/web_testing_support.h" #include "third_party/blink/public/web/web_testing_support.h"
#include "third_party/blink/public/web/web_view.h" #include "third_party/blink/public/web/web_view.h"
......
include_rules = [ include_rules = [
"+cc", "+cc",
"+content/public/test", "+content/public/test",
"+content/renderer",
"+device/gamepad/public/cpp", "+device/gamepad/public/cpp",
"+device/gamepad/public/mojom", "+device/gamepad/public/mojom",
"+gin", "+gin",
...@@ -22,3 +21,18 @@ include_rules = [ ...@@ -22,3 +21,18 @@ include_rules = [
"+ui/gfx", "+ui/gfx",
"+v8/include", "+v8/include",
] ]
# //content/renderer is allowed for web tests helpers, but should not leak out
# to other parts of //content/shell unrelated to web tests. So we limit access
# to things that are not used elsewhere.
specific_include_rules = {
# These classes subclass RenderView and RenderWidget to inject behaviour
# for web tests.
"web_(frame|view|widget)_test_proxy\.h": [
"+content/renderer",
],
# cc files will not leak //content/renderer includes.
".*\.cc": [
"+content/renderer",
],
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment