123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785 |
- # Copyright 2015 The Chromium Authors. All rights reserved.
- # Use of this source code is governed by a BSD-style license that can be
- # found in the LICENSE file.
- import("//build/buildflag_header.gni")
- import("//build/config/features.gni")
- import("//build/config/sanitizers/sanitizers.gni")
- import("//build/config/ui.gni")
- import("//chromecast/build/tests/cast_test.gni")
- import("//chromecast/chromecast.gni")
- import("//chromecast/resource_sizes/chromecast_resource_sizes.gni")
- import("//media/media_options.gni")
- import("//tools/grit/repack.gni")
- import("//v8/gni/v8.gni")
- if (chromecast_branding != "public") {
- import("//chromecast/internal/chromecast_internal.gni")
- }
- if (is_android) {
- import("//build/config/android/rules.gni")
- import("//components/module_installer/android/module_desc_java.gni")
- }
- declare_args() {
- cast_test_extra_flags = ""
- vendor_cast_media_gtest_excludes = []
- }
- # Depends on all non-test targets that should be built by the Chromecast
- # internal build infrastructure.
- group("all") {
- data_deps = []
- deps = [ "//chromecast/build:archive" ]
- if (is_android) {
- if (chromecast_branding == "public") {
- deps += [ ":cast_shell_apk" ]
- } else {
- deps += [ ":cast_browser_bundle_module" ]
- }
- } else if (!is_fuchsia) {
- data_deps += [
- ":cast_browser",
- ":cast_shell",
- ]
- }
- if (is_linux) {
- deps += [ "//chromecast/tracing" ]
- }
- if (chromecast_branding != "public") {
- deps += [ "//chromecast/internal:all" ]
- }
- if (enable_external_mojo_services) {
- deps += [ "//chromecast/external_mojo/external_service_support:standalone_mojo_broker" ]
- }
- # No other targets should depend on this target, since it's just a convenience
- # target for the Chromecast internal build infrastructure.
- visibility = []
- testonly = true
- }
- # This is a config which is applied on all cast_* targets (which should be all
- # code under chromecast/).
- config("cast_config") {
- cflags = [ "-Wshadow" ]
- }
- config("iot_service") {
- if (iot_service_rpath != "") {
- ldflags = [ "-Wl,-rpath=${iot_service_rpath}" ]
- }
- }
- if (!is_fuchsia) {
- chromecast_resource_sizes_test("resource_sizes_chromecast") {
- data_deps = [
- ":cast_shell",
- ":cast_shell_pak",
- ":chromecast_locales_pak",
- ]
- }
- }
- # A list of all public test() binaries. This is an organizational target that
- # cannot be depended upon or built directly. Build cast_test_lists instead.
- cast_test_group("cast_tests") {
- filters = []
- tests = [
- "//base:base_unittests",
- "//cc:cc_unittests",
- "//chromecast/base:cast_base_unittests",
- "//chromecast/base/component:cast_component_unittests",
- "//chromecast/common:cast_common_unittests",
- "//chromecast/crypto:cast_crypto_unittests",
- "//chromecast/device/bluetooth:cast_bluetooth_unittests",
- "//chromecast/metrics:cast_metrics_unittest",
- "//chromecast/net:cast_net_unittests",
- "//chromecast/shared:cast_shared_unittests",
- "//chromecast/system/reboot:cast_reboot_unittests",
- "//components/viz:viz_unittests",
- "//crypto:crypto_unittests",
- "//media:media_unittests",
- "//media/midi:midi_unittests",
- "//net:net_unittests",
- "//sql:sql_unittests",
- "//storage:storage_unittests",
- "//ui/base:ui_base_unittests",
- ]
- if (!is_fuchsia) {
- tests += [
- "//chromecast/ui/display_settings:cast_display_settings_unittests",
- "//content/test:content_unittests",
- ]
- }
- if (!is_cast_audio_only) {
- tests += [ "//gpu:gpu_unittests" ]
- if (use_aura && !is_fuchsia) {
- tests += [ "//chromecast/graphics:cast_graphics_unittests" ]
- }
- }
- if (use_v4l2_codec) {
- tests += [ "//media/gpu:video_decode_accelerator_tests" ]
- }
- if (is_linux) {
- tests += [
- "//chromecast/crash:cast_crash_unittests",
- "//sandbox/linux:sandbox_linux_unittests",
- ]
- sandbox_linux_unittests_filter = {
- test_name = "sandbox_linux_unittests"
- # TODO(b/148974697): re-enable this.
- gtest_excludes = [ "BaselinePolicy.SystemEperm" ]
- }
- filters += [ sandbox_linux_unittests_filter ]
- }
- # TODO(crbug/1319009): `media_use_ffmpeg` should not largely affect top-level
- # test list. Better create another flag to do this or handle the ffmpeg flag
- # in //chromecast/media/cma/decoder.
- if (media_use_ffmpeg && !is_fuchsia) {
- tests += [
- "//chromecast/cast_core:cast_cast_core_unittests",
- "//chromecast/media:cast_media_unittests",
- ]
- cast_media_unittests_filter = {
- test_name = "cast_media_unittests"
- gtest_excludes = vendor_cast_media_gtest_excludes
- # --test-launcher-jobs=1 => so internal code can bind to port
- args = [ "--test-launcher-jobs=1" ]
- }
- filters += [ cast_media_unittests_filter ]
- }
- if (is_linux) {
- tests += [ "//chromecast/media/cma/backend:cast_audio_backend_unittests" ]
- cast_audio_backend_unittests_filter = {
- test_name = "cast_audio_backend_unittests"
- # --test-launcher-jobs=1 => so mixer service receiver can bind.
- args = [
- "--test-launcher-jobs=1",
- "--mixer-service-endpoint=/tmp/cast_audio_backend_unittest-mixer",
- "--mixer-service-port=12855",
- ]
- }
- filters += [ cast_audio_backend_unittests_filter ]
- }
- if (is_android) {
- tests += [ "//chromecast/media/cma/backend/android:cast_android_cma_backend_unittests" ]
- }
- if (!is_android && !is_fuchsia) {
- tests += [
- "//ipc:ipc_tests",
- "//url:url_unittests",
- ]
- if (media_use_ffmpeg) {
- tests += [
- ":cast_shell_browsertests",
- ":cast_shell_unittests",
- ]
- cast_shell_browsertests_filter = {
- test_name = "cast_shell_browsertests"
- # --enable-local-file-accesses => to load sample media files
- # --test-launcher-jobs=1 => so internal code can bind to port
- args = [
- "--no-sandbox",
- "--enable-local-file-accesses",
- "--test-launcher-jobs=1",
- "--enable-hardware-overlays=",
- ]
- gtest_excludes = []
- # TODO(b/112440248): This test was failing:
- # * On v1 and Cast Audio devices since 2017-03-15.
- # * On desktop builds since 2018-08-22
- # Also see: b/36238710, b/36239051, hotlist/461351
- gtest_excludes += [ "RendererPrelauncherTest.ReusedRenderer" ]
- if (!is_cast_desktop_build) {
- args += [ "--use-gpu-in-tests" ]
- # TODO(derekjchow): Make these tests pass on Chromecast devices.
- # Once all of the CastMediaBlockerTest.* have been un-DISABLEd and
- # are running successfully, revisit these tests and see if they pass
- # on devices. (crbug/665118, internal b/32023194)
- gtest_excludes += [
- "CastMediaBlockerBrowserTest.Video_BlockUnblock",
- "CastMediaBlockerBrowserTest.Audio_BlockUnblock",
- # This browser test can only be run inside of a source checkout.
- "CastWebContentsBrowserTest.*",
- ]
- }
- if (!is_cast_desktop_build && !is_cast_audio_only &&
- !enable_assistant) {
- # TODO(mbjorge): The VideoPlaybackMp4 test is failing on v1 devices.
- # Temporarily disable it as part of an effort to re-green the unittests.
- # Re-enable once the tests have been fixed. Limitations in the filter
- # system mean this is getting temporarily disabled on all video devices,
- # though it is only failing on v1.
- # b/36723698, hotlist/461351
- gtest_excludes += [ "CastNavigationBrowserTest.VideoPlaybackMp4" ]
- }
- # TODO(mbjorge): Temporarily disable AudioPlaybackWavPcm because it is
- # failing on device. As part of an effort to re-green the unittests,
- # current (2017-03-15) failures are being disabled to get back to a
- # green state. Re-enable once the tests have been fixed.
- # b/36239152, hotlist/461351
- if (enable_assistant && !is_cast_desktop_build) {
- gtest_excludes += [ "CastNavigationBrowserTest.AudioPlaybackWavPcm" ]
- }
- }
- filters += [ cast_shell_browsertests_filter ]
- }
- ipc_tests_filter = {
- test_name = "ipc_tests"
- # --test-launcher-jobs=1 => so internal code can bind to port
- args = [ "--test-launcher-jobs=1" ]
- }
- filters += [ ipc_tests_filter ]
- url_unittests_filter = {
- test_name = "url_unittests"
- if (target_os == "linux" && !is_cast_desktop_build) {
- # DoAppendUTF8Invalid fails because of dcheck_always_on flag in Eng builds
- gtest_excludes = [ "URLCanonTest.DoAppendUTF8Invalid" ]
- }
- }
- filters += [ url_unittests_filter ]
- }
- base_unittests_filter = {
- test_name = "base_unittests"
- gtest_excludes = []
- if (target_os == "linux") {
- if (is_cast_desktop_build) {
- # Disable PartitionAllocDeathTest.* (b/67975693)
- gtest_excludes += [ "PartitionAllocDeathTest.*" ]
- } else {
- # Disable ProcessMetricsTest.GetNumberOfThreads (b/15610509)
- # Disable ProcessUtilTest.* (need to define OS_ANDROID)
- # Disable StackContainer.BufferAlignment (don't support 16-byte alignment)
- # Disable SystemMetrics2Test.GetSystemMemoryInfo (buffers>0 can't be guaranteed)
- # Disable PostTasksViaTaskRunner/* to green up devices (b/62246873)
- # Disable WorkerDetaches to green up devices (b/62246873)
- gtest_excludes += [
- "ProcessMetricsTest.GetNumberOfThreads",
- "ProcessUtilTest.*",
- "StackContainer.BufferAlignment",
- "SystemMetrics2Test.GetSystemMemoryInfo",
- "OneTraitsExecutionModePair/ThreadPoolImplTest.PostTasksViaTaskRunner/*",
- "TaskSchedulerWorkerTest.WorkerDetaches",
- ]
- }
- if (is_cast_audio_only) {
- # Also disable TimeFormattingTest on audio-only builds, since we don't
- # include the necessary info in icudtl.dat.
- gtest_excludes += [ "TimeFormattingTest.*" ]
- }
- }
- }
- filters += [ base_unittests_filter ]
- cc_unittests_filter = {
- test_name = "cc_unittests"
- # Temporarily disable all test cases (b/113324890)
- gtest_excludes = [ "*" ]
- if (!is_cast_desktop_build) {
- #Disable ToColorSpace/ColorTransformPixelTest* (b/64346790)
- #Disable ImageBackgroundFilter* (b/64346875)
- #Disable LayerTreeHostTilesTestPartialInvalidation* (b/65844132)
- gtest_excludes += [
- "ToColorSpace/ColorTransformPixelTest.*",
- "ImageBackgroundFilter.*",
- "LayerTreeHostTilesTestPartialInvalidation.*",
- ]
- }
- }
- filters += [ cc_unittests_filter ]
- viz_unittests_filter = {
- test_name = "viz_unittests"
- # TODO(crbug.com/1338342): Make these tests pass.
- gtest_excludes = [
- "PromotedTrueFalse/MultiUnderlayPromotedTest.UnderlaysBlendPrimaryPlane/0",
- "UnderlayCastTest.BlackOutsideOverlayContentBounds",
- "UnderlayCastTest.FullScreenOverlayContentBounds",
- "UnderlayCastTest.OverlayOccludedContentBounds",
- "UnderlayCastTest.OverlayOccludedUnionContentBounds",
- "UnderlayCastTest.OverlayPromotionWithMaskFilter",
- "UnderlayCastTest.ReplacementQuad",
- "UnderlayCastTest.RoundContentBounds",
- "UnderlayCastTest.RoundOverlayContentBounds",
- ]
- }
- filters += [ viz_unittests_filter ]
- # content_unittests are not run on Fuchsia.
- if (!is_fuchsia) {
- content_unittests_filter = {
- test_name = "content_unittests"
- # IsSupportedVideoConfig_VP9TransferFunctions fails on all cast builds since
- # the cast IsSupportedVideoConfigs ignore the transfer function parameter.
- # (b/36984215).
- gtest_excludes = [ "*.IsSupportedVideoConfig_VP9TransferFunctions" ]
- if (target_os == "linux" && !is_cast_desktop_build) {
- # DesktopCaptureDeviceTest.*: No capture device on Eureka
- # Disable PepperGamepadHostTest.WaitForReply (pepper not supported on Eureka)
- # Disable RenderWidgetHostTest.Background because we disable the
- # blacklist to enable WebGL (b/16142554)
- gtest_excludes += [
- "LegacyDomStorageDatabaseTest.TestCanOpenAndReadWebCoreDatabase",
- "DesktopCaptureDeviceTest.Capture",
- "GamepadProviderTest.PollingAccess",
- "PepperGamepadHostTest.WaitForReply",
- "RenderWidgetHostTest.Background",
- ]
- }
- if (is_cast_audio_only) {
- # No way to display URL's on audio only cast devices.
- gtest_excludes += [ "NavigationEntryTest.NavigationEntryURLs" ]
- }
- if (enable_assistant && !is_cast_desktop_build) {
- # Temporarily disable DefaultConstructor on assistant device builds. Cause
- # of failure is unclear, but it's highly likely it's related to them being
- # DEATH tests. These were passing until the is_official_build flag was
- # enabled. These tests are considered non-critical in this context.
- # (b/62469368)
- gtest_excludes += [ "WebBluetoothDeviceIdTest.DefaultConstructor" ]
- }
- }
- filters += [ content_unittests_filter ]
- }
- media_unittests_filter = {
- test_name = "media_unittests"
- if (target_os == "linux" && !is_cast_desktop_build) {
- # Disable VP9 related tests (b/18593324)
- # PipelineIntegrationTest.BasicPlayback_MediaSource_VP9_WebM
- # PipelineIntegrationTest.BasicPlayback_VideoOnly_VP9_WebM
- # PipelineIntegrationTest.BasicPlayback_VP9*
- # PipelineIntegrationTest.P444_VP9_WebM
- # Disable VP8A tests (b/18593324)
- # PipelineIntegrationTest.BasicPlayback_VP8A*
- # Disable OpusAudioDecoderTest/AudioDecoderTest.ProduceAudioSamples/0 (unit
- # test fails when Opus decoder uses fixed-point)
- # Due to b/16456550, disable the following four test cases:
- # AudioOutputControllerTest.PlayDivertSwitchDeviceRevertClose
- # AudioOutputControllerTest.PlaySwitchDeviceClose
- # AudioStreamHandlerTest.Play
- # SoundsManagerTest.Play
- # Disable AudioStreamHandlerTest.ConsecutivePlayRequests (b/16539293)
- gtest_excludes = [
- "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",
- ]
- } else if (target_os == "android" || is_cast_desktop_build) {
- # Disable PipelineIntegrationTest.BasicPlayback_MediaSource_VP9_WebM (not supported)
- gtest_excludes =
- [ "PipelineIntegrationTest.BasicPlayback_MediaSource_VP9_WebM" ]
- }
- }
- filters += [ media_unittests_filter ]
- net_unittests_filter = {
- test_name = "net_unittests"
- if (using_sanitizer) {
- # TODO(mbjorge): net_unittests do not complete when run with sanitizers,
- # (in particular, TSAN and UBSAN), resulting in build machines getting stuck
- # for many hours. Disable them for now, since these are getting run on
- # Chromium bots anyway. (internal b/31279943)
- gtest_excludes = [ "*" ]
- } else if (target_os == "linux" && !is_cast_desktop_build) {
- # Run net_unittests first to avoid random failures due to slow python startup
- # PacFileFetcherImplTest.HttpMimeType is flaking (b/19848784)
- # Running a batch of net_unittests has high overhead. Run tests in batches of 50 to reduce number of batches (b/23156294).
- gtest_excludes = [ "PacFileFetcherImplTest.HttpMimeType" ]
- args = [ "--test-launcher-batch-limit=50" ]
- } else if (is_cast_desktop_build || target_os == "android") {
- # CTLogVerifierTest.VerifiesValidConsistencyProofsFromReferenceGenerator
- # times out occasionally, paricularly on the CQ bots; disable to reduce
- # CQ flakiness (crbug/598406) (b/29415636).
- # Running a batch of net_unittests has high overhead, so
- # run tests in batches of 25 to reduce number of batches (b/23156294).
- gtest_excludes = [ "CTLogVerifierTest.VerifiesValidConsistencyProofsFromReferenceGenerator" ]
- args = [ "--test-launcher-batch-limit=25" ]
- }
- }
- filters += [ net_unittests_filter ]
- }
- # Creates the build and run lists for all test targets.
- cast_test_group_list("cast_test_lists") {
- build_list_path = "$root_out_dir/tests/build_test_list.txt"
- runtime_deps_path = "$root_out_dir/tests/runtime_deps.json"
- run_list_path = "$root_out_dir/tests/run_test_list.txt"
- additional_options = [
- "--ozone-platform=headless --test-launcher-bot-mode $cast_test_extra_flags",
- ]
- test_groups = [ ":cast_tests" ]
- if (chromecast_branding != "public") {
- test_groups += internal_cast_test_groups
- }
- }
- if (is_android) {
- cast_test_group("cast_junit_tests") {
- test_type = "junit"
- tests = [
- "//base:base_junit_tests",
- "//chromecast/base:cast_base_junit_tests",
- "//chromecast/browser/android:cast_shell_junit_tests",
- "//content/public/android:content_junit_tests",
- "//net/android:net_junit_tests",
- "//testing/android/junit:junit_unit_tests",
- "//ui/android:ui_junit_tests",
- ]
- }
- cast_test_group_list("cast_junit_test_lists") {
- test_type = "junit"
- build_list_path = "$root_out_dir/junit/build_junit_test_list.txt"
- runtime_deps_path = "$root_out_dir/junit/runtime_deps.json"
- run_list_path = "$root_out_dir/junit/run_junit_test_list.txt"
- test_groups = [ ":cast_junit_tests" ]
- if (chromecast_branding != "public") {
- test_groups += [ "//chromecast/internal:internal_cast_junit_tests" ]
- }
- }
- }
- if (!is_fuchsia) {
- test("cast_shell_unittests") {
- deps = [
- ":cast_shell_lib",
- "//chromecast/app:test_support",
- "//chromecast/app:unittests",
- "//chromecast/browser:unittests",
- "//ui/gl:test_support",
- ]
- }
- test("cast_shell_browsertests") {
- deps = [
- # These browser tests always use the simple implementation, since we only
- # need to test web content primitives and not all of Cast receiver.
- ":cast_shell_lib_simple",
- "//chromecast/app:test_support",
- "//chromecast/bindings:browsertests",
- "//chromecast/browser:browsertests",
- ]
- data_deps = [ ":chromecast_locales_pak" ]
- }
- group("cast_shell_lib") {
- if (chromecast_branding != "public") {
- deps = [
- ":cast_shell_lib_base",
- "//chromecast/internal/shell",
- ]
- } else {
- deps = [ ":cast_shell_lib_simple" ]
- }
- }
- group("cast_shell_lib_base") {
- data_deps = [ ":cast_shell_pak" ]
- deps = [
- "//chromecast/app",
- "//chromecast/base:default_create_sys_info",
- "//chromecast/browser",
- "//chromecast/common",
- "//chromecast/renderer",
- "//chromecast/utility",
- ]
- }
- group("cast_shell_lib_simple") {
- deps = [
- "//chromecast/browser:prefs_simple",
- "//chromecast/browser:simple_main_parts",
- "//chromecast/utility:simple_client",
- ]
- if (enable_cast_media_runtime) {
- deps += [ "//chromecast/cast_core:core_runtime_lib_simple" ]
- } else {
- deps += [
- ":cast_shell_lib_base",
- "//chromecast/browser:simple_client",
- "//chromecast/renderer:simple_client",
- ]
- }
- }
- cast_executable("cast_shell") {
- sources = [ "app/cast_main.cc" ]
- deps = [
- ":cast_shell_lib",
- ":chromecast_locales_pak",
- "//chromecast/app",
- "//content/public/app",
- "//third_party/widevine/cdm",
- ]
- }
- cast_executable("cast_browser") {
- sources = [ "app/cast_main.cc" ]
- deps = [
- ":cast_shell_lib_simple",
- ":chromecast_locales_pak",
- "//chromecast/app",
- "//content/public/app",
- "//third_party/widevine/cdm",
- ]
- }
- repack("cast_shell_pak") {
- sources = [
- "$root_gen_dir/chromecast/app/shell_resources.pak",
- "$root_gen_dir/components/cast/named_message_port_connector/named_message_port_connector_resources.pak",
- "$root_gen_dir/content/content_resources.pak",
- "$root_gen_dir/content/dev_ui_content_resources.pak",
- "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
- "$root_gen_dir/net/net_resources.pak",
- "$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
- "$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_100_percent.pak",
- "$root_gen_dir/third_party/blink/public/strings/blink_strings_en-US.pak",
- "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
- "$root_gen_dir/ui/resources/webui_generated_resources.pak",
- "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
- "$root_gen_dir/ui/strings/ax_strings_en-US.pak",
- "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
- ]
- output = "$root_out_dir/assets/cast_shell.pak"
- deps = [
- "//chromecast/app:resources",
- "//components/cast/named_message_port_connector:resources",
- "//content:content_resources",
- "//content:dev_ui_content_resources",
- "//mojo/public/js:resources",
- "//net:net_resources",
- "//third_party/blink/public:resources",
- "//third_party/blink/public:scaled_resources_100_percent",
- "//third_party/blink/public/strings",
- "//ui/resources",
- "//ui/strings",
- ]
- }
- # Intermediate targets that repack grit resources by locale. For each locale
- # in |cast_locales| (see //chromecast/chromecast.gni), all resources
- # are packed into a single .pak file in an output directory. These targets
- # should not be depended on directly; depend on ":chromecast_locales_pak"
- # instead.
- foreach(locale, cast_locales) {
- repack("_cast_repack_${locale}") {
- visibility = [ ":chromecast_locales_pak" ]
- output = "$root_out_dir/chromecast_locales/${locale}.pak"
- sources =
- [ "$root_gen_dir/chromecast/app/chromecast_settings_${locale}.pak" ]
- deps = [ "//chromecast/app:chromecast_settings" ]
- if (chromecast_branding != "public") {
- sources += [
- "$root_gen_dir/chromecast/internal/castui/app_strings_${locale}.pak",
- ]
- deps += [ "//chromecast/internal/castui:cast_ui_app_strings" ]
- if (enable_chromecast_webui) {
- sources += [ "$root_gen_dir/chromecast/internal/castui/ui_localized_${locale}.pak" ]
- deps += [ "//chromecast/internal/castui:cast_ui_localized" ]
- }
- }
- }
- }
- # A meta-target which repacks resources by locale.
- group("chromecast_locales_pak") {
- data_deps = []
- foreach(locale, cast_locales) {
- data_deps += [ ":_cast_repack_${locale}" ]
- }
- }
- } # !is_fuchsia
- buildflag_header("chromecast_buildflags") {
- header = "chromecast_buildflags.h"
- _command_line_flags = string_join(",", default_command_line_flags)
- flags = [
- "DEFAULT_COMMAND_LINE_FLAGS=\"$_command_line_flags\"",
- "DISABLE_SECURE_FLAC_OPUS_DECODING=$disable_secure_flac_and_opus_decoding",
- "ENABLE_ASSISTANT=$enable_assistant",
- "ENABLE_CHROMECAST_WEBUI=$enable_chromecast_webui",
- "ENABLE_EXTERNAL_MOJO_SERVICES=$enable_external_mojo_services",
- "ENABLE_PLAYREADY=$enable_playready",
- "ENABLE_VIDEO_CAPTURE_SERVICE=$enable_video_capture_service",
- "IS_CAST_AUDIO_ONLY=$is_cast_audio_only",
- "IS_CAST_DESKTOP_BUILD=$is_cast_desktop_build",
- "USE_ANDROID_USER_AGENT=$use_android_user_agent",
- "USE_CHROMECAST_CDMS=$use_chromecast_cdms",
- "ENABLE_CHROMIUM_RUNTIME_CAST_RENDERER=$enable_chromium_runtime_cast_renderer",
- "ENABLE_CAST_MEDIA_RUNTIME=$enable_cast_media_runtime",
- ]
- }
- if (is_android) {
- generate_jni_registration("cast_shell_jni_registration") {
- targets = [ ":cast_shell_apk" ]
- if (chromecast_branding != "public") {
- targets += [ ":cast_browser_bundle_module" ]
- }
- header_output = "$root_gen_dir/chromecast/android/${target_name}.h"
- }
- android_assets("cast_shell_apk_assets") {
- sources = [ "$root_out_dir/assets/cast_shell.pak" ]
- deps = [
- ":cast_shell_apk_locale_assets",
- ":cast_shell_pak",
- "//third_party/icu:icu_assets",
- "//v8:v8_external_startup_data_assets",
- ]
- disable_compression = true
- }
- android_assets("cast_shell_apk_locale_assets") {
- renaming_sources = []
- renaming_destinations = []
- foreach(locale, cast_locales) {
- renaming_sources += [ "$root_out_dir/chromecast_locales/${locale}.pak" ]
- renaming_destinations += [ "stored-locales/${locale}.pak" ]
- }
- deps = [ ":chromecast_locales_pak" ]
- treat_as_locale_paks = true
- disable_compression = true
- }
- android_apk("cast_shell_apk") {
- enable_lint = true
- lint_baseline_file = "android/lint-baseline.xml"
- lint_suppressions_file = "android/lint-suppressions.xml"
- apk_name = "CastShell"
- android_manifest = "$root_gen_dir/cast_shell_manifest/AndroidManifest.xml"
- android_manifest_dep = "//chromecast/browser/android:cast_shell_manifest"
- min_sdk_version = 23
- target_sdk_version = 33
- shared_libraries = [ "//chromecast/android:libcast_shell_android" ]
- deps = [
- ":cast_shell_apk_assets",
- "//base:base_java",
- "//base:jni_java",
- "//build/android:build_java",
- "//chromecast/android:libcast_shell_android",
- "//chromecast/browser/android:cast_shell_java",
- "//components/crash/core/app:chrome_crashpad_handler_named_as_so",
- ]
- loadable_modules = [ "$root_out_dir/libchrome_crashpad_handler.so" ]
- command_line_flags_file = "castshell-command-line"
- enable_multidex = true
- }
- if (chromecast_branding != "public") {
- android_app_bundle_module("cast_browser_bundle_module") {
- is_base_module = false
- base_module_target = "//chromecast/internal/service/main/android:cast_service_bundle_module"
- android_manifest =
- "$root_gen_dir/cast_browser_manifest/AndroidManifest.xml"
- android_manifest_dep =
- "//chromecast/browser/android:cast_browser_manifest"
- min_sdk_version = 23
- target_sdk_version = 33
- package_name = "cast_browser"
- # |package_id| is required because the default one conflicts with the base
- # modules' ID (0x7f).
- package_id = 125
- shared_libraries = [ "//chromecast/android:libcast_browser_android" ]
- deps = [
- "//base:base_java",
- "//base:jni_java",
- "//build/android:build_java",
- "//chromecast/browser/android:cast_browser_java",
- "//components/crash/core/app:chrome_crashpad_handler_named_as_so",
- "//components/viz/service:service_java",
- "//third_party/crashpad/crashpad/handler:crashpad_handler_trampoline",
- ]
- loadable_modules = [
- "$root_out_dir/libchrome_crashpad_handler.so",
- "$root_out_dir/libcrashpad_handler_trampoline.so",
- ]
- # TODO(b/228506503): remove the exclusion rule after cast_service and
- # cast_browser depend on different resource targets.
- resource_exclusion_regex = "cast_web_contents_activity.xml"
- enable_multidex = true
- # TODO(b/222780347): Enable when compile errors are resolved on release
- # builds.
- proguard_enabled = false
- generate_native_libraries_java = true
- }
- }
- }
|