third_party/angle/third_party/vulkan-loader/src/loader/vk_loader_platform.h
[chromium-dfly.git] / chromecast / BUILD.gn
1 # 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
5 import("//build/buildflag_header.gni")
6 import("//build/config/features.gni")
7 import("//build/config/sanitizers/sanitizers.gni")
8 import("//build/config/ui.gni")
9 import("//chromecast/build/tests/cast_test.gni")
10 import("//chromecast/chromecast.gni")
11 import("//media/media_options.gni")
12 import("//tools/grit/repack.gni")
13 import("//ui/ozone/ozone.gni")
14 import("//v8/gni/v8.gni")
15
16 if (is_android) {
17   import("//build/config/android/rules.gni")
18 }
19
20 declare_args() {
21   cast_test_extra_flags = ""
22   vendor_cast_media_gtest_excludes = []
23 }
24
25 # Depends on all non-test targets that should be built by the Chromecast
26 # internal build infrastructure.
27 group("all") {
28   deps = []
29   if (is_android && chromecast_branding == "public") {
30     deps += [ ":cast_shell_apk" ]
31   }
32   if (!is_android) {
33     deps += [ ":cast_shell" ]
34   }
35   if (is_linux) {
36     deps += [ "//chromecast/tracing" ]
37   }
38   if (chromecast_branding != "public") {
39     deps += [ "//chromecast/internal:all" ]
40   }
41   if (enable_external_mojo_services) {
42     deps += [ "//chromecast/external_mojo/external_service_support:standalone_mojo_broker" ]
43   }
44
45   # No other targets should depend on this target, since it's just a convenience
46   # target for the Chromecast internal build infrastructure.
47   visibility = []
48   testonly = true
49 }
50
51 # This is a config which is applied on all cast_* targets (which should be all
52 # code under chromecast/).
53 config("cast_config") {
54 }
55
56 # A list of all public test() binaries. This is an organizational target that
57 # cannot be depended upon or built directly. Build cast_test_lists instead.
58 cast_test_group("cast_tests") {
59   filters = []
60   tests = [
61     "//base:base_unittests",
62     "//cc:cc_unittests",
63     "//chromecast/base:cast_base_unittests",
64     "//chromecast/base/component:cast_component_unittests",
65     "//chromecast/crypto:cast_crypto_unittests",
66     "//chromecast/device/bluetooth:cast_bluetooth_unittests",
67     "//chromecast/media:cast_media_unittests",
68     "//chromecast/net:cast_net_unittests",
69     "//chromecast/system/reboot:cast_reboot_unittests",
70     "//content/test:content_unittests",
71     "//crypto:crypto_unittests",
72     "//media:media_unittests",
73     "//media/midi:midi_unittests",
74     "//net:net_unittests",
75     "//sql:sql_unittests",
76     "//storage:storage_unittests",
77     "//third_party/cacheinvalidation:cacheinvalidation_unittests",
78     "//ui/base:ui_base_unittests",
79   ]
80
81   if (!is_cast_audio_only) {
82     tests += [ "//gpu:gpu_unittests" ]
83
84     if (use_aura) {
85       tests += [ "//chromecast/graphics:cast_graphics_unittests" ]
86     }
87   }
88
89   if (is_linux) {
90     tests += [
91       "//chromecast/crash:cast_crash_unittests",
92       "//components/exo:exo_unittests",
93       "//sandbox/linux:sandbox_linux_unittests",
94     ]
95   }
96
97   if (is_linux || is_fuchsia) {
98     tests += [ "//chromecast/media/cma/backend:cast_audio_backend_unittests" ]
99   }
100
101   if (is_android && is_cast_using_cma_backend) {
102     tests += [ "//chromecast/media/cma/backend/android:cast_android_cma_backend_unittests" ]
103   }
104
105   cast_media_unittests_filter = {
106     test_name = "cast_media_unittests"
107
108     gtest_excludes = vendor_cast_media_gtest_excludes
109
110     # --test-launcher-jobs=1 => so internal code can bind to port
111     args = [ "--test-launcher-jobs=1" ]
112   }
113   filters += [ cast_media_unittests_filter ]
114
115   if (!is_android) {
116     tests += [
117       ":cast_shell_browsertests",
118       ":cast_shell_unittests",
119       "//ipc:ipc_tests",
120       "//url:url_unittests",
121     ]
122
123     if (!is_fuchsia) {
124       tests += [ "//jingle:jingle_unittests" ]
125     }
126
127     cast_shell_browsertests_filter = {
128       test_name = "cast_shell_browsertests"
129
130       # --enable-local-file-accesses => to load sample media files
131       # --test-launcher-jobs=1 => so internal code can bind to port
132       args = [
133         "--no-sandbox",
134         "--enable-local-file-accesses",
135         "--test-launcher-jobs=1",
136       ]
137
138       gtest_excludes = []
139
140       # TODO(b/112440248): This test was failing:
141       #   * On v1 and Cast Audio devices since 2017-03-15.
142       #   * On desktop builds since 2018-08-22
143       # Also see: b/36238710, b/36239051, hotlist/461351
144       gtest_excludes += [ "RendererPrelauncherTest.ReusedRenderer" ]
145
146       if (!is_cast_desktop_build) {
147         args += [ "--use-gpu-in-tests" ]
148
149         # TODO(derekjchow): Make these tests pass on Chromecast devices.
150         #    Once all of the CastMediaBlockerTest.* have been un-DISABLEd and
151         #    are running successfully, revisit these tests and see if they pass
152         #    on devices. (crbug/665118, internal b/32023194)
153         gtest_excludes += [
154           "CastMediaBlockerBrowserTest.Video_BlockUnblock",
155           "CastMediaBlockerBrowserTest.Audio_BlockUnblock",
156         ]
157       }
158
159       if (!is_cast_desktop_build && !is_cast_audio_only && !enable_assistant) {
160         # TODO(mbjorge): The VideoPlaybackMp4 test is failing on v1 devices.
161         # Temporarily disable it as part of an effort to re-green the unittests.
162         # Re-enable once the tests have been fixed. Limitations in the filter
163         # system mean this is getting temporarily disabled on all video devices,
164         # though it is only failing on v1.
165         # b/36723698, hotlist/461351
166         gtest_excludes += [ "CastNavigationBrowserTest.VideoPlaybackMp4" ]
167       }
168
169       # TODO(mbjorge): Temporarily disable AudioPlaybackWavPcm because it is
170       # failing on device. As part of an effort to re-green the unittests,
171       # current (2017-03-15) failures are being disabled to get back to a
172       # green state. Re-enable once the tests have been fixed.
173       # b/36239152, hotlist/461351
174       if (enable_assistant && !is_cast_desktop_build) {
175         gtest_excludes += [ "CastNavigationBrowserTest.AudioPlaybackWavPcm" ]
176       }
177     }
178     filters += [ cast_shell_browsertests_filter ]
179
180     ipc_tests_filter = {
181       test_name = "ipc_tests"
182
183       # --test-launcher-jobs=1 => so internal code can bind to port
184       args = [ "--test-launcher-jobs=1" ]
185     }
186     filters += [ ipc_tests_filter ]
187
188     url_unittests_filter = {
189       test_name = "url_unittests"
190
191       if (target_os == "linux" && !is_cast_desktop_build) {
192         # DoAppendUTF8Invalid fails because of dcheck_always_on flag in Eng builds
193         gtest_excludes = [ "URLCanonTest.DoAppendUTF8Invalid" ]
194       }
195     }
196     filters += [ url_unittests_filter ]
197   }
198
199   base_unittests_filter = {
200     test_name = "base_unittests"
201     gtest_excludes = []
202     if (target_os == "linux") {
203       if (is_cast_desktop_build) {
204         # Disable PartitionAllocDeathTest.* (b/67975693)
205         gtest_excludes += [ "PartitionAllocDeathTest.*" ]
206       } else {
207         # Disable ProcessMetricsTest.GetNumberOfThreads (b/15610509)
208         # Disable ProcessUtilTest.* (need to define OS_ANDROID)
209         # Disable StackContainer.BufferAlignment (don't support 16-byte alignment)
210         # Disable SystemMetrics2Test.GetSystemMemoryInfo (buffers>0 can't be guaranteed)
211         # Disable PostTasksViaTaskRunner/* to green up devices (b/62246873)
212         # Disable WorkerDetaches to green up devices (b/62246873)
213         gtest_excludes += [
214           "ProcessMetricsTest.GetNumberOfThreads",
215           "ProcessUtilTest.*",
216           "StackContainer.BufferAlignment",
217           "SystemMetrics2Test.GetSystemMemoryInfo",
218           "OneTraitsExecutionModePair/ThreadPoolImplTest.PostTasksViaTaskRunner/*",
219           "TaskSchedulerWorkerTest.WorkerDetaches",
220         ]
221       }
222
223       if (is_cast_audio_only) {
224         # Also disable TimeFormattingTest on audio-only builds, since we don't
225         # include the necessary info in icudtl.dat.
226         gtest_excludes += [ "TimeFormattingTest.*" ]
227       }
228     }
229   }
230   filters += [ base_unittests_filter ]
231
232   cast_avsettings_unittests_filter = {
233     test_name = "cast_avsettings_unittests"
234     gtest_excludes = []
235     if (is_android_things) {
236       # Disable tests to enable presubmit. Re-enable for b/120669054.
237       gtest_excludes += [
238         "JniVolumeControllerTest.SetMutedNotifiesAllVolumeObservers",
239         "JniVolumeControllerTest.SetVolumeNotifiesVolumeObserver",
240       ]
241     }
242   }
243   filters += [ cast_avsettings_unittests_filter ]
244
245   cc_unittests_filter = {
246     test_name = "cc_unittests"
247
248     # Temporarily disable all test cases (b/113324890)
249     gtest_excludes = [ "*" ]
250
251     if (!is_cast_desktop_build) {
252       #Disable ToColorSpace/ColorTransformPixelTest*  (b/64346790)
253       #Disable ImageBackgroundFilter* (b/64346875)
254       #Disable LayerTreeHostTilesTestPartialInvalidation* (b/65844132)
255       gtest_excludes += [
256         "ToColorSpace/ColorTransformPixelTest.*",
257         "ImageBackgroundFilter.*",
258         "LayerTreeHostTilesTestPartialInvalidation.*",
259       ]
260     }
261   }
262   filters += [ cc_unittests_filter ]
263
264   content_unittests_filter = {
265     test_name = "content_unittests"
266
267     # IsSupportedVideoConfig_VP9TransferFunctions fails on all cast builds since
268     # the cast IsSupporedVideoConfigs ignore the transfer function parameter.
269     # (b/36984215).
270     gtest_excludes = [ "*.IsSupportedVideoConfig_VP9TransferFunctions" ]
271     if (is_android_things) {
272       gtest_excludes += [
273         "FontUniqueNameLookupTest.TestMatchPostScriptNameTtc",
274         "SiteInstanceTest.HasWrongProcessForURL",
275       ]
276     }
277     if (target_os == "linux" && !is_cast_desktop_build) {
278       # DesktopCaptureDeviceTest.*: No capture device on Eureka
279       # Disable PepperGamepadHostTest.WaitForReply (pepper not supported on Eureka)
280       # Disable RenderWidgetHostTest.Background because we disable the
281       # blacklist to enable WebGL (b/16142554)
282       gtest_excludes += [
283         "DOMStorageDatabaseTest.TestCanOpenAndReadWebCoreDatabase",
284         "DesktopCaptureDeviceTest.Capture",
285         "GamepadProviderTest.PollingAccess",
286         "PepperGamepadHostTest.WaitForReply",
287         "RenderWidgetHostTest.Background",
288       ]
289     }
290     if (is_cast_audio_only) {
291       # No way to display URL's on audio only cast devices.
292       gtest_excludes += [ "NavigationEntryTest.NavigationEntryURLs" ]
293     }
294     if (enable_assistant && !is_cast_desktop_build) {
295       # Temporarily disable InvalidUUID and DefaultConstructor on assistant
296       # device builds. Cause of failure is unclear, but it's highly likely it's
297       # related to them being DEATH tests. These were passing until the
298       # is_official_build flag was enabled. These tests are considered
299       # non-critical in this context. (b/62469368)
300       gtest_excludes += [
301         "BluetoothBlocklistTest.InvalidUUID",
302         "WebBluetoothDeviceIdTest.DefaultConstructor",
303       ]
304     }
305   }
306   filters += [ content_unittests_filter ]
307
308   media_unittests_filter = {
309     test_name = "media_unittests"
310     if (target_os == "linux" && !is_cast_desktop_build) {
311       # Disable VP9 related tests (b/18593324)
312       #   PipelineIntegrationTest.BasicPlayback_MediaSource_VP9_WebM
313       #   PipelineIntegrationTest.BasicPlayback_VideoOnly_VP9_WebM
314       #   PipelineIntegrationTest.BasicPlayback_VP9*
315       #   PipelineIntegrationTest.P444_VP9_WebM
316       # Disable VP8A tests (b/18593324)
317       #   PipelineIntegrationTest.BasicPlayback_VP8A*
318       # Disable OpusAudioDecoderTest/AudioDecoderTest.ProduceAudioSamples/0 (unit
319       # test fails when Opus decoder uses fixed-point)
320       # Due to b/16456550, disable the following four test cases:
321       #   AudioOutputControllerTest.PlayDivertSwitchDeviceRevertClose
322       #   AudioOutputControllerTest.PlaySwitchDeviceClose
323       #   AudioStreamHandlerTest.Play
324       #   SoundsManagerTest.Play
325       # Disable AudioStreamHandlerTest.ConsecutivePlayRequests (b/16539293)
326       gtest_excludes = [
327         "AudioOutputControllerTest.PlayDivertSwitchDeviceRevertClose",
328         "AudioOutputControllerTest.PlaySwitchDeviceClose",
329         "AudioStreamHandlerTest.Play",
330         "AudioStreamHandlerTest.ConsecutivePlayRequests",
331         "PipelineIntegrationTest.BasicPlayback_MediaSource_VP9_WebM",
332         "PipelineIntegrationTest.BasicPlayback_VideoOnly_VP9_WebM",
333         "PipelineIntegrationTest.BasicPlayback_VP9*",
334         "PipelineIntegrationTest.P444_VP9_WebM",
335         "PipelineIntegrationTest.BasicPlayback_VP8A*",
336         "OpusAudioDecoderTest/AudioDecoderTest.ProduceAudioSamples/0",
337         "SoundsManagerTest.Play",
338       ]
339     } else if (target_os == "android" || is_cast_desktop_build) {
340       # Disable PipelineIntegrationTest.BasicPlayback_MediaSource_VP9_WebM (not supported)
341       gtest_excludes =
342           [ "PipelineIntegrationTest.BasicPlayback_MediaSource_VP9_WebM" ]
343     }
344   }
345   filters += [ media_unittests_filter ]
346
347   net_unittests_filter = {
348     test_name = "net_unittests"
349     if (using_sanitizer) {
350       # TODO(mbjorge): net_unittests do not complete when run with sanitizers,
351       # (in particular, TSAN and UBSAN), resulting in build machines getting stuck
352       # for many hours. Disable them for now, since these are getting run on
353       # Chromium bots anyway. (internal b/31279943)
354       gtest_excludes = [ "*" ]
355     } else if (target_os == "linux" && !is_cast_desktop_build) {
356       # Run net_unittests first to avoid random failures due to slow python startup
357       # URLRequestTestHTTP.GetTest_ManyCookies takes roughly 55s to run. Increase
358       # timeout to 90s from 45s to allow it to pass (b/19821476)
359       # PacFileFetcherImplTest.HttpMimeType is flaking (b/19848784)
360       # Running a batch of net_unittests has high overhead. Run tests in batches of 50 to reduce number of batches (b/23156294).
361       gtest_excludes = [ "PacFileFetcherImplTest.HttpMimeType" ]
362       args = [
363         "--test-launcher-timeout=90000",
364         "--test-launcher-batch-limit=50",
365       ]
366     } else if (is_cast_desktop_build || target_os == "android") {
367       # URLRequestTestHTTP.GetTest_ManyCookies takes roughly 55s to run. Increase
368       # timeout to 90s from 45s to allow it to pass (b/19821476) (b/29415636).
369       # CTLogVerifierTest.VerifiesValidConsistencyProofsFromReferenceGenerator
370       # times out occasionally, paricularly on the CQ bots; disable to reduce
371       # CQ flakiness (crbug/598406) (b/29415636).
372       # Running a batch of net_unittests has high overhead, so
373       # run tests in batches of 25 to reduce number of batches (b/23156294).
374       gtest_excludes = [ "CTLogVerifierTest.VerifiesValidConsistencyProofsFromReferenceGenerator" ]
375       args = [
376         "--test-launcher-timeout=90000",
377         "--test-launcher-batch-limit=25",
378       ]
379     }
380   }
381   filters += [ net_unittests_filter ]
382
383   cast_receiver_unittests_filter = {
384     test_name = "cast_receiver_unittests"
385     gtest_excludes = []
386     if (is_android_things) {
387       # Disable tests to enable presubmit. Re-enable for b/120669054.
388       gtest_excludes += [ "ApplicationManagerImplTest.SwapBackgroundApp_StereoVirtualDevice_BitstreamNotSupported" ]
389     }
390   }
391   filters += [ cast_receiver_unittests_filter ]
392 }
393
394 # Creates the build and run lists for all test targets.
395 cast_test_group_list("cast_test_lists") {
396   build_list_path = "$root_out_dir/tests/build_test_list.txt"
397   runtime_deps_path = "$root_out_dir/tests/runtime_deps.json"
398   run_list_path = "$root_out_dir/tests/run_test_list.txt"
399
400   additional_options = [
401     "--ozone-platform=headless --test-launcher-bot-mode $cast_test_extra_flags",
402   ]
403
404   test_groups = [ ":cast_tests" ]
405
406   if (chromecast_branding != "public") {
407     test_groups += [ "//chromecast/internal:internal_cast_tests" ]
408   }
409 }
410
411 if (is_android) {
412   cast_test_group("cast_junit_tests") {
413     test_type = "junit"
414     tests = [
415       "//base:base_junit_tests",
416       "//chromecast/base:cast_base_junit_tests",
417       "//chromecast/browser/android:cast_shell_junit_tests",
418       "//content/public/android:content_junit_tests",
419       "//net/android:net_junit_tests",
420       "//testing/android/junit:junit_unit_tests",
421       "//ui/android:ui_junit_tests",
422     ]
423   }
424
425   cast_test_group_list("cast_junit_test_lists") {
426     test_type = "junit"
427     build_list_path = "$root_out_dir/junit/build_junit_test_list.txt"
428     runtime_deps_path = "$root_out_dir/junit/runtime_deps.json"
429     run_list_path = "$root_out_dir/junit/run_junit_test_list.txt"
430     test_groups = [ ":cast_junit_tests" ]
431     if (chromecast_branding != "public") {
432       test_groups += [ "//chromecast/internal:internal_cast_junit_tests" ]
433     }
434   }
435 }
436
437 test("cast_shell_unittests") {
438   deps = [
439     ":cast_shell_lib",
440     "//chromecast/app:test_support",
441     "//chromecast/app:unittests",
442     "//chromecast/browser:unittests",
443     "//ui/gl:test_support",
444   ]
445 }
446
447 test("cast_shell_browsertests") {
448   deps = [
449     ":cast_shell_lib",
450     "//chromecast/app:test_support",
451     "//chromecast/browser:browsertests",
452   ]
453
454   data_deps = [
455     ":chromecast_locales_pak",
456   ]
457 }
458
459 group("cast_shell_lib") {
460   data_deps = [
461     ":cast_shell_pak",
462   ]
463
464   deps = [
465     "//chromecast/app",
466     "//chromecast/browser",
467     "//chromecast/common",
468     "//chromecast/renderer",
469   ]
470
471   if (chromecast_branding != "public") {
472     deps += [ "//chromecast/internal/shell" ]
473   }
474 }
475
476 cast_executable("cast_shell") {
477   sources = [
478     "app/cast_main.cc",
479   ]
480
481   deps = [
482     ":cast_shell_lib",
483     ":chromecast_locales_pak",
484     "//chromecast/app",
485     "//content/public/app:both",
486   ]
487 }
488
489 if (is_fuchsia) {
490   fuchsia_package("cast_shell_pkg") {
491     binary = ":cast_shell"
492     package_name_override = "cast_shell"
493     sandbox_policy = "//chromecast/cast_shell_sandbox_policy"
494
495     if (chromecast_branding != "public") {
496       deps = [
497         "//chromecast/internal:fuchsia_internal_data_deps",
498       ]
499     }
500   }
501
502   fuchsia_package_runner("cast_shell_fuchsia") {
503     package = ":cast_shell_pkg"
504     package_name_override = "cast_shell"
505   }
506 }
507
508 repack("cast_shell_pak") {
509   sources = [
510     "$root_gen_dir/chromecast/app/shell_resources.pak",
511     "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
512     "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
513     "$root_gen_dir/content/content_resources.pak",
514     "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
515     "$root_gen_dir/net/net_resources.pak",
516     "$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
517     "$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_100_percent.pak",
518     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
519     "$root_gen_dir/ui/resources/webui_resources.pak",
520     "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
521     "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
522   ]
523
524   output = "$root_out_dir/assets/cast_shell.pak"
525
526   deps = [
527     "//chromecast/app:resources",
528     "//content:resources",
529     "//content/app/resources",
530     "//content/app/strings",
531     "//mojo/public/js:resources",
532     "//net:net_resources",
533     "//third_party/blink/public:resources",
534     "//third_party/blink/public:scaled_resources_100_percent",
535     "//ui/resources",
536     "//ui/strings",
537   ]
538
539   if (enable_chromecast_extensions) {
540     sources += [
541       "$root_gen_dir/chromecast/renderer/extensions_renderer_resources.pak",
542       "$root_gen_dir/extensions/extensions_renderer_resources.pak",
543       "$root_gen_dir/extensions/extensions_resources.pak",
544       "$root_gen_dir/extensions/shell/app_shell_resources.pak",
545     ]
546     deps += [
547       "//chromecast/renderer:extensions_resources",
548       "//extensions:extensions_resources",
549       "//extensions/shell:resources",
550     ]
551   }
552
553   if (chromecast_branding != "public") {
554     sources += [ "$root_gen_dir/chromecast/internal/cast_shell_internal.pak" ]
555
556     deps += [ "//chromecast/internal:cast_shell_internal_pak" ]
557   }
558 }
559
560 # Intermediate targets that repack grit resources by locale. For each locale
561 # in |cast_locales| (see //chromecast/chromecast.gni), all resources
562 # are packed into a single .pak file in an output directory. These targets
563 # should not be depended on directly; depend on ":chromecast_locales_pak"
564 # instead.
565 foreach(locale, cast_locales) {
566   repack("_cast_repack_${locale}") {
567     visibility = [ ":chromecast_locales_pak" ]
568     output = "$root_out_dir/chromecast_locales/${locale}.pak"
569     sources = [
570       "$root_gen_dir/chromecast/app/chromecast_settings_${locale}.pak",
571     ]
572     deps = [
573       "//chromecast/app:chromecast_settings",
574     ]
575
576     if (chromecast_branding != "public") {
577       sources += [
578         "$root_gen_dir/chromecast/internal/webui/app_strings_${locale}.pak",
579       ]
580       deps += [ "//chromecast/internal/webui:chromecast_app_strings" ]
581
582       if (enable_chromecast_webui) {
583         sources += [ "$root_gen_dir/chromecast/internal/webui/webui_localized_${locale}.pak" ]
584         deps += [ "//chromecast/internal/webui:chromecast_webui_localized" ]
585       }
586     }
587   }
588 }
589
590 # A meta-target which repacks resources by locale.
591 group("chromecast_locales_pak") {
592   data_deps = []
593   foreach(locale, cast_locales) {
594     data_deps += [ ":_cast_repack_${locale}" ]
595   }
596 }
597
598 buildflag_header("chromecast_buildflags") {
599   header = "chromecast_buildflags.h"
600   flags = [
601     "DEFAULT_COMMAND_LINE_FLAGS=\"$default_command_line_flags\"",
602     "DISABLE_SECURE_FLAC_OPUS_DECODING=$disable_secure_flac_and_opus_decoding",
603     "ENABLE_ASSISTANT=$enable_assistant",
604     "ENABLE_CAST_FRAGMENT=$enable_cast_fragment",
605     "ENABLE_CAST_WAYLAND_SERVER=$enable_cast_wayland_server",
606     "ENABLE_CHROMECAST_EXTENSIONS=$enable_chromecast_extensions",
607     "ENABLE_EXTERNAL_MOJO_SERVICES=$enable_external_mojo_services",
608     "ENABLE_HEADLESS_MUSIC_MODE=$enable_headless_music_mode",
609     "ENABLE_PLAYREADY=$enable_playready",
610     "ENABLE_VIDEO_CAPTURE_SERVICE=$enable_video_capture_service",
611     "ENABLE_VOLUME_TABLES_ACCESS=$enable_volume_tables_access",
612     "IS_ANDROID_THINGS=$is_android_things",
613     "IS_ANDROID_THINGS_NON_PUBLIC=$is_android_things_non_public",
614     "IS_CAST_AUDIO_ONLY=$is_cast_audio_only",
615     "IS_CAST_DESKTOP_BUILD=$is_cast_desktop_build",
616     "IS_CAST_USING_CMA_BACKEND=$is_cast_using_cma_backend",
617     "IS_SINGLE_VOLUME=$is_single_volume",
618     "SUPPORTS_MULTIZONE=$supports_multizone",
619     "USE_ANDROID_USER_AGENT=$use_android_user_agent",
620     "USE_CHROMECAST_CDMS=$use_chromecast_cdms",
621     "USE_ANDROID_THINGS_N=$build_for_android_things_n",
622   ]
623 }
624
625 if (is_android) {
626   generate_jni_registration("cast_shell_jni_registration") {
627     target = ":cast_shell_apk"
628     header_output = "$root_gen_dir/chromecast/android/${target_name}.h"
629   }
630
631   android_assets("cast_shell_apk_assets") {
632     assert(v8_use_external_startup_data)
633
634     sources = [
635       "$root_out_dir/assets/cast_shell.pak",
636     ]
637
638     deps = [
639       ":cast_shell_apk_locale_assets",
640       ":cast_shell_pak",
641       "//third_party/icu:icu_assets",
642       "//v8:v8_external_startup_data_assets",
643     ]
644     disable_compression = true
645   }
646
647   android_assets("cast_shell_apk_locale_assets") {
648     renaming_sources = []
649     renaming_destinations = []
650
651     foreach(locale, cast_locales) {
652       renaming_sources += [ "$root_out_dir/chromecast_locales/${locale}.pak" ]
653       renaming_destinations += [ "stored-locales/${locale}.pak" ]
654     }
655
656     deps = [
657       ":chromecast_locales_pak",
658     ]
659
660     treat_as_locale_paks = true
661     disable_compression = true
662   }
663
664   android_apk("cast_shell_apk") {
665     apk_name = "CastShell"
666     android_manifest = "$root_gen_dir/cast_shell_manifest/AndroidManifest.xml"
667     android_manifest_dep = "//chromecast/browser/android:cast_shell_manifest"
668
669     shared_libraries = [ "//chromecast/android:libcast_shell_android" ]
670
671     deps = [
672       ":cast_shell_apk_assets",
673       "//base:base_java",
674       "//chromecast/android:libcast_shell_android",
675       "//chromecast/browser/android:cast_shell_java",
676       "//third_party/crashpad/crashpad/handler:crashpad_handler_named_as_so",
677     ]
678
679     loadable_modules = [ "$root_out_dir/libcrashpad_handler.so" ]
680
681     command_line_flags_file = "castshell-command-line"
682     enable_multidex = true
683   }
684 }