blob: 306af8afe7abff7b5dd23bd40705e8f46f8b537f [file] [log] [blame]
prashantv4025129e2015-04-21 21:54:221# Copyright 2015 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
slanca520532015-11-05 20:35:335import("//build/config/features.gni")
6import("//build/config/locales.gni")
7import("//build/config/ui.gni")
slan87db9d12015-10-05 20:37:388import("//chromecast/build/tests/cast_test.gni")
prashantv4025129e2015-04-21 21:54:229import("//chromecast/chromecast.gni")
slan0c9838b2015-08-05 18:37:4010import("//tools/grit/repack.gni")
11import("//ui/ozone/ozone.gni")
prashantv4025129e2015-04-21 21:54:2212
slan9ccf3592015-09-10 19:40:3313declare_args() {
14 # TODO(slan): This most likely needs to be moved into a .gni file.
15 use_chromecast_webui = true
16}
17
slan9b6abb2a2015-09-04 18:45:2418# TODO(slan): This target is being used far too broadly. We should reduce the
19# uses of this config to targets that actually need it. (b/23814594)
prashantv4025129e2015-04-21 21:54:2220config("config") {
21 defines = []
22
23 if (use_playready) {
24 defines += [ "PLAYREADY_CDM_AVAILABLE" ]
25 }
26}
27
28component("chromecast") {
29 deps = [
30 "//chromecast/base",
31 "//chromecast/base/metrics",
slanf48fe872015-06-23 19:41:5232 "//chromecast/crash",
prashantv4025129e2015-04-21 21:54:2233 "//chromecast/media",
34 ]
35}
slanf48fe872015-06-23 19:41:5236
slan87db9d12015-10-05 20:37:3837# A list of all public test() binaries. This is an organizational target that
38# cannot be depended upon or built directly. Build cast_group_test_list instead.
39cast_test_group("cast_tests") {
40 tests = [
41 "//base:base_unittests",
slanf48fe872015-06-23 19:41:5242 "//chromecast/base:cast_base_unittests",
gunsch5ed6d7d2015-08-31 22:56:1943 "//chromecast/crypto:cast_crypto_unittests",
slanf48fe872015-06-23 19:41:5244 "//chromecast/crash:cast_crash_unittests",
slan87db9d12015-10-05 20:37:3845 "//content/test:content_unittests",
46 "//crypto:crypto_unittests",
47 "//ipc:ipc_tests",
48 "//jingle:jingle_unittests",
49 "//media:media_unittests",
50 "//media/midi:midi_unittests",
51 "//net:net_unittests",
52 "//ppapi:ppapi_unittests",
53 "//sandbox/linux:sandbox_linux_unittests",
54 "//sql:sql_unittests",
55 "//sync:sync_unit_tests",
56 "//third_party/cacheinvalidation:cacheinvalidation_unittests",
57 "//ui/base:ui_base_unittests",
58 "//url:url_unittests",
slanf48fe872015-06-23 19:41:5259 ]
slan87db9d12015-10-05 20:37:3860
61 filters = []
62
63 if (target_cpu == "arm" && target_os == "linux") {
64 filters += [
65 # Run net_unittests first to avoid random failures due to slow python startup
66 # KeygenHandlerTest.SmokeTest and KeygenHandlerTest.ConcurrencyTest fail due to
67 # readonly certdb (b/8153161)
68 # URLRequestTestHTTP.GetTest_ManyCookies takes roughly 55s to run. Increase
69 # timeout to 90s from 45s to allow it to pass (b/19821476)
70 # ProxyScriptFetcherImplTest.HttpMimeType is flaking (b/19848784)
71 # Running a batch of net_unittests has high overhead. Run tests in batches of 25 to reduce number of batches (b/23156294).
72 "net_unittests --gtest_filter=-KeygenHandlerTest.SmokeTest:KeygenHandlerTest.ConcurrencyTest:ProxyScriptFetcherImplTest.HttpMimeType --test-launcher-timeout=90000 --test-launcher-batch-limit=25",
73
74 # Disable ProcessMetricsTest.GetNumberOfThreads (b/15610509)
75 # Disable ProcessUtilTest.* (need to define OS_ANDROID)
76 # Disable StackContainer.BufferAlignment (don't support 16-byte alignment)
77 # Disable SystemMetrics2Test.GetSystemMemoryInfo (buffers>0 can't be guaranteed)
78 "base_unittests --gtest_filter=-ProcessMetricsTest.GetNumberOfThreads:ProcessUtilTest.*:StackContainer.BufferAlignment:SystemMetrics2Test.GetSystemMemoryInfo",
79
80 # DesktopCaptureDeviceTest.*: No capture device on Eureka
81 # Disable PepperGamepadHostTest.WaitForReply (pepper not supported on Eureka)
82 # Disable GpuDataManagerImplPrivateTest.SetGLStrings and
83 # RenderWidgetHostTest.Background because we disable the blacklist to enable WebGL (b/16142554)
84 "content_unittests --gtest_filter=-DOMStorageDatabaseTest.TestCanOpenAndReadWebCoreDatabase:DesktopCaptureDeviceTest.Capture:GamepadProviderTest.PollingAccess:GpuDataManagerImplPrivateTest.SetGLStrings:PepperGamepadHostTest.WaitForReply:RenderWidgetHostTest.Background",
85
86 # Disable VP9 related tests (b/18593324)
87 # PipelineIntegrationTest.BasicPlayback_MediaSource_VP9_WebM
88 # PipelineIntegrationTest.BasicPlayback_VideoOnly_VP9_WebM
89 # PipelineIntegrationTest.BasicPlayback_VP9*
90 # PipelineIntegrationTest.P444_VP9_WebM
91 # Disable VP8A tests (b/18593324)
92 # PipelineIntegrationTest.BasicPlayback_VP8A*
93 # Disable OpusAudioDecoderTest/AudioDecoderTest.ProduceAudioSamples/0 (unit
94 # test fails when Opus decoder uses fixed-point)
95 # Due to b/16456550, disable the following four test cases:
96 # AudioOutputControllerTest.PlayDivertSwitchDeviceRevertClose
97 # AudioOutputControllerTest.PlaySwitchDeviceClose
98 # AudioStreamHandlerTest.Play
99 # SoundsManagerTest.Play
100 # Disable AudioStreamHandlerTest.ConsecutivePlayRequests (b/16539293)
101 "media_unittests --gtest_filter=-AudioOutputControllerTest.PlayDivertSwitchDeviceRevertClose:AudioOutputControllerTest.PlaySwitchDeviceClose:AudioStreamHandlerTest.Play:AudioStreamHandlerTest.ConsecutivePlayRequests:PipelineIntegrationTest.BasicPlayback_MediaSource_VP9_WebM:PipelineIntegrationTest.BasicPlayback_VideoOnly_VP9_WebM:PipelineIntegrationTest.BasicPlayback_VP9*:PipelineIntegrationTest.P444_VP9_WebM:PipelineIntegrationTest.BasicPlayback_VP8A*:OpusAudioDecoderTest/AudioDecoderTest.ProduceAudioSamples/0:SoundsManagerTest.Play",
102 "sync_unit_tests --gtest_filter=-SyncHttpBridgeTest.*",
103
104 # DoAppendUTF8Invalid fails because of dcheck_always_on flag in Eng builds
105 "url_unittests --gtest_filter=-URLCanonTest.DoAppendUTF8Invalid",
106 ]
107 } else if (target_cpu != "arm" || target_os == "android") {
108 filters += [
109 # Disable PipelineIntegrationTest.BasicPlayback_MediaSource_VP9_WebM (not supported)
110 "media_unittests --gtest_filter=-PipelineIntegrationTest.BasicPlayback_MediaSource_VP9_WebM",
111 ]
112 }
113
114 if (!is_android) {
115 tests += [
116 "//chromecast/app:cast_shell_unittests",
117 "//chromecast/browser:cast_shell_browser_test",
118 "//chromecast/media:cast_media_unittests",
119 ]
120
121 filters += [ "cast_shell_browser_test --no-sandbox --disable-gpu" ]
122 }
123
124 if (!disable_display) {
125 tests += [ "//gpu:gpu_unittests" ]
126 } else {
127 filters += [
128 # These are not supported by the backend right now. b/21737919
129 "cast_media_unittests --gtest_filter=-AudioVideoPipelineDeviceTest.VorbisPlayback:AudioVideoPipelineDeviceTest.WebmPlayback",
130 ]
131 }
132}
133
134# Creates the build and run lists for all test targets.
135cast_test_group_list("cast_test_lists") {
136 build_list_path = "$root_out_dir/tests/build_test_list.txt"
137
138 run_list_path = "$root_out_dir/tests/run_test_list.txt"
139
140 additional_options = [ "--ozone-platform=test" ]
141
142 build_tests = true
143
144 test_groups = [ ":cast_tests" ]
145
146 if (chromecast_branding != "public") {
147 test_groups += [ "//chromecast/internal:internal_cast_tests" ]
148 }
slanf48fe872015-06-23 19:41:52149}
slan0c9838b2015-08-05 18:37:40150
151source_set("cast_shell_common") {
152 deps = [
slan0c9838b2015-08-05 18:37:40153 ":cast_shell_pak",
slanca520532015-11-05 20:35:33154 ":chromecast_locales_pak",
slan0c9838b2015-08-05 18:37:40155 "//chromecast/app",
156 "//chromecast/browser",
157 "//chromecast/common",
158 "//chromecast/common/media",
159 "//chromecast/renderer",
160 ]
161}
162
163source_set("cast_shell_media") {
164 deps = [
165 "//chromecast/browser/media",
166 "//chromecast/common/media",
167 "//chromecast/renderer/media",
168 ]
169}
170
171executable("cast_shell") {
172 sources = [
173 "app/cast_main.cc",
174 ]
175
176 deps = [
177 ":cast_shell_common",
178 ":cast_shell_media",
brettwba7a73d2015-08-31 22:17:39179 "//build/config/sanitizers:deps",
slan0c9838b2015-08-05 18:37:40180 "//chromecast/app",
181 "//content/public/app:both",
182 ]
183
slan9ccf3592015-09-10 19:40:33184 if (chromecast_branding != "public") {
185 deps += [ "//chromecast/internal:cast_shell_internal" ]
186 }
187
slan0c9838b2015-08-05 18:37:40188 if (ozone_platform_egltest) {
189 deps += [ "//ui/ozone/platform/egltest:eglplatform_shim_x11" ]
190 }
191}
192
193repack("cast_shell_pak") {
194 sources = [
195 "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak",
196 "$root_gen_dir/blink/public/resources/blink_resources.pak",
197 "$root_gen_dir/chromecast/app/shell_resources.pak",
198 "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
199 "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
200 "$root_gen_dir/content/content_resources.pak",
201 "$root_gen_dir/net/net_resources.pak",
202 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
203 "$root_gen_dir/ui/resources/webui_resources.pak",
204 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
205 "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
206 ]
207
slan0c9838b2015-08-05 18:37:40208 output = "$root_out_dir/assets/cast_shell.pak"
209
210 deps = [
211 "//chromecast/app:resources",
212 "//content:resources",
213 "//content/app/resources",
214 "//content/app/strings",
215 "//net:net_resources",
216 "//third_party/WebKit/public:resources",
217 "//third_party/WebKit/public:image_resources_grit",
218 "//ui/resources",
219 "//ui/strings",
220 ]
221
slan9ccf3592015-09-10 19:40:33222 if (chromecast_branding != "public") {
223 sources +=
224 [ "$root_gen_dir/chromecast/internal/shell/app/sound_resources.pak" ]
225
226 deps += [ "//chromecast/internal/shell/app:chromecast_sound_resources" ]
227
228 if (use_chromecast_webui) {
229 sources += [
230 "$root_gen_dir/chromecast/internal/webui/app_resources.pak",
231 "$root_gen_dir/chromecast/internal/webui/cast_webui_resources.pak",
232 ]
233
234 deps += [
235 "//chromecast/internal/webui:chromecast_app_resources",
236 "//chromecast/internal/webui:chromecast_webui_resources",
237 ]
238 }
slan0c9838b2015-08-05 18:37:40239 }
240}
slanca520532015-11-05 20:35:33241
242# GYP target: chromecast_locales.gyp:chromecast_locales_pak
243action("chromecast_locales_pak") {
244 script = "//chromecast/tools/build/chromecast_repack_locales.py"
245
246 # .pak resources in |grit_out_dir| with the same suffix are packed into a
247 # single resource and placed in |locales_dir|. The original .pak resources
248 # are generated by this target's dependencies.
249 grit_out_dir = "$root_gen_dir/chromecast_strings"
250 locales_dir = "$root_out_dir/chromecast_locales"
251
252 sources = []
253 outputs = []
254
255 # |locales| is an array of suffixes declared in //build/config/locals.gni.
256 foreach(locale, locales) {
257 sources += [ "$grit_out_dir/chromecast_settings_$locale.pak" ]
258 outputs += [ "$locales_dir/$locale.pak" ]
259 }
260 deps = [
261 "//chromecast/app:chromecast_settings",
262 ]
263
264 # Include string resources for internal builds.
265 if (chromecast_branding != "public") {
266 foreach(locale, locales) {
267 sources += [ "$grit_out_dir/app_strings_$locale.pak" ]
268 }
269 deps += [ "//chromecast/internal/webui:chromecast_app_strings" ]
270 }
271
272 # This script only accepts the following values for branding:
273 assert(chromecast_branding == "public" || chromecast_branding == "internal" ||
274 chromecast_branding == "google")
275 args = [
276 "-b",
277 "$chromecast_branding",
278 "-g",
279 rebase_path("$root_gen_dir/chromecast_strings"),
280 "-x",
281 rebase_path("$root_out_dir/chromecast_locales"),
282 ] + locales
283}