1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
fuchsia_web / runners / BUILD.gn [blame]
# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
assert(is_fuchsia)
import("//build/config/fuchsia/generate_runner_scripts.gni")
import("//build/config/fuchsia/symbol_archive.gni")
import("//testing/test.gni")
import("//third_party/fuchsia-gn-sdk/src/component.gni")
import("//third_party/fuchsia-gn-sdk/src/package.gni")
# Only allow use by targets in this directory unless explicitly specified.
visibility = [ ":*" ]
# Abstractions for use by runners that show web content.
source_set("common") {
sources = [
"common/web_component.cc",
"common/web_component.h",
"common/web_content_runner.cc",
"common/web_content_runner.h",
]
deps = [
"//base",
"//ui/gfx/geometry",
"//url",
]
public_deps = [
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.ui.app:fuchsia.ui.app_hlcpp",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.web:fuchsia.web_hlcpp",
"//third_party/fuchsia-sdk/sdk/pkg/sys_cpp",
]
}
source_set("cast_runner_core") {
sources = [
"cast/api_bindings_client.cc",
"cast/api_bindings_client.h",
"cast/application_controller_impl.cc",
"cast/application_controller_impl.h",
"cast/cast_component.cc",
"cast/cast_component.h",
"cast/cast_resolver.cc",
"cast/cast_resolver.h",
"cast/cast_runner.cc",
"cast/cast_runner.h",
"cast/cast_runner_switches.cc",
"cast/cast_runner_switches.h",
"cast/cast_streaming.cc",
"cast/cast_streaming.h",
"cast/named_message_port_connector_fuchsia.cc",
"cast/named_message_port_connector_fuchsia.h",
"cast/pending_cast_component.cc",
"cast/pending_cast_component.h",
]
data = [ rebase_path(
"//components/cast/named_message_port_connector/named_message_port_connector.js") ]
deps = [
"//base",
"//components/cast/common:constants",
"//components/cast/message_port",
"//components/cast/named_message_port_connector:named_message_port_connector",
"//components/fuchsia_component_support",
"//components/fuchsia_component_support:dynamic_component_host",
"//fuchsia_web/cast_streaming",
"//fuchsia_web/webinstance_host",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.component:fuchsia.component_cpp",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_cpp",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_hlcpp",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.legacymetrics:fuchsia.legacymetrics_hlcpp",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.media.sessions2:fuchsia.media.sessions2_cpp_hlcpp_conversion",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.mem:fuchsia.mem_hlcpp",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.ui.app:fuchsia.ui.app_cpp_wire",
"//third_party/fuchsia-sdk/sdk/pkg/component_incoming_cpp",
"//third_party/fuchsia-sdk/sdk/pkg/sys_cpp",
"//third_party/fuchsia-sdk/sdk/pkg/trace",
"//url",
]
public_deps = [
":common",
"//fuchsia_web/runners/cast/fidl:fidl_cpp",
"//fuchsia_web/runners/cast/fidl:fidl_hlcpp",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.component.resolution:fuchsia.component.resolution_cpp",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.component.runner:fuchsia.component.runner_hlcpp",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.web:fuchsia.web_hlcpp",
]
visibility += [ "//fuchsia_web/runners/cast/test:*" ]
}
executable("cast_runner_exe") {
assert_no_deps = [
"//content/public/common",
"//media",
"//third_party/blink/common",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.modular:*",
]
sources = [ "cast/main.cc" ]
deps = [
":cast_runner_core",
":common",
"//base",
"//build:chromecast_buildflags",
"//components/fuchsia_component_support",
"//fuchsia_web/common",
"//fuchsia_web/webinstance_host",
"//third_party/fuchsia-sdk/sdk/pkg/inspect_component_cpp",
"//third_party/fuchsia-sdk/sdk/pkg/trace-engine",
"//third_party/fuchsia-sdk/sdk/pkg/trace-provider-so",
]
data_deps = [ ":cast_runner_core" ]
}
# web_instance_host's deps, especially //content/public/common, adds these.
# TODO(crbug.com/42050285): Moving flag parsing to web_instance should
# eliminate the dependencies that cause these files to be added. Remove them
# and add the targets that generate these to assert_no_deps in
# cast_runner_core.
_web_instance_host_deps_files_to_exclude = [
"lib/libEGL.so",
"lib/libGLESv2.so",
"lib/libvulkan.so",
# TODO(crbug.com/42050042): SwiftShader is not used in cast_runner.
# This list should match the list of SwiftShader files excluded from the
# web_engine package (see fuchsia_web/webengine/BUILD.gn).
"lib/libvk_swiftshader.so",
"vk_swiftshader_icd.json",
]
# This file is required for both component and coverage builds.
if (!is_component_build && !fuchsia_code_coverage) {
_web_instance_host_deps_files_to_exclude += [ "lib/libfuchsia_egl.so" ]
}
fuchsia_component("cast_runner_component") {
manifest = "cast/cast_runner.cml"
data_deps = [ ":cast_runner_exe" ]
}
fuchsia_package("cast_runner_pkg") {
package_name = "cast_runner"
deps = [ ":cast_runner_component" ]
excluded_files = _web_instance_host_deps_files_to_exclude
}
fuchsia_package_installer("cast_runner") {
visibility += [ "//fuchsia_web:gn_all" ]
package = ":cast_runner_pkg"
package_name = "cast_runner"
package_deps = [ [
"//fuchsia_web/webengine:web_engine",
"web_engine",
] ]
}
test("cast_runner_unittests") {
sources = [ "cast/application_controller_impl_unittest.cc" ]
deps = [
":cast_runner_core",
"//base",
"//base/test:run_all_unittests",
"//base/test:test_support",
"//fuchsia_web/common/test:test_support",
"//fuchsia_web/runners/cast/fidl:fidl_cpp",
"//fuchsia_web/runners/cast/fidl:fidl_cpp_testing",
"//fuchsia_web/runners/cast/test:test_support",
"//net:test_support",
"//testing/gmock",
"//testing/gtest",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.web:fuchsia.web_hlcpp",
]
data_deps = [ ":cast_runner_core" ]
}
test("cast_runner_integration_tests") {
sources = [ "cast/cast_runner_integration_test.cc" ]
data = [ "cast/testdata" ]
deps = [
":cast_runner_core",
"//base/test:test_support",
"//build:chromecast_buildflags",
"//components/cast/message_port",
"//components/fuchsia_component_support:dynamic_component_host",
"//fuchsia_web/common",
"//fuchsia_web/common/test:run_all_integration_tests",
"//fuchsia_web/common/test:test_support",
"//fuchsia_web/runners/cast/test:integration",
"//fuchsia_web/runners/cast/test:test_support",
"//net:test_support",
"//testing/gtest",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.camera3:fuchsia.camera3_hlcpp",
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.legacymetrics:fuchsia.legacymetrics_hlcpp",
"//third_party/fuchsia-sdk/sdk/pkg/sys_cpp",
]
# Include cast_runner.cm as a component in the test's package.
fuchsia_package_deps = [ ":cast_runner_component" ]
# Deploy the web_engine packages
package_deps = [ [
"//fuchsia_web/webengine:web_engine",
"web_engine",
] ]
additional_manifest_fragments = [
"//build/config/fuchsia/test/fonts.shard.test-cml",
"//build/config/fuchsia/test/network.shard.test-cml",
"//fuchsia_web/runners/cast/cast_runner_integration_test.shard.test-cml",
"//third_party/fuchsia-sdk/sdk/pkg/sys/component/realm_builder_absolute.shard.cml",
"//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml",
]
}
test("cast_runner_browsertests") {
sources = [
"cast/api_bindings_client_browsertest.cc",
"cast/named_message_port_connector_fuchsia_browsertest.cc",
]
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
data = [ "cast/testdata" ]
deps = [
":cast_runner_core",
"//base/test:test_support",
"//components/cast/message_port",
"//components/cast/message_port:test_message_port_receiver",
"//content/public/browser",
"//content/test:test_support",
"//fuchsia_web/common/test:test_support",
"//fuchsia_web/runners/cast/test:test_support",
"//fuchsia_web/webengine:browsertest_core",
"//testing/gmock",
"//testing/gtest",
"//ui/ozone",
]
additional_manifest_fragments = [
"//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
"//build/config/fuchsia/test/network.shard.test-cml",
"//build/config/fuchsia/test/test_ui_stack.shard.test-cml",
"//third_party/fuchsia-sdk/sdk/pkg/vulkan/client.shard.cml",
]
}