Skip to content

Commit

Permalink
Cherry pick PR #1369: Add missing browser dependencies (#1378)
Browse files Browse the repository at this point in the history
Refer to the original PR: #1369

b/297087147

Some test targets reference symbols in generated_bindings_source but
dont include it.

Including generated_bindings_source in a test target is hard to isolate
as generated_bindings_source depends on a bunch of cobalt browser deps.

This change includes cobalt/browser as a dep for all test targets which
need symbols from generated_bindings_source

In the future, we would like to reduce this dependency by making test
targets include a subset of needed symbols, not the entire
cobalt/browser

Co-authored-by: Niranjan Yardi <[email protected]>
  • Loading branch information
1 parent 1016439 commit 61fa7cb
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cobalt/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,10 @@ cache_lex_tables("cached_lex_yacc_tables") {
cache_templates("cached_jinja_templates") {
output_dir = _bindings_scripts_output_dir
}

group("test_dependencies_on_browser") {
testonly = true

# TODO: 297087147 - Depend on smaller targets than browser.
deps = [ "//cobalt/browser" ]
}
1 change: 1 addition & 0 deletions cobalt/browser/metrics/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ target(gtest_target_type, "metrics_test") {
deps = [
":metrics",
"//base",
"//cobalt//browser:test_dependencies_on_browser",
"//cobalt/browser:generated_types",
"//cobalt/h5vcc",
"//cobalt/h5vcc:metric_event_handler_wrapper",
Expand Down
1 change: 1 addition & 0 deletions cobalt/css_parser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ target(gtest_target_type, "css_parser_test") {
":css_grammar",
":css_parser",
"//base",
"//cobalt/browser:test_dependencies_on_browser",
"//cobalt/cssom",
"//cobalt/dom",
"//cobalt/test:run_all_unittests",
Expand Down
1 change: 1 addition & 0 deletions cobalt/cssom/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ target(gtest_target_type, "cssom_test") {

deps = [
"//cobalt/base",
"//cobalt/browser:test_dependencies_on_browser",
"//cobalt/css_parser",
"//cobalt/cssom",
"//cobalt/dom",
Expand Down
1 change: 1 addition & 0 deletions cobalt/layout/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ target(gtest_target_type, "layout_test") {
deps = [
":layout",
"//base",
"//cobalt//browser:test_dependencies_on_browser",
"//cobalt/base",
"//cobalt/css_parser",
"//cobalt/cssom",
Expand Down
1 change: 1 addition & 0 deletions cobalt/loader/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ target(gtest_target_type, "loader_test") {
deps = [
":loader",
"//cobalt/base:base",
"//cobalt/browser:test_dependencies_on_browser",
"//cobalt/dom",
"//cobalt/dom_parser",
"//cobalt/math:math",
Expand Down
2 changes: 2 additions & 0 deletions cobalt/loader/image/sandbox/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
# This target will build a sandbox application that allows for easy
# experimentation with the ImageDecoder on any platform.
target(final_executable_type, "image_decoder_sandbox") {
testonly = true
sources = [ "image_decoder_sandbox.cc" ]

deps = [
"//cobalt/base",
"//cobalt/browser:test_dependencies_on_browser",
"//cobalt/loader",
"//cobalt/loader:copy_loader_test_data",
"//cobalt/math",
Expand Down
1 change: 1 addition & 0 deletions cobalt/media/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ target(gtest_target_type, "media_test") {
deps = [
":media",
"//base/test:test_support",
"//cobalt//browser:test_dependencies_on_browser",
"//cobalt/base",
"//cobalt/test:run_all_unittests",
"//testing/gmock",
Expand Down
4 changes: 4 additions & 0 deletions cobalt/media/sandbox/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
# media/renderer interface.

target(final_executable_type, "media_sandbox") {
testonly = true
sources = [ "media2_sandbox.cc" ]

deps = [
"//cobalt//browser:test_dependencies_on_browser",
"//cobalt/base",
"//cobalt/math",
"//cobalt/media",
Expand All @@ -28,6 +30,7 @@ target(final_executable_type, "media_sandbox") {
}

target(final_executable_type, "web_media_player_sandbox") {
testonly = true
sources = [
"format_guesstimator.cc",
"format_guesstimator.h",
Expand All @@ -42,6 +45,7 @@ target(final_executable_type, "web_media_player_sandbox") {
"//cobalt/base",

# Use test data from demos to avoid keeping two copies of video files.
"//cobalt/browser:test_dependencies_on_browser",
"//cobalt/demos/content:demos_testdata",
"//cobalt/loader",
"//cobalt/math",
Expand Down
1 change: 1 addition & 0 deletions cobalt/renderer/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ target(gtest_target_type, "renderer_test") {
":renderer",
":renderer_headers_only",
"//base:i18n",
"//cobalt//browser:test_dependencies_on_browser",
"//cobalt/base",
"//cobalt/loader",
"//cobalt/math",
Expand Down
4 changes: 4 additions & 0 deletions cobalt/renderer/sandbox/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
# also be useful for visually inspecting the output that the Cobalt
# renderer is producing.
target(final_executable_type, "renderer_sandbox") {
testonly = true
sources = [ "renderer_sandbox_main.cc" ]

deps = [
"//cobalt/base",
"//cobalt/browser:test_dependencies_on_browser",
"//cobalt/math",
"//cobalt/renderer",
"//cobalt/renderer/test/scenes",
Expand All @@ -39,10 +41,12 @@ target(final_executable_type, "renderer_sandbox") {
# is constantly animating, which for many implementations can be a
# performance problem.
target(final_executable_type, "scaling_text_sandbox") {
testonly = true
sources = [ "scaling_text_sandbox_main.cc" ]

deps = [
"//cobalt/base",
"//cobalt/browser:test_dependencies_on_browser",
"//cobalt/math",
"//cobalt/renderer",
"//cobalt/renderer/test/scenes",
Expand Down
1 change: 1 addition & 0 deletions cobalt/ui_navigation/scroll_engine/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ target(gtest_target_type, "scroll_engine_tests") {
sources = [ "free_scrolling_nav_item_test.cc" ]
deps = [
":scroll_engine",
"//cobalt//browser:test_dependencies_on_browser",
"//cobalt/base",
"//cobalt/test:run_all_unittests",
"//testing/gmock",
Expand Down
1 change: 1 addition & 0 deletions cobalt/web_animations/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ target(gtest_target_type, "web_animations_test") {

deps = [
":web_animations",
"//cobalt/browser:test_dependencies_on_browser",
"//cobalt/css_parser",
"//cobalt/cssom",
"//cobalt/dom",
Expand Down
1 change: 1 addition & 0 deletions cobalt/worker/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ target(gtest_target_type, "worker_test") {
"//cobalt/browser:browser",
"//cobalt/browser:generated_bindings",
"//cobalt/browser:generated_types",
"//cobalt/browser:test_dependencies_on_browser",
"//cobalt/css_parser",
"//cobalt/cssom",
"//cobalt/dom/testing:dom_testing",
Expand Down
1 change: 1 addition & 0 deletions content/browser/speech/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ target(gtest_target_type, "speech_test") {
]
deps = [
":speech",
"//cobalt//browser:test_dependencies_on_browser",
"//cobalt/media",
"//cobalt/test:run_all_unittests",
"//starboard",
Expand Down

0 comments on commit 61fa7cb

Please sign in to comment.