| # Copyright 2019 The Fuchsia 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("generate_chromium_targets.gni") |
| |
| # Set the default visibility after importing the targets above so that those |
| # targets must set visibility from scratch and to ensure that no unscoped |
| # visibility leaks into this file. |
| visibility = [ ":*" ] |
| |
| # This target is provided per |
| # https://fuchsia.dev/fuchsia-src/development/source_code/layout?hl=en#canonical_targets |
| # for use by //src:src* targets. Dependencies on Chromium-supplied packages |
| # should reference specific package(s). |
| group("chromium") { |
| visibility += [ "//src:*" ] |
| } |
| |
| generate_chrome_browser_targets("chromium") { |
| } |
| |
| # The other targets are more complex to configure for historical reasons. |
| |
| archive_path_suffix = "" |
| |
| # TODO(crbug.com/1385930): Change this to "chromium.org". |
| # Also override or templatize `./config/web_context_provider.core_shard.cml. |
| repository = "fuchsia.com" |
| |
| declare_args() { |
| # Whether to use the most recent (canary) version of prebuilt Chromium |
| # components. Otherwise, the qualified "release" version is used. |
| # For scenarios where CastRunner is used, |
| # [`use_cast_runner_canary`](#use_cast_runner_canary) must be set to the same |
| # value. |
| # TODO(crbug.com/1065707): Uncomment this once the .gni file is no longer |
| # using it. |
| # use_chromium_canary = false |
| } |
| |
| # TODO(fxbug.dev/70573): Replace with solution that does not rely on GN args. |
| # Consider abstracting the `_pkg` aspect of the target name. |
| if (use_chromium_canary) { |
| package_flavor_selections += [ |
| { |
| name = "web_engine_pkg" |
| flavor = "canary" |
| }, |
| { |
| name = "web_engine_shell_pkg" |
| flavor = "canary" |
| }, |
| ] |
| } |
| |
| generate_fuchsia_web_targets("chromium") { |
| } |
| |
| generate_fuchsia_web_test_targets("chromium") { |
| } |
| |
| # TODO(fxbug.dev/70573, fxbug.dev/119526): Replace with a solution that |
| # does not rely on GN args. |
| if (use_chromium_canary) { |
| _flavor_suffix = "_latest" |
| } else { |
| _flavor_suffix = "" |
| } |
| |
| if (is_host) { |
| if (is_linux && host_cpu == "x64") { |
| generate_host_targets("chromium") { |
| archive_path_suffix = "${archive_path_suffix}${_flavor_suffix}" |
| } |
| } |
| } else { |
| generate_test_targets("chromium") { |
| archive_path_suffix = "${archive_path_suffix}${_flavor_suffix}" |
| } |
| } |
| |
| # A set of dependencies required to run most Chromium prebuilt tests. |
| # Chromium tests are not currently hermetic. A small number of "system tests" |
| # use only services from the actual system. The rest launch a small number of |
| # fakes. Depending on this target from a `prebuilt_test_manifest()` instance |
| # ensures that they are available. |
| group("chromium_test_base_deps") { |
| testonly = true |
| visibility += [ |
| # See //products/terminal.gni. |
| "//:legacy_cache_packages", |
| |
| # Allow uses not known to this file. |
| "//vendor/*", |
| ] |
| |
| # Fake services needed by Chromium tests until subpackages are supported OOT |
| # and fakes are provided with the SDK. See crbug.com/1326674. |
| # TODO(crbug.com/1408597): Remove once the Chromium tests package the fakes. |
| deps = [ |
| "//src/developer/build_info/testing:fake-build-info", |
| |
| # archivist-for-embedding is needed by |
| # WebEngineIntegrationLoggingTest.SetJavaScriptLogLevel_DEBUG. |
| # TODO(crbug.com/1451376): Move it to a peer group as appropriate. |
| "//src/diagnostics/archivist:archivist-for-embedding", |
| "//src/testing/fidl/intl_property_manager", |
| |
| # A font provider with built-in font file assets. |
| # TODO(crbug.com/1408597): Once OOT fakes are available, this can be |
| # turned into a hermetic component, or a subpackage. |
| "//src/fonts:fonts_hermetic_for_test", |
| |
| # A font provider without built-in font file assets. |
| "//src/fonts:fonts_configurable_for_test", |
| ] |
| } |