Skip to content

Commit

Permalink
[fuchsia] Make CFv2 the default for tests.
Browse files Browse the repository at this point in the history
The default for `use_cfv2` is now `true`. Tests may opt-out by setting
it to `false.` Tests are still built/run as CFv1 components if:

- They use fuchsia.sys.Launcher (skia_unittests and gfx_unittests).
- They use additional_manifest_fragments (many).

These will be migrated to CFv2 as their fragments (and their respective
required capabilities) are migrated to CFv2.

Bug: 1256502
Change-Id: I3ef514d997da29bf4ce80d17b7afa57bbdb107e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3447303
Reviewed-by: Wez <wez@chromium.org>
Owners-Override: Wez <wez@chromium.org>
Commit-Queue: Greg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#968954}
  • Loading branch information
GregTho authored and Chromium LUCI CQ committed Feb 9, 2022
1 parent 2d51aac commit 5e4f41f
Show file tree
Hide file tree
Showing 35 changed files with 52 additions and 15 deletions.
1 change: 0 additions & 1 deletion base/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3783,7 +3783,6 @@ test("base_unittests") {
"//third_party/fuchsia-sdk/sdk/pkg/sys_cpp",
]

use_cfv2 = true
additional_manifest_fragments =
[ "//build/config/fuchsia/test/logger.shard.test-cml" ]
}
Expand Down
2 changes: 1 addition & 1 deletion build/config/fuchsia/generate_runner_scripts.gni
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ template("fuchsia_test_runner") {
]
}

if (defined(invoker.use_cfv2) && invoker.use_cfv2) {
if (!defined(invoker.use_cfv2) || invoker.use_cfv2) {
executable_args += [ "--component-version=2" ]
}

Expand Down
1 change: 1 addition & 0 deletions cc/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ cc_test("cc_unittests") {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/font_capabilities.test-cmx",

Expand Down
2 changes: 2 additions & 0 deletions chrome/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4130,6 +4130,7 @@ if (!is_android) {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/font_capabilities.test-cmx",
"//build/config/fuchsia/test/jit_capabilities.test-cmx",
Expand Down Expand Up @@ -8142,6 +8143,7 @@ test("unit_tests") {

data += [ "//testing/buildbot/filters/fuchsia.unit_tests.filter" ]

use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/font_capabilities.test-cmx",

Expand Down
2 changes: 2 additions & 0 deletions components/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ test("components_unittests") {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/font_capabilities.test-cmx",

Expand Down Expand Up @@ -883,6 +884,7 @@ if (!is_ios) {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/font_capabilities.test-cmx",
"//build/config/fuchsia/test/jit_capabilities.test-cmx",
Expand Down
1 change: 1 addition & 0 deletions components/cronet/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ if (is_android) {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments =
[ "//build/config/fuchsia/test/network_capabilities.test-cmx" ]
}
Expand Down
1 change: 1 addition & 0 deletions components/viz/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ viz_test("viz_unittests") {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments = [
# TODO(crbug.com/1185811): Figure out why jit_capabilities is needed.
"//build/config/fuchsia/test/jit_capabilities.test-cmx",
Expand Down
2 changes: 2 additions & 0 deletions content/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1879,6 +1879,7 @@ test("content_browsertests") {
if (is_fuchsia) {
use_test_server = true

use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/audio_capabilities.test-cmx",
"//build/config/fuchsia/test/font_capabilities.test-cmx",
Expand Down Expand Up @@ -2396,6 +2397,7 @@ test("content_unittests") {
"../browser/accessibility/browser_accessibility_fuchsia_unittest.cc",
"../browser/accessibility/browser_accessibility_manager_fuchsia_unittest.cc",
]
use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/font_capabilities.test-cmx",

Expand Down
4 changes: 0 additions & 4 deletions courgette/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,6 @@ test("courgette_unittests") {
]

data = [ "testdata/" ]

if (is_fuchsia) {
use_cfv2 = true
}
}

test("courgette_fuzz") {
Expand Down
1 change: 1 addition & 0 deletions extensions/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ test("extensions_unittests") {
]

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/jit_capabilities.test-cmx",
"//build/config/fuchsia/test/network_capabilities.test-cmx",
Expand Down
3 changes: 3 additions & 0 deletions fuchsia/engine/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ test("web_engine_browsertests") {
"//ui/gfx",
"//ui/ozone",
]
use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/jit_capabilities.test-cmx",
"//build/config/fuchsia/test/network_capabilities.test-cmx",
Expand Down Expand Up @@ -567,6 +568,7 @@ test("web_engine_unittests") {
"//third_party/fuchsia-sdk/sdk/pkg/scenic_cpp",
"//ui/ozone",
]
use_cfv2 = false
additional_manifest_fragments = [
# TODO(crbug.com/1185811): Figure out why jit_capabilities is needed.
"//build/config/fuchsia/test/jit_capabilities.test-cmx",
Expand Down Expand Up @@ -613,6 +615,7 @@ test("web_engine_integration_tests") {
":web_engine",
"web_engine",
] ]
use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/network_capabilities.test-cmx",
"//build/config/fuchsia/test/read_debug_data.test-cmx",
Expand Down
3 changes: 3 additions & 0 deletions fuchsia/runners/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ test("cast_runner_integration_tests") {
"web_engine",
],
]
use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/network_capabilities.test-cmx",
"//build/config/fuchsia/test/vulkan_capabilities.test-cmx",
Expand Down Expand Up @@ -269,6 +270,7 @@ test("cast_runner_browsertests") {
"//testing/gtest",
"//ui/ozone",
]
use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/jit_capabilities.test-cmx",
"//build/config/fuchsia/test/network_capabilities.test-cmx",
Expand Down Expand Up @@ -332,6 +334,7 @@ test("web_runner_integration_tests") {
"web_runner",
],
]
use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/network_capabilities.test-cmx",
"//build/config/fuchsia/test/vulkan_capabilities.test-cmx",
Expand Down
1 change: 1 addition & 0 deletions gin/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ test("gin_unittests") {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments = [
# TODO(crbug.com/1185811): Figure out why jit_capabilities is needed.
"//build/config/fuchsia/test/jit_capabilities.test-cmx",
Expand Down
5 changes: 2 additions & 3 deletions google_apis/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ template("google_apis_tmpl") {
"google_api_keys.h",
]

configs += [
":key_defines",
]
configs += [ ":key_defines" ]

deps = [
":oauth2_mint_token_consent_result_proto",
Expand Down Expand Up @@ -261,6 +259,7 @@ test("google_apis_unittests") {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments =
[ "//build/config/fuchsia/test/network_capabilities.test-cmx" ]
}
Expand Down
5 changes: 1 addition & 4 deletions headless/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -773,10 +773,6 @@ test("headless_unittests") {
}

configs += [ ":headless_defines_config" ]

if (is_fuchsia) {
use_cfv2 = true
}
}

if (is_mac) {
Expand Down Expand Up @@ -839,6 +835,7 @@ test("headless_browsertests") {
data_deps = [ "//testing/buildbot/filters:headless_browsertests_filters" ]

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/font_capabilities.test-cmx",

Expand Down
1 change: 0 additions & 1 deletion ipc/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ if (!is_ios) {
}

if (is_fuchsia) {
use_cfv2 = true
sources -= [
# No AF_UNIX domain sockets on Fuchsia.
"sync_socket_unittest.cc",
Expand Down
2 changes: 2 additions & 0 deletions media/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ test("media_unittests") {
"//media/fuchsia/cdm/service:unittests",
]

use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/audio_capabilities.test-cmx",

Expand Down Expand Up @@ -281,6 +282,7 @@ test("audio_unittests") {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments =
[ "//build/config/fuchsia/test/audio_capabilities.test-cmx" ]
}
Expand Down
1 change: 1 addition & 0 deletions media/capture/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ test("capture_unittests") {
"video/fuchsia/video_capture_device_factory_fuchsia_test.cc",
"video/fuchsia/video_capture_device_fuchsia_test.cc",
]
use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/web_engine_required_capabilities.test-cmx",
]
Expand Down
1 change: 1 addition & 0 deletions net/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4610,6 +4610,7 @@ test("net_unittests") {
"//third_party/fuchsia-sdk/sdk/pkg/fidl_cpp",
]
sources += [ "base/network_change_notifier_fuchsia_unittest.cc" ]
use_cfv2 = false
additional_manifest_fragments =
[ "//build/config/fuchsia/test/network_capabilities.test-cmx" ]
}
Expand Down
1 change: 1 addition & 0 deletions services/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ test("services_unittests") {
if (is_fuchsia) {
# Enable the test HTTP server for use by NetworkServiceTestWithService.*
use_test_server = true
use_cfv2 = false
additional_manifest_fragments = [
# TODO(crbug.com/1185811): Figure out why jit_capabilities is needed.
"//build/config/fuchsia/test/jit_capabilities.test-cmx",
Expand Down
4 changes: 4 additions & 0 deletions skia/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,10 @@ test("skia_unittests") {
}

if (is_fuchsia) {
# TODO(https://crbug.com/1287051): fuchsia.sys.Launcher is used to launch
# fuchsia-pkg://fuchsia.com/fonts#meta/fonts.cmx with specific test
# args.
use_cfv2 = false
sources += [ "ext/fontmgr_fuchsia_unittest.cc" ]
deps += [
"//third_party/fuchsia-sdk/sdk/fidl/fuchsia.fonts",
Expand Down
4 changes: 3 additions & 1 deletion testing/test.gni
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ if (is_android) {
# use_native_activity: Test implements ANativeActivity_onCreate().
# use_cfv2: (Fuchsia, optional): build the test as a framework v2 component;
# see https://fuchsia.dev/fuchsia-src/concepts/components/v2 for details.
# The default value is true; set it to false explicitly to build a test as
# a v1 component.
# is_xctest: (iOS, optional) whether to build the executable as XCTest.
# Similar to the GN arg 'enable_run_ios_unittests_with_xctest' but
# for build targets.
Expand Down Expand Up @@ -336,7 +338,7 @@ template("test") {
_pkg_target = "${_output_name}_pkg"
_exec_target = "${_output_name}__exec"

if (defined(invoker.use_cfv2) && invoker.use_cfv2) {
if (!defined(invoker.use_cfv2) || invoker.use_cfv2) {
# Generate a CML fragment that provides the program name.
_test_program_fragment_target = "${target_name}_program-fragment"
_test_program_fragment =
Expand Down
1 change: 1 addition & 0 deletions third_party/blink/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ test("blink_common_unittests") {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments = [
# TODO(crbug.com/1185811): Figure out why jit_capabilities is needed.
"//build/config/fuchsia/test/jit_capabilities.test-cmx",
Expand Down
1 change: 1 addition & 0 deletions third_party/blink/renderer/controller/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ test("blink_unittests") {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/font_capabilities.test-cmx",

Expand Down
1 change: 1 addition & 0 deletions third_party/blink/renderer/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,7 @@ test("blink_platform_unittests") {
if (is_fuchsia) {
# Oilpan reuses V8's v8::PageAllocator which generally requires JIT
# permissions.
use_cfv2 = false
additional_manifest_fragments =
[ "//build/config/fuchsia/test/jit_capabilities.test-cmx" ]
}
Expand Down
4 changes: 4 additions & 0 deletions third_party/blink/renderer/platform/heap/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ test("blink_heap_unittests") {
}

if (is_fuchsia) {
use_cfv2 = false

# Oilpan reuses V8's v8::PageAllocator which generally requires JIT
# permissions.
additional_manifest_fragments =
Expand Down Expand Up @@ -188,6 +190,8 @@ test("blink_heap_perftests") {
}

if (is_fuchsia) {
use_cfv2 = false

# Oilpan reuses V8's v8::PageAllocator which generally requires JIT
# permissions.
additional_manifest_fragments =
Expand Down
1 change: 1 addition & 0 deletions third_party/boringssl/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ if (build_with_chromium) {
deps += [ "//base/test:test_support" ]

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments =
[ "//build/config/fuchsia/test/network_capabilities.test-cmx" ]
}
Expand Down
1 change: 1 addition & 0 deletions ui/aura/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ test("aura_unittests") {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments =
[ "//build/config/fuchsia/test/present_view_capabilities.test-cmx" ]
}
Expand Down
1 change: 1 addition & 0 deletions ui/compositor/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ test("compositor_unittests") {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments = [
# TODO(crbug.com/1185811): Figure out why jit_capabilities is needed.
"//build/config/fuchsia/test/jit_capabilities.test-cmx",
Expand Down
4 changes: 4 additions & 0 deletions ui/gfx/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,10 @@ test("gfx_unittests") {
}

if (is_fuchsia) {
# TODO(https://crbug.com/1287051): fuchsia.sys.Launcher is used to launch
# fuchsia-pkg://fuchsia.com/fonts#meta/fonts.cmx with specific test
# args.
use_cfv2 = false
deps += [ "//skia:test_fonts" ]
}
}
Expand Down
1 change: 1 addition & 0 deletions ui/message_center/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ if (enable_message_center) {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/font_capabilities.test-cmx",
"//build/config/fuchsia/test/present_view_capabilities.test-cmx",
Expand Down
1 change: 1 addition & 0 deletions ui/snapshot/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ test("snapshot_unittests") {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments = [
# TODO(crbug.com/1185811): Figure out why jit_capabilities is needed.
"//build/config/fuchsia/test/jit_capabilities.test-cmx",
Expand Down
1 change: 1 addition & 0 deletions ui/views/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,7 @@ test("views_unittests") {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments = [
"//build/config/fuchsia/test/font_capabilities.test-cmx",

Expand Down
1 change: 1 addition & 0 deletions ui/views/examples/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ test("views_examples_unittests") {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments =
[ "//build/config/fuchsia/test/vulkan_capabilities.test-cmx" ]
}
Expand Down
1 change: 1 addition & 0 deletions ui/wm/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ test("wm_unittests") {
}

if (is_fuchsia) {
use_cfv2 = false
additional_manifest_fragments =
[ "//build/config/fuchsia/test/present_view_capabilities.test-cmx" ]
}
Expand Down

0 comments on commit 5e4f41f

Please sign in to comment.