Commit d06e3fcf authored by sammc's avatar sammc Committed by Commit bot

Fix //content/test:test_support under component builds.

Previously, //content/test:test_support depended directly on *_sources
targets. In component builds, this caused the browser_tests and
content_browsertests binaries to include their own copies of content as
well as depend on libcontent.so. This caused browser_tests and
content_browsertests to crash on startup. This CL changes test_support
to depend on the targets that forward to //content in component builds
and introduces such targets for gpu and ppapi_plugin.

The test_support changes also exposed underspecified dependencies in
extensions/renderer/BUILD.gn and third_party/libjingle/BUILD.gn, and
incorrect generated file dependencies in content/browser/devtools; the
generated files depend on other non-generated files so have to be
directly included in //content/browser.

BUG=432959

Review URL: https://codereview.chromium.org/1104973002

Cr-Commit-Position: refs/heads/master@{#327188}
parent 41e95b46
...@@ -38,7 +38,7 @@ config("content_implementation") { ...@@ -38,7 +38,7 @@ config("content_implementation") {
# when doing a component build). # when doing a component build).
content_shared_components = [ content_shared_components = [
"//content/gpu", "//content/gpu:gpu_sources",
"//content/public/browser:browser_sources", "//content/public/browser:browser_sources",
"//content/public/child:child_sources", "//content/public/child:child_sources",
"//content/public/common:common_sources", "//content/public/common:common_sources",
...@@ -48,7 +48,7 @@ content_shared_components = [ ...@@ -48,7 +48,7 @@ content_shared_components = [
] ]
if (enable_plugins) { if (enable_plugins) {
content_shared_components += [ "//content/ppapi_plugin" ] content_shared_components += [ "//content/ppapi_plugin:ppapi_plugin_sources" ]
} }
if (is_component_build) { if (is_component_build) {
......
...@@ -72,7 +72,7 @@ content_app_extra_configs = [ ...@@ -72,7 +72,7 @@ content_app_extra_configs = [
] ]
if (!is_chrome_multiple_dll) { if (!is_chrome_multiple_dll) {
content_app_deps += [ "//content/gpu" ] content_app_deps += [ "//content/gpu:gpu_sources" ]
} }
# This includes the app sources for both the browser and child processes. # This includes the app sources for both the browser and child processes.
......
...@@ -89,8 +89,6 @@ source_set("browser") { ...@@ -89,8 +89,6 @@ source_set("browser") {
"$root_gen_dir/blink/grit/devtools_resources.h", "$root_gen_dir/blink/grit/devtools_resources.h",
"$root_gen_dir/blink/grit/devtools_resources_map.cc", "$root_gen_dir/blink/grit/devtools_resources_map.cc",
"$root_gen_dir/blink/grit/devtools_resources_map.h", "$root_gen_dir/blink/grit/devtools_resources_map.h",
"$root_gen_dir/content/browser/devtools/protocol/devtools_protocol_dispatcher.cc",
"$root_gen_dir/content/browser/devtools/protocol/devtools_protocol_dispatcher.h",
"$root_gen_dir/content/browser/tracing/grit/tracing_resources.h", "$root_gen_dir/content/browser/tracing/grit/tracing_resources.h",
"$root_gen_dir/ui/resources/grit/webui_resources_map.cc", "$root_gen_dir/ui/resources/grit/webui_resources_map.cc",
], ],
...@@ -103,6 +101,7 @@ source_set("browser") { ...@@ -103,6 +101,7 @@ source_set("browser") {
"//components/scheduler:common", "//components/scheduler:common",
"//content/app/resources", "//content/app/resources",
"//content/app/strings", "//content/app/strings",
"//content/browser/devtools:gen_devtools_protocol_handler",
"//content/browser/devtools:resources", "//content/browser/devtools:resources",
"//content/common:mojo_bindings", "//content/common:mojo_bindings",
"//content/public/common:mojo_bindings", "//content/public/common:mojo_bindings",
......
...@@ -8,7 +8,6 @@ import("//tools/grit/grit_rule.gni") ...@@ -8,7 +8,6 @@ import("//tools/grit/grit_rule.gni")
group("resources") { group("resources") {
deps = [ deps = [
":devtools_resources", ":devtools_resources",
":devtools_protocol_handler",
] ]
} }
...@@ -36,7 +35,7 @@ grit("devtools_resources") { ...@@ -36,7 +35,7 @@ grit("devtools_resources") {
} }
action("gen_devtools_protocol_handler") { action("gen_devtools_protocol_handler") {
visibility = [ ":devtools_protocol_handler" ] visibility = [ "//content/browser" ]
script = "//content/browser/devtools/protocol/" + script = "//content/browser/devtools/protocol/" +
"devtools_protocol_handler_generator.py" "devtools_protocol_handler_generator.py"
...@@ -56,8 +55,3 @@ action("gen_devtools_protocol_handler") { ...@@ -56,8 +55,3 @@ action("gen_devtools_protocol_handler") {
args = args =
rebase_path(inputs, root_build_dir) + rebase_path(outputs, root_build_dir) rebase_path(inputs, root_build_dir) + rebase_path(outputs, root_build_dir)
} }
source_set("devtools_protocol_handler") {
visibility = [ ":resources" ]
sources = get_target_outputs(":gen_devtools_protocol_handler")
}
...@@ -5,7 +5,22 @@ ...@@ -5,7 +5,22 @@
import("//build/config/ui.gni") import("//build/config/ui.gni")
import("//content/content.gni") import("//content/content.gni")
source_set("gpu") { # See //content/BUILD.gn for how this works.
group("gpu") {
visibility = [ "//content/*" ]
if (is_component_build) {
public_deps = [
"//content",
]
} else {
public_deps = [
":gpu_sources",
]
}
}
source_set("gpu_sources") {
visibility = [ "//content/*" ] visibility = [ "//content/*" ]
sources = [ sources = [
......
...@@ -2,7 +2,21 @@ ...@@ -2,7 +2,21 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
source_set("ppapi_plugin") { group("ppapi_plugin") {
visibility = [ "//content/*" ]
if (is_component_build) {
public_deps = [
"//content",
]
} else {
public_deps = [
":ppapi_plugin_sources",
]
}
}
source_set("ppapi_plugin_sources") {
visibility = [ "//content/*" ] visibility = [ "//content/*" ]
sources = [ sources = [
......
...@@ -25,8 +25,8 @@ static_library("test_support") { ...@@ -25,8 +25,8 @@ static_library("test_support") {
deps = [ deps = [
"//cc/blink", "//cc/blink",
"//content/public/app:both", "//content/public/app:both",
"//content/public/browser:browser_sources", "//content/public/browser",
"//content/public/common:common_sources", "//content/public/common",
"//net:test_support", "//net:test_support",
"//skia", "//skia",
"//storage/common", "//storage/common",
...@@ -56,11 +56,11 @@ static_library("test_support") { ...@@ -56,11 +56,11 @@ static_library("test_support") {
deps += [ deps += [
"//components/scheduler:scheduler", "//components/scheduler:scheduler",
"//content/browser/speech/proto", "//content/browser/speech/proto",
"//content/public/child:child_sources", "//content/public/child",
"//content/gpu", "//content/gpu",
"//content/public/plugin:plugin_sources", "//content/public/plugin",
"//content/public/renderer:renderer_sources", "//content/public/renderer",
"//content/public/utility:utility_sources", "//content/public/utility",
"//content/shell:pak", "//content/shell:pak",
"//cc", "//cc",
"//cc:test_support", "//cc:test_support",
...@@ -452,6 +452,7 @@ if (!is_mac) { # TODO(GYP) enable on Mac once it links. ...@@ -452,6 +452,7 @@ if (!is_mac) { # TODO(GYP) enable on Mac once it links.
"//content/browser/notifications:notification_proto", "//content/browser/notifications:notification_proto",
"//content/browser/service_worker:service_worker_proto", "//content/browser/service_worker:service_worker_proto",
"//content/browser/speech/proto", "//content/browser/speech/proto",
"//content/common:mojo_bindings",
"//content/public/browser", "//content/public/browser",
"//content/public/common", "//content/public/common",
"//content/public/common:mojo_bindings", "//content/public/common:mojo_bindings",
......
...@@ -24,5 +24,6 @@ source_set("renderer") { ...@@ -24,5 +24,6 @@ source_set("renderer") {
"//skia", "//skia",
"//third_party/WebKit/public:blink", "//third_party/WebKit/public:blink",
"//third_party/mojo/src/mojo/edk/js", "//third_party/mojo/src/mojo/edk/js",
"//third_party/mojo/src/mojo/public/js",
] ]
} }
...@@ -491,6 +491,7 @@ if (enable_webrtc) { ...@@ -491,6 +491,7 @@ if (enable_webrtc) {
public_configs = [ ":jingle_public_configs" ] public_configs = [ ":jingle_public_configs" ]
deps = [ deps = [
":libjingle",
"//third_party/libsrtp", "//third_party/libsrtp",
"//third_party/webrtc/modules/media_file", "//third_party/webrtc/modules/media_file",
"//third_party/webrtc/modules/video_capture", "//third_party/webrtc/modules/video_capture",
......
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