[M120 Migration][VD] Enable direct rendering for TVPlus
[platform/framework/web/chromium-efl.git] / fuchsia_web / shell / BUILD.gn
1 # Copyright 2022 The Chromium Authors
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 assert(is_fuchsia)
6
7 import("//build/config/fuchsia/generate_runner_scripts.gni")
8 import("//third_party/fuchsia-gn-sdk/src/component.gni")
9 import("//third_party/fuchsia-gn-sdk/src/package.gni")
10
11 # Nothing else should depend on these targets except the final component.
12 visibility = [ ":*" ]
13
14 group("shell") {
15   testonly = true
16   visibility += [
17     "//chrome/test:*",
18     "//content/test:*",
19     "//fuchsia_web:gn_all",
20   ]
21   deps = [ ":web_engine_shell" ]
22
23   if (enable_cast_receiver) {
24     deps += [ ":cast_streaming_shell" ]
25   }
26 }
27
28 source_set("remote_debugging_port") {
29   sources = [
30     "remote_debugging_port.cc",
31     "remote_debugging_port.h",
32   ]
33   deps = [ "//base" ]
34 }
35
36 source_set("present_frame") {
37   testonly = true
38   sources = [
39     "present_frame.cc",
40     "present_frame.h",
41   ]
42   deps = [ "//base" ]
43   public_deps = [
44     "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.element",
45     "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.web",
46   ]
47 }
48
49 fuchsia_component("web_engine_shell_component") {
50   testonly = true
51   manifest = "web_engine_shell.cml"
52   data_deps = [ ":web_engine_shell_exec" ]
53 }
54
55 # WebInstanceHost needs to serve capabilities to web_instance. Since the
56 # primary web_engine_shell component is a test component, it is not able to do
57 # this directly. Instead, it launches this here component to start instances via
58 # WebInstanceHost.
59 fuchsia_component("web_engine_shell_for_web_instance_host_component") {
60   testonly = true
61   manifest = "web_engine_shell_for_web_instance_host.cml"
62   data_deps = [ ":web_engine_shell_exec" ]
63 }
64
65 fuchsia_package("web_engine_shell_pkg") {
66   testonly = true
67
68   # TODO(fxbug.dev/100944): Add appropriate visibility when fixed.
69   package_name = "web_engine_shell"
70   deps = [
71     ":web_engine_shell_component",
72     ":web_engine_shell_for_web_instance_host_component",
73   ]
74 }
75
76 fuchsia_package_installer("web_engine_shell") {
77   testonly = true
78   package = ":web_engine_shell_pkg"
79   package_name = "web_engine_shell"
80   package_deps = [
81     [
82       "//fuchsia_web/webengine:web_engine",
83       "web_engine",
84     ],
85     [
86       "//fuchsia_web/webengine:web_engine_with_webui",
87       "web_engine_with_webui",
88     ],
89   ]
90 }
91
92 executable("web_engine_shell_exec") {
93   testonly = true
94   sources = [ "web_engine_shell.cc" ]
95
96   data = [ "data" ]
97
98   deps = [
99     ":present_frame",
100     ":remote_debugging_port",
101     ":shell_relauncher",
102     "//base",
103     "//components/fuchsia_component_support:annotations_manager",
104     "//fuchsia_web/common",
105     "//fuchsia_web/webinstance_host:webinstance_host",
106     "//third_party/fuchsia-sdk/sdk/pkg/fdio",
107     "//third_party/fuchsia-sdk/sdk/pkg/fidl_cpp",
108     "//third_party/fuchsia-sdk/sdk/pkg/sys_cpp",
109     "//third_party/widevine/cdm:buildflags",
110     "//url",
111   ]
112 }
113
114 source_set("shell_relauncher") {
115   testonly = true
116   public = [ "shell_relauncher.h" ]
117   sources = [ "shell_relauncher.cc" ]
118   public_deps = [
119     "//base",
120     "//third_party/abseil-cpp:absl",
121   ]
122   deps = [
123     "//fuchsia_web/common/test:test_support",
124     "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.component:fuchsia.component_hlcpp",
125     "//third_party/fuchsia-sdk/sdk/pkg/sys_component_cpp_testing",
126   ]
127 }
128
129 if (enable_cast_receiver) {
130   fuchsia_component("cast_streaming_shell_component") {
131     testonly = true
132     manifest = "cast_streaming_shell.cml"
133     data_deps = [ ":cast_streaming_shell_exe" ]
134   }
135
136   # WebInstanceHost needs to serve capabilities to child components, which is
137   # not possible when running inside a test component, such as
138   # cast_streaming_shell. The shell therefore uses an intermediate component to
139   # actually run the WebInstanceHost, from which the capabilities can be served.
140   fuchsia_component("cast_streaming_shell_for_web_instance_host_component") {
141     testonly = true
142     manifest = "cast_streaming_shell_for_web_instance_host.cml"
143     data_deps = [ ":cast_streaming_shell_exe" ]
144   }
145
146   fuchsia_package("cast_streaming_shell_pkg") {
147     testonly = true
148     package_name = "cast_streaming_shell"
149     deps = [
150       ":cast_streaming_shell_component",
151       ":cast_streaming_shell_for_web_instance_host_component",
152     ]
153   }
154
155   fuchsia_package_installer("cast_streaming_shell") {
156     testonly = true
157     package = ":cast_streaming_shell_pkg"
158     package_name = "cast_streaming_shell"
159     package_deps = [ [
160           "//fuchsia_web/webengine:web_engine",
161           "web_engine",
162         ] ]
163   }
164
165   executable("cast_streaming_shell_exe") {
166     testonly = true
167     sources = [ "cast_streaming_shell.cc" ]
168
169     data = [
170       "cast_streaming_shell_data",
171       rebase_path("//media/test/data/bear-1280x720.ivf"),
172     ]
173
174     deps = [
175       ":present_frame",
176       ":remote_debugging_port",
177       ":shell_relauncher",
178       "//base",
179       "//base/test:test_support",
180       "//components/cast/message_port:message_port",
181       "//components/cast_streaming/test:test_sender_using_net_sockets",
182       "//components/fuchsia_component_support:annotations_manager",
183       "//fuchsia_web/cast_streaming",
184       "//fuchsia_web/common",
185       "//fuchsia_web/common/test:test_support",
186       "//fuchsia_web/webengine:switches",
187       "//fuchsia_web/webinstance_host:webinstance_host",
188       "//media",
189       "//media/gpu/test:test_helpers",
190       "//third_party/fuchsia-sdk/sdk/pkg/fdio",
191       "//third_party/fuchsia-sdk/sdk/pkg/sys_cpp",
192       "//url",
193     ]
194   }
195 }