blob: 873fa4630cd5408e0945e271b46e2bc057fdaa64 [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
Yipeng Wang158dbc5c2017-06-30 18:16:415import("//base/android/jni_generator/jni_exception_list.gni")
slan7d09f9e2016-04-08 15:47:026import("//build/buildflag_header.gni")
slanca520532015-11-05 20:35:337import("//build/config/features.gni")
mbjorge47b1c9b2016-09-20 22:23:038import("//build/config/sanitizers/sanitizers.gni")
slanca520532015-11-05 20:35:339import("//build/config/ui.gni")
slan87db9d12015-10-05 20:37:3810import("//chromecast/build/tests/cast_test.gni")
prashantv4025129e2015-04-21 21:54:2211import("//chromecast/chromecast.gni")
slan25bb71f22016-01-06 21:23:5512import("//media/media_options.gni")
slan0c9838b2015-08-05 18:37:4013import("//tools/grit/repack.gni")
14import("//ui/ozone/ozone.gni")
machenbachd65ec5c2016-07-22 09:05:2315import("//v8/gni/v8.gni")
prashantv4025129e2015-04-21 21:54:2216
slan074ec342016-01-29 23:52:2617if (is_android) {
18 import("//build/config/android/rules.gni")
19}
20
Gaofeng Huangeacee032018-04-30 22:42:5521declare_args() {
22 cast_test_extra_flags = ""
23}
24
halliwell5240d4d2016-04-22 14:34:3225config("playready_config") {
26 if (use_playready) {
slan62afce42015-11-13 22:53:5827 defines = [ "PLAYREADY_CDM_AVAILABLE" ]
prashantv4025129e2015-04-21 21:54:2228 }
29}
30
Simeon Anfinrud0b91fe02017-10-25 20:32:1631# Depends on all non-test targets that should be built by the Chromecast
32# internal build infrastructure.
33group("all") {
34 deps = []
35 if (is_android && chromecast_branding == "public") {
36 deps += [ ":cast_shell_apk" ]
37 }
38 if (!is_android) {
39 deps += [ ":cast_shell" ]
40 }
Michael Spang0436dc82017-12-01 20:25:2741 if (is_linux) {
42 deps += [ "//chromecast/tracing" ]
43 }
Simeon Anfinrud0b91fe02017-10-25 20:32:1644 if (chromecast_branding != "public") {
45 deps += [ "//chromecast/internal:all" ]
46 }
Scott Graham4c1ec8b2017-10-27 21:03:2747
Simeon Anfinrud0b91fe02017-10-25 20:32:1648 # No other targets should depend on this target, since it's just a convenience
49 # target for the Chromecast internal build infrastructure.
50 visibility = []
51 testonly = true
52}
53
Bailey Forrest635cecc2017-11-01 01:09:4054# This is a config which is applied on all cast_* targets (which should be all
55# code under chromecast/).
56config("cast_config") {
57}
58
slan87db9d12015-10-05 20:37:3859# A list of all public test() binaries. This is an organizational target that
Scott Graham4c1ec8b2017-10-27 21:03:2760# cannot be depended upon or built directly. Build cast_test_lists instead.
slan87db9d12015-10-05 20:37:3861cast_test_group("cast_tests") {
mbjorgeb64c791f2016-09-20 18:04:5662 filters = []
slan87db9d12015-10-05 20:37:3863 tests = [
64 "//base:base_unittests",
Sandeep Vijayasekarfc173f1d2017-07-14 23:13:2765 "//cc:cc_unittests",
slanf48fe872015-06-23 19:41:5266 "//chromecast/base:cast_base_unittests",
kmackayfa656b092016-02-04 23:23:5467 "//chromecast/base/component:cast_component_unittests",
gunsch5ed6d7d2015-08-31 22:56:1968 "//chromecast/crypto:cast_crypto_unittests",
Bailey Forrest070f5a1e2018-03-28 18:17:1469 "//chromecast/device/bluetooth:cast_bluetooth_unittests",
sanfin2de00582017-02-09 19:24:4070 "//chromecast/media:cast_media_unittests",
jameswesta2bc3db52017-05-18 00:49:1771 "//chromecast/net:cast_net_unittests",
mbjorgec83cce952016-07-27 02:40:3172 "//chromecast/system/reboot:cast_reboot_unittests",
slan87db9d12015-10-05 20:37:3873 "//content/test:content_unittests",
74 "//crypto:crypto_unittests",
slan87db9d12015-10-05 20:37:3875 "//media:media_unittests",
76 "//media/midi:midi_unittests",
77 "//net:net_unittests",
slan87db9d12015-10-05 20:37:3878 "//sql:sql_unittests",
pwnall9f1622a2017-04-21 09:39:0279 "//storage:storage_unittests",
slan87db9d12015-10-05 20:37:3880 "//third_party/cacheinvalidation:cacheinvalidation_unittests",
81 "//ui/base:ui_base_unittests",
slanf48fe872015-06-23 19:41:5282 ]
slan87db9d12015-10-05 20:37:3883
mbjorgeb64c791f2016-09-20 18:04:5684 if (!is_cast_audio_only) {
85 tests += [ "//gpu:gpu_unittests" ]
jlevasseurff442c02017-01-30 17:19:4086
87 if (use_aura) {
88 tests += [ "//chromecast/graphics:cast_graphics_unittests" ]
89 }
mbjorgeb64c791f2016-09-20 18:04:5690 }
91
sanfin09990de2015-11-16 19:08:1992 if (is_linux) {
Scott Graham4c1ec8b2017-10-27 21:03:2793 tests += [
94 "//chromecast/crash:cast_crash_unittests",
95 "//sandbox/linux:sandbox_linux_unittests",
96 ]
sanfin09990de2015-11-16 19:08:1997 }
98
Mina Almasrye19ad362018-06-27 19:41:3299 if (is_linux || is_fuchsia) {
Mina Almasry5b72921d2018-04-13 17:42:24100 tests += [
101 "//chromecast/media/cma/backend:cast_audio_backend_unittests",
102 "//chromecast/media/cma/backend:cast_av_sync_backend_unittests",
103 ]
Sergey Ulanov25c98d922017-10-24 23:16:25104 }
Sergey Ulanov026a20a2017-10-18 22:23:31105
mbjorgeb64c791f2016-09-20 18:04:56106 if (!is_android) {
107 tests += [
alokpe3bd5ed2016-11-16 15:57:10108 ":cast_shell_browsertests",
109 ":cast_shell_unittests",
mbjorgeb64c791f2016-09-20 18:04:56110 "//ipc:ipc_tests",
mbjorgeb64c791f2016-09-20 18:04:56111 "//url:url_unittests",
112 ]
slan87db9d12015-10-05 20:37:38113
Scott Graham4c1ec8b2017-10-27 21:03:27114 if (!is_fuchsia) {
115 tests += [ "//jingle:jingle_unittests" ]
116 }
117
mbjorgeb64c791f2016-09-20 18:04:56118 cast_media_unittests_filter = {
119 test_name = "cast_media_unittests"
120
121 # --test-launcher-jobs=1 => so internal code can bind to port
122 args = [ "--test-launcher-jobs=1" ]
123 }
124 filters += [ cast_media_unittests_filter ]
125
alokpe3bd5ed2016-11-16 15:57:10126 cast_shell_browsertests_filter = {
127 test_name = "cast_shell_browsertests"
mbjorgeb64c791f2016-09-20 18:04:56128
129 # --enable-local-file-accesses => to load sample media files
130 # --test-launcher-jobs=1 => so internal code can bind to port
131 args = [
132 "--no-sandbox",
133 "--enable-local-file-accesses",
mbjorgeb64c791f2016-09-20 18:04:56134 "--test-launcher-jobs=1",
135 ]
136 if (!is_cast_desktop_build) {
137 args += [ "--use-gpu-in-tests" ]
mbjorgee37679292016-12-13 23:53:06138
139 # TODO(derekjchow): Make these tests pass on Chromecast devices.
140 # Once all of the CastMediaBlockerTest.* have been un-DISABLEd and
141 # are running successfully, revisit these tests and see if they pass
142 # on devices. (crbug/665118, internal b/32023194)
143 gtest_excludes = [
144 "CastMediaBlockerBrowserTest.Video_BlockUnblock",
145 "CastMediaBlockerBrowserTest.Audio_BlockUnblock",
146 ]
mbjorgedea0ad02017-03-16 23:29:36147
148 # TODO(mbjorge): The ReusedRenderer test is failing on v1 and cast audio
149 # devices. Temporarily disable them as part of an effort_to re-green
150 # the unittests. Current failures (2017-03-15) are being disabled to get
151 # back to a green state. Re-enable once the tests have been fixed.
152 # Limitations in the build mean this unfortunately is getting disabled
153 # across all devices, even though it is only failing on some.
154 # b/36238710, b/36239051, hotlist/461351
155 gtest_excludes += [ "RendererPrelauncherTest.ReusedRenderer" ]
mbjorgeb64c791f2016-09-20 18:04:56156 }
mbjorge61cec502017-03-16 00:28:31157
mbjorge546e184b2017-04-13 20:08:05158 if (!is_cast_desktop_build && !is_cast_audio_only && !enable_assistant) {
159 # TODO(mbjorge): The VideoPlaybackMp4 test is failing on v1 devices.
160 # Temporarily disable it as part of an effort to re-green the unittests.
161 # Re-enable once the tests have been fixed. Limitations in the filter
162 # system mean this is getting temporarily disabled on all video devices,
163 # though it is only failing on v1.
164 # b/36723698, hotlist/461351
165 gtest_excludes += [ "CastNavigationBrowserTest.VideoPlaybackMp4" ]
166 }
167
mbjorge61cec502017-03-16 00:28:31168 # TODO(mbjorge): Temporarily disable AudioPlaybackWavPcm because it is
169 # failing on device. As part of an effort to re-green the unittests,
170 # current (2017-03-15) failures are being disabled to get back to a
171 # green state. Re-enable once the tests have been fixed.
172 # b/36239152, hotlist/461351
173 if (enable_assistant && !is_cast_desktop_build) {
174 gtest_excludes += [ "CastNavigationBrowserTest.AudioPlaybackWavPcm" ]
175 }
mbjorgeb64c791f2016-09-20 18:04:56176 }
alokpe3bd5ed2016-11-16 15:57:10177 filters += [ cast_shell_browsertests_filter ]
mbjorgeb64c791f2016-09-20 18:04:56178
179 ipc_tests_filter = {
180 test_name = "ipc_tests"
181
182 # --test-launcher-jobs=1 => so internal code can bind to port
183 args = [ "--test-launcher-jobs=1" ]
184 }
185 filters += [ ipc_tests_filter ]
186
187 url_unittests_filter = {
188 test_name = "url_unittests"
189
190 if (target_os == "linux" && !is_cast_desktop_build) {
191 # DoAppendUTF8Invalid fails because of dcheck_always_on flag in Eng builds
192 gtest_excludes = [ "URLCanonTest.DoAppendUTF8Invalid" ]
193 }
194 }
195 filters += [ url_unittests_filter ]
196 }
197
198 base_unittests_filter = {
199 test_name = "base_unittests"
Stephen Lanhamdcfc3cda2017-10-19 18:36:24200 gtest_excludes = []
201 if (target_os == "linux") {
202 if (is_cast_desktop_build) {
Ryan Harrison6141b622018-06-25 15:11:28203 # Disable PartitionAllocDeathTest.Repeated*ReturnNullDirect (b/67975693)
Stephen Lanhamf9bfcce2018-05-09 22:11:23204 gtest_excludes += [
Ryan Harrison6141b622018-06-25 15:11:28205 "PartitionAllocDeathTest.RepeatedAllocReturnNullDirect",
206 "PartitionAllocDeathTest.RepeatedReallocReturnNullDirect",
Stephen Lanhamf9bfcce2018-05-09 22:11:23207 ]
Stephen Lanhamdcfc3cda2017-10-19 18:36:24208 } else {
209 # Disable ProcessMetricsTest.GetNumberOfThreads (b/15610509)
210 # Disable ProcessUtilTest.* (need to define OS_ANDROID)
211 # Disable StackContainer.BufferAlignment (don't support 16-byte alignment)
212 # Disable SystemMetrics2Test.GetSystemMemoryInfo (buffers>0 can't be guaranteed)
Stephen Lanhamdcfc3cda2017-10-19 18:36:24213 # Disable PostTasksViaTaskRunner/* to green up devices (b/62246873)
214 # Disable WorkerDetaches to green up devices (b/62246873)
215 gtest_excludes += [
216 "ProcessMetricsTest.GetNumberOfThreads",
217 "ProcessUtilTest.*",
218 "StackContainer.BufferAlignment",
219 "SystemMetrics2Test.GetSystemMemoryInfo",
Stephen Lanhamdcfc3cda2017-10-19 18:36:24220 "OneTraitsExecutionModePair/TaskSchedulerImplTest.PostTasksViaTaskRunner/*",
221 "TaskSchedulerWorkerTest.WorkerDetaches",
222 ]
223 }
mbjorgeb64c791f2016-09-20 18:04:56224
225 if (is_cast_audio_only) {
226 # Also disable TimeFormattingTest on audio-only builds, since we don't
227 # include the necessary info in icudtl.dat.
228 gtest_excludes += [ "TimeFormattingTest.*" ]
229 }
230 }
231 }
232 filters += [ base_unittests_filter ]
233
Sandeep Vijayasekar7ae90b182017-08-05 01:22:06234 cc_unittests_filter = {
235 test_name = "cc_unittests"
236 if (!is_cast_desktop_build) {
237 #Disable ToColorSpace/ColorTransformPixelTest* (b/64346790)
238 #Disable ImageBackgroundFilter* (b/64346875)
Luke Halliwell4780f1d2017-09-22 03:37:14239 #Disable LayerTreeHostTilesTestPartialInvalidation* (b/65844132)
Sandeep Vijayasekar7ae90b182017-08-05 01:22:06240 gtest_excludes = [
241 "ToColorSpace/ColorTransformPixelTest.*",
242 "ImageBackgroundFilter.*",
Luke Halliwell4780f1d2017-09-22 03:37:14243 "LayerTreeHostTilesTestPartialInvalidation.*",
Sandeep Vijayasekar7ae90b182017-08-05 01:22:06244 ]
245 }
246 }
247 filters += [ cc_unittests_filter ]
248
mbjorgeb64c791f2016-09-20 18:04:56249 content_unittests_filter = {
250 test_name = "content_unittests"
mbjorge9a7b1892017-04-06 01:55:46251
252 # IsSupportedVideoConfig_VP9TransferFunctions fails on all cast builds since
253 # the cast IsSupporedVideoConfigs ignore the transfer function parameter.
254 # (b/36984215).
255 gtest_excludes = [ "*.IsSupportedVideoConfig_VP9TransferFunctions" ]
mbjorgeb64c791f2016-09-20 18:04:56256 if (target_os == "linux" && !is_cast_desktop_build) {
slan87db9d12015-10-05 20:37:38257 # DesktopCaptureDeviceTest.*: No capture device on Eureka
258 # Disable PepperGamepadHostTest.WaitForReply (pepper not supported on Eureka)
Zhenyao Moc76e9032018-01-19 21:15:46259 # Disable RenderWidgetHostTest.Background because we disable the
260 # blacklist to enable WebGL (b/16142554)
bshaya27e79282016-12-09 23:41:16261 gtest_excludes += [
mbjorgeb64c791f2016-09-20 18:04:56262 "DOMStorageDatabaseTest.TestCanOpenAndReadWebCoreDatabase",
263 "DesktopCaptureDeviceTest.Capture",
264 "GamepadProviderTest.PollingAccess",
mbjorgeb64c791f2016-09-20 18:04:56265 "PepperGamepadHostTest.WaitForReply",
266 "RenderWidgetHostTest.Background",
267 ]
268 }
bshaya27e79282016-12-09 23:41:16269 if (is_cast_audio_only) {
270 # No way to display URL's on audio only cast devices.
271 gtest_excludes += [ "NavigationEntryTest.NavigationEntryURLs" ]
272 }
Mike Bjorge2686bd4a2017-06-15 21:14:00273 if (enable_assistant && !is_cast_desktop_build) {
274 # Temporarily disable InvalidUUID and DefaultConstructor on assistant
275 # device builds. Cause of failure is unclear, but it's highly likely it's
276 # related to them being DEATH tests. These were passing until the
277 # is_official_build flag was enabled. These tests are considered
278 # non-critical in this context. (b/62469368)
279 gtest_excludes += [
280 "BluetoothBlocklistTest.InvalidUUID",
281 "WebBluetoothDeviceIdTest.DefaultConstructor",
282 ]
283 }
mbjorgeb64c791f2016-09-20 18:04:56284 }
285 filters += [ content_unittests_filter ]
slan87db9d12015-10-05 20:37:38286
mbjorgeb64c791f2016-09-20 18:04:56287 media_unittests_filter = {
288 test_name = "media_unittests"
289 if (target_os == "linux" && !is_cast_desktop_build) {
slan87db9d12015-10-05 20:37:38290 # Disable VP9 related tests (b/18593324)
291 # PipelineIntegrationTest.BasicPlayback_MediaSource_VP9_WebM
292 # PipelineIntegrationTest.BasicPlayback_VideoOnly_VP9_WebM
293 # PipelineIntegrationTest.BasicPlayback_VP9*
294 # PipelineIntegrationTest.P444_VP9_WebM
295 # Disable VP8A tests (b/18593324)
296 # PipelineIntegrationTest.BasicPlayback_VP8A*
297 # Disable OpusAudioDecoderTest/AudioDecoderTest.ProduceAudioSamples/0 (unit
298 # test fails when Opus decoder uses fixed-point)
299 # Due to b/16456550, disable the following four test cases:
300 # AudioOutputControllerTest.PlayDivertSwitchDeviceRevertClose
301 # AudioOutputControllerTest.PlaySwitchDeviceClose
302 # AudioStreamHandlerTest.Play
303 # SoundsManagerTest.Play
304 # Disable AudioStreamHandlerTest.ConsecutivePlayRequests (b/16539293)
mbjorgeb64c791f2016-09-20 18:04:56305 gtest_excludes = [
306 "AudioOutputControllerTest.PlayDivertSwitchDeviceRevertClose",
307 "AudioOutputControllerTest.PlaySwitchDeviceClose",
308 "AudioStreamHandlerTest.Play",
309 "AudioStreamHandlerTest.ConsecutivePlayRequests",
310 "PipelineIntegrationTest.BasicPlayback_MediaSource_VP9_WebM",
311 "PipelineIntegrationTest.BasicPlayback_VideoOnly_VP9_WebM",
312 "PipelineIntegrationTest.BasicPlayback_VP9*",
313 "PipelineIntegrationTest.P444_VP9_WebM",
314 "PipelineIntegrationTest.BasicPlayback_VP8A*",
315 "OpusAudioDecoderTest/AudioDecoderTest.ProduceAudioSamples/0",
316 "SoundsManagerTest.Play",
317 ]
318 } else if (target_os == "android" || is_cast_desktop_build) {
319 # Disable PipelineIntegrationTest.BasicPlayback_MediaSource_VP9_WebM (not supported)
320 gtest_excludes =
321 [ "PipelineIntegrationTest.BasicPlayback_MediaSource_VP9_WebM" ]
almasrymina93bf2752016-06-29 20:40:57322 }
mbjorgeb64c791f2016-09-20 18:04:56323 }
324 filters += [ media_unittests_filter ]
325
326 net_unittests_filter = {
327 test_name = "net_unittests"
mbjorgef3f79af2016-10-14 00:13:04328 if (using_sanitizer) {
329 # TODO(mbjorge): net_unittests do not complete when run with sanitizers,
330 # (in particular, TSAN and UBSAN), resulting in build machines getting stuck
331 # for many hours. Disable them for now, since these are getting run on
332 # Chromium bots anyway. (internal b/31279943)
333 gtest_excludes = [ "*" ]
334 } else if (target_os == "linux" && !is_cast_desktop_build) {
mbjorgeb64c791f2016-09-20 18:04:56335 # Run net_unittests first to avoid random failures due to slow python startup
mbjorgeb64c791f2016-09-20 18:04:56336 # URLRequestTestHTTP.GetTest_ManyCookies takes roughly 55s to run. Increase
337 # timeout to 90s from 45s to allow it to pass (b/19821476)
Lily Houghton99597862018-03-07 16:40:42338 # PacFileFetcherImplTest.HttpMimeType is flaking (b/19848784)
derekjchowac29ce32016-12-06 17:11:59339 # Running a batch of net_unittests has high overhead. Run tests in batches of 50 to reduce number of batches (b/23156294).
Lily Houghton99597862018-03-07 16:40:42340 gtest_excludes = [ "PacFileFetcherImplTest.HttpMimeType" ]
mbjorgeb64c791f2016-09-20 18:04:56341 args = [
342 "--test-launcher-timeout=90000",
derekjchowac29ce32016-12-06 17:11:59343 "--test-launcher-batch-limit=50",
mbjorgeb64c791f2016-09-20 18:04:56344 ]
345 } else if (is_cast_desktop_build || target_os == "android") {
mbjorge1641c3f2016-06-17 18:39:47346 # URLRequestTestHTTP.GetTest_ManyCookies takes roughly 55s to run. Increase
347 # timeout to 90s from 45s to allow it to pass (b/19821476) (b/29415636).
348 # CTLogVerifierTest.VerifiesValidConsistencyProofsFromReferenceGenerator
349 # times out occasionally, paricularly on the CQ bots; disable to reduce
350 # CQ flakiness (crbug/598406) (b/29415636).
351 # Running a batch of net_unittests has high overhead, so
352 # run tests in batches of 25 to reduce number of batches (b/23156294).
mbjorgeb64c791f2016-09-20 18:04:56353 gtest_excludes = [ "CTLogVerifierTest.VerifiesValidConsistencyProofsFromReferenceGenerator" ]
354 args = [
355 "--test-launcher-timeout=90000",
356 "--test-launcher-batch-limit=25",
357 ]
slan25bb71f22016-01-06 21:23:55358 }
slan87db9d12015-10-05 20:37:38359 }
mbjorgeb64c791f2016-09-20 18:04:56360 filters += [ net_unittests_filter ]
slan87db9d12015-10-05 20:37:38361}
362
363# Creates the build and run lists for all test targets.
364cast_test_group_list("cast_test_lists") {
365 build_list_path = "$root_out_dir/tests/build_test_list.txt"
mbjorge3ca202d2017-01-19 23:19:31366 runtime_deps_path = "$root_out_dir/tests/runtime_deps.json"
slan87db9d12015-10-05 20:37:38367 run_list_path = "$root_out_dir/tests/run_test_list.txt"
368
Gaofeng Huangeacee032018-04-30 22:42:55369 additional_options = [
370 "--ozone-platform=headless --test-launcher-bot-mode $cast_test_extra_flags",
371 ]
slan87db9d12015-10-05 20:37:38372
slan87db9d12015-10-05 20:37:38373 test_groups = [ ":cast_tests" ]
374
375 if (chromecast_branding != "public") {
376 test_groups += [ "//chromecast/internal:internal_cast_tests" ]
377 }
slanf48fe872015-06-23 19:41:52378}
slan0c9838b2015-08-05 18:37:40379
sanfin23024072016-06-18 01:02:06380if (is_android) {
381 cast_test_group("cast_junit_tests") {
382 test_type = "junit"
383 tests = [
384 "//base:base_junit_tests",
Simeon Anfinrud927ecc52017-12-08 19:55:25385 "//chromecast/base:cast_base_junit_tests",
thoren9540c6d2017-05-22 20:07:04386 "//chromecast/browser/android:cast_shell_junit_tests",
sanfin23024072016-06-18 01:02:06387 "//content/public/android:content_junit_tests",
388 "//net/android:net_junit_tests",
389 "//testing/android/junit:junit_unit_tests",
390 "//ui/android:ui_junit_tests",
391 ]
392 }
393
394 cast_test_group_list("cast_junit_test_lists") {
395 test_type = "junit"
396 build_list_path = "$root_out_dir/junit/build_junit_test_list.txt"
mbjorge3ca202d2017-01-19 23:19:31397 runtime_deps_path = "$root_out_dir/junit/runtime_deps.json"
sanfin23024072016-06-18 01:02:06398 run_list_path = "$root_out_dir/junit/run_junit_test_list.txt"
sanfin23024072016-06-18 01:02:06399 test_groups = [ ":cast_junit_tests" ]
sanfin65702e42017-04-26 02:49:09400 if (chromecast_branding != "public") {
401 test_groups += [ "//chromecast/internal:internal_cast_junit_tests" ]
402 }
sanfin23024072016-06-18 01:02:06403 }
404}
405
alokpe3bd5ed2016-11-16 15:57:10406test("cast_shell_unittests") {
407 deps = [
408 ":cast_shell_lib",
409 "//chromecast/app:test_support",
410 "//chromecast/app:unittests",
411 "//chromecast/browser:unittests",
derekjchow3a461eeb2017-01-10 19:03:33412 "//ui/gl:test_support",
alokpe3bd5ed2016-11-16 15:57:10413 ]
414}
415
416test("cast_shell_browsertests") {
417 deps = [
418 ":cast_shell_lib",
419 "//chromecast/app:test_support",
420 "//chromecast/browser:browsertests",
421 ]
mbjorgeffa03d802017-02-22 21:52:47422
423 data_deps = [
424 ":chromecast_locales_pak",
425 ]
alokpe3bd5ed2016-11-16 15:57:10426}
427
alokpcd91e6032016-11-10 22:13:07428group("cast_shell_lib") {
mbjorge095af3442016-11-16 02:41:46429 data_deps = [
430 ":cast_shell_pak",
431 ]
432
slan0c9838b2015-08-05 18:37:40433 deps = [
slan0c9838b2015-08-05 18:37:40434 "//chromecast/app",
435 "//chromecast/browser",
436 "//chromecast/common",
slan0c9838b2015-08-05 18:37:40437 "//chromecast/renderer",
438 ]
slan0c9838b2015-08-05 18:37:40439
alokpcd91e6032016-11-10 22:13:07440 if (chromecast_branding != "public") {
441 deps += [ "//chromecast/internal/shell" ]
442 }
slan0c9838b2015-08-05 18:37:40443}
444
Stephen Lanhambd378622017-07-20 14:29:39445cast_executable("cast_shell") {
slan0c9838b2015-08-05 18:37:40446 sources = [
447 "app/cast_main.cc",
448 ]
449
450 deps = [
alokpcd91e6032016-11-10 22:13:07451 ":cast_shell_lib",
alokpcd91e6032016-11-10 22:13:07452 ":chromecast_locales_pak",
thomasanderson84fa8b02017-05-18 23:38:47453 "//build/config:exe_and_shlib_deps",
slan0c9838b2015-08-05 18:37:40454 "//chromecast/app",
455 "//content/public/app:both",
456 ]
slan0c9838b2015-08-05 18:37:40457}
458
Sergey Ulanov7b989092017-10-09 23:20:45459if (is_fuchsia) {
Kevin Marshall39b4aa82018-06-23 00:12:15460 fuchsia_package("cast_shell_pkg") {
461 binary = ":cast_shell"
462 package_name_override = "cast_shell"
Kevin Marshall67db8012017-11-09 02:41:50463
464 if (chromecast_branding != "public") {
Kevin Marshallf27bb1da2018-02-06 00:30:36465 deps = [
Kevin Marshall67db8012017-11-09 02:41:50466 "//chromecast/internal:fuchsia_internal_data_deps",
467 ]
468 }
Sergey Ulanov7b989092017-10-09 23:20:45469 }
Kevin Marshall39b4aa82018-06-23 00:12:15470
471 fuchsia_package_runner("cast_shell_fuchsia") {
472 package = ":cast_shell_pkg"
473 package_name_override = "cast_shell"
474 }
Sergey Ulanov7b989092017-10-09 23:20:45475}
476
slan0c9838b2015-08-05 18:37:40477repack("cast_shell_pak") {
478 sources = [
slan0c9838b2015-08-05 18:37:40479 "$root_gen_dir/chromecast/app/shell_resources.pak",
rockot97597152016-10-03 06:27:38480 "$root_gen_dir/chromecast/browser/cast_browser_resources.pak",
slan0c9838b2015-08-05 18:37:40481 "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
482 "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
483 "$root_gen_dir/content/content_resources.pak",
Yuzhu Shen2efe42772017-11-11 02:01:09484 "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
slan0c9838b2015-08-05 18:37:40485 "$root_gen_dir/net/net_resources.pak",
Blink Reformata30d4232018-04-07 15:31:06486 "$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
487 "$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_100_percent.pak",
slan0c9838b2015-08-05 18:37:40488 "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
489 "$root_gen_dir/ui/resources/webui_resources.pak",
490 "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
491 "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
492 ]
493
slan0c9838b2015-08-05 18:37:40494 output = "$root_out_dir/assets/cast_shell.pak"
495
496 deps = [
497 "//chromecast/app:resources",
rockot97597152016-10-03 06:27:38498 "//chromecast/browser:resources",
slan0c9838b2015-08-05 18:37:40499 "//content:resources",
500 "//content/app/resources",
501 "//content/app/strings",
Yuzhu Shen2efe42772017-11-11 02:01:09502 "//mojo/public/js:resources",
slan0c9838b2015-08-05 18:37:40503 "//net:net_resources",
Blink Reformata30d4232018-04-07 15:31:06504 "//third_party/blink/public:resources",
505 "//third_party/blink/public:scaled_resources_100_percent",
slan0c9838b2015-08-05 18:37:40506 "//ui/resources",
507 "//ui/strings",
508 ]
509
Albert Chaulk3ae73b12018-01-17 18:34:34510 if (enable_chromecast_extensions) {
511 sources += [
Randy Rossic8758b62018-05-08 18:08:49512 "$root_gen_dir/chromecast/renderer/extensions_renderer_resources.pak",
Albert Chaulk3ae73b12018-01-17 18:34:34513 "$root_gen_dir/extensions/extensions_renderer_resources.pak",
514 "$root_gen_dir/extensions/extensions_resources.pak",
515 "$root_gen_dir/extensions/shell/app_shell_resources.pak",
516 ]
517 deps += [
Randy Rossic8758b62018-05-08 18:08:49518 "//chromecast/renderer:extensions_resources",
Albert Chaulk3ae73b12018-01-17 18:34:34519 "//extensions:extensions_resources",
520 "//extensions/shell:resources",
521 ]
522 }
523
slan9ccf3592015-09-10 19:40:33524 if (chromecast_branding != "public") {
slan65a12682016-02-10 01:24:39525 sources += [ "$root_gen_dir/chromecast/internal/cast_shell_internal.pak" ]
slan9ccf3592015-09-10 19:40:33526
slan65a12682016-02-10 01:24:39527 deps += [ "//chromecast/internal:cast_shell_internal_pak" ]
slan0c9838b2015-08-05 18:37:40528 }
529}
slanca520532015-11-05 20:35:33530
slan5c5624b2017-03-23 20:24:14531# Intermediate targets that repack grit resources by locale. For each locale
Stephen Lanham3c2131cd2017-04-28 01:13:41532# in |cast_locales| (see //chromecast/chromecast.gni), all resources
slan5c5624b2017-03-23 20:24:14533# are packed into a single .pak file in an output directory. These targets
534# should not be depended on directly; depend on ":chromecast_locales_pak"
535# instead.
Stephen Lanham3c2131cd2017-04-28 01:13:41536foreach(locale, cast_locales) {
slan5c5624b2017-03-23 20:24:14537 repack("_cast_repack_${locale}") {
538 visibility = [ ":chromecast_locales_pak" ]
539 output = "$root_out_dir/chromecast_locales/${locale}.pak"
540 sources = [
541 "$root_gen_dir/chromecast/app/chromecast_settings_${locale}.pak",
542 ]
543 deps = [
544 "//chromecast/app:chromecast_settings",
545 ]
slanca520532015-11-05 20:35:33546
slan5c5624b2017-03-23 20:24:14547 if (chromecast_branding != "public") {
Michael Spang0436dc82017-12-01 20:25:27548 sources += [
549 "$root_gen_dir/chromecast/internal/webui/app_strings_${locale}.pak",
550 ]
slan5c5624b2017-03-23 20:24:14551 deps += [ "//chromecast/internal/webui:chromecast_app_strings" ]
slanca520532015-11-05 20:35:33552
gfhuang79ceb4f2016-09-07 06:43:03553 if (enable_chromecast_webui) {
slan5c5624b2017-03-23 20:24:14554 sources += [ "$root_gen_dir/chromecast/internal/webui/webui_localized_${locale}.pak" ]
555 deps += [ "//chromecast/internal/webui:chromecast_webui_localized" ]
gfhuang79ceb4f2016-09-07 06:43:03556 }
slanca520532015-11-05 20:35:33557 }
slanca520532015-11-05 20:35:33558 }
slan5c5624b2017-03-23 20:24:14559}
slanca520532015-11-05 20:35:33560
slan5c5624b2017-03-23 20:24:14561# A meta-target which repacks resources by locale.
562group("chromecast_locales_pak") {
563 deps = []
Stephen Lanham3c2131cd2017-04-28 01:13:41564 foreach(locale, cast_locales) {
slan5c5624b2017-03-23 20:24:14565 deps += [ ":_cast_repack_${locale}" ]
gfhuang79ceb4f2016-09-07 06:43:03566 }
slanca520532015-11-05 20:35:33567}
slan074ec342016-01-29 23:52:26568
Scott Violet6200d332018-02-23 21:29:23569buildflag_header("chromecast_buildflags") {
570 header = "chromecast_buildflags.h"
tsunghung38c960952017-03-16 18:23:00571 flags = [
Bryan Henrybaa671d2017-07-11 01:52:25572 "ENABLE_ASSISTANT=$enable_assistant",
Chris Kuiper23393ec2017-09-23 01:36:29573 "ENABLE_VOLUME_TABLES_ACCESS=$enable_volume_tables_access",
Bryan Henrybaa671d2017-07-11 01:52:25574 "IS_ANDROID_THINGS=$is_android_things",
tsunghung38c960952017-03-16 18:23:00575 "IS_CAST_AUDIO_ONLY=$is_cast_audio_only",
Mina Almasry7907b5c2017-12-18 22:01:33576 "IS_CAST_DESKTOP_BUILD=$is_cast_desktop_build",
tsunghung38c960952017-03-16 18:23:00577 "IS_CAST_USING_CMA_BACKEND=$is_cast_using_cma_backend",
Bryan Henrybaa671d2017-07-11 01:52:25578 "SUPPORTS_MULTIZONE=$supports_multizone",
Aidan Wolter247e39e2017-09-12 19:29:13579 "ENABLE_HEADLESS_MUSIC_MODE=$enable_headless_music_mode",
Albert Chaulk3ae73b12018-01-17 18:34:34580 "ENABLE_CHROMECAST_EXTENSIONS=$enable_chromecast_extensions",
Zhiheng Vincent Li7b37d582018-01-24 03:44:54581 "ENABLE_CAST_FRAGMENT=$enable_cast_fragment",
Aidan Wolterd6c24152018-04-09 18:14:17582 "IS_ANDROID_THINGS_NON_PUBLIC=$is_android_things_non_public",
tsunghung38c960952017-03-16 18:23:00583 ]
slan7d09f9e2016-04-08 15:47:02584}
585
slan074ec342016-01-29 23:52:26586if (is_android) {
Yipeng Wang158dbc5c2017-06-30 18:16:41587 generate_jni_registration("cast_shell_jni_registration") {
588 target = ":cast_shell_apk"
589 output = "$root_gen_dir/chromecast/android/${target_name}.h"
590 exception_files = jni_exception_files
591 }
Thoren Paulson0bf75bf2017-12-05 20:21:45592
slan074ec342016-01-29 23:52:26593 android_assets("cast_shell_apk_assets") {
594 assert(v8_use_external_startup_data)
595
596 sources = [
597 "$root_out_dir/assets/cast_shell.pak",
598 ]
599
600 deps = [
Thoren Paulson0bf75bf2017-12-05 20:21:45601 ":cast_shell_apk_locale_assets",
slan074ec342016-01-29 23:52:26602 ":cast_shell_pak",
603 "//third_party/icu:icu_assets",
604 "//v8:v8_external_startup_data_assets",
605 ]
sanfin52f72e82016-04-13 22:36:05606 disable_compression = true
slan074ec342016-01-29 23:52:26607 }
608
Thoren Paulson0bf75bf2017-12-05 20:21:45609 android_assets("cast_shell_apk_locale_assets") {
610 renaming_sources = []
611 renaming_destinations = []
612
613 foreach(locale, cast_locales) {
614 renaming_sources += [ "$root_out_dir/chromecast_locales/${locale}.pak" ]
615 renaming_destinations += [ "stored-locales/${locale}.pak" ]
616 }
617
618 deps = [
619 ":chromecast_locales_pak",
620 ]
621
622 treat_as_locale_paks = true
623 disable_compression = true
624 }
625
slan074ec342016-01-29 23:52:26626 android_apk("cast_shell_apk") {
627 apk_name = "CastShell"
628 android_manifest = "$root_gen_dir/cast_shell_manifest/AndroidManifest.xml"
629 android_manifest_dep = "//chromecast/browser/android:cast_shell_manifest"
yucliu5c1cc482016-12-01 20:35:10630
631 shared_libraries = [ "//chromecast/android:libcast_shell_android" ]
632
slan074ec342016-01-29 23:52:26633 deps = [
634 ":cast_shell_apk_assets",
yucliu5c1cc482016-12-01 20:35:10635 "//base:base_java",
slan074ec342016-01-29 23:52:26636 "//chromecast/android:libcast_shell_android",
637 "//chromecast/browser/android:cast_shell_java",
638 ]
Yipeng Wang1cbf27ea2017-07-17 15:30:03639
640 command_line_flags_file = "castshell-command-line"
slan074ec342016-01-29 23:52:26641 }
642}