Skip to content

Commit

Permalink
[Fuchsia] Transition remaining test suites to use manifest fragments
Browse files Browse the repository at this point in the history
Add manifest fragment audio_capabilities.test-cmx
Deprecate and remove old test cmx files.

Bug: 1180168
Change-Id: I726ab54d14145f03f4f09ec8447b84c4997763b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2795420
Commit-Queue: Chong Gu <chonggu@google.com>
Reviewed-by: David Dorwin <ddorwin@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Adam Langley <agl@chromium.org>
Reviewed-by: John Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#869737}
  • Loading branch information
Chong Gu authored and Chromium LUCI CQ committed Apr 6, 2021
1 parent 3d853a5 commit 50c8339
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 179 deletions.
4 changes: 2 additions & 2 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ if (is_fuchsia) {
cr_fuchsia_package("d8_fuchsia_pkg") {
testonly = true
binary = "//v8:d8"
manifest = "//build/config/fuchsia/tests-with-exec.cmx"
manifest = "//v8/gni/v8.cmx"
package_name_override = "d8"
}

Expand Down Expand Up @@ -1238,7 +1238,7 @@ if (!is_ios) {
root_build_dir) + ")" ] + _common_web_test_args -
[ _common_web_test_args[0] ]
if (is_asan) {
args += [ "--time-out-ms=30000" ]
args += [ "--time-out-ms=30000" ]
}
args += [
"--webgpu-cts-expectations",
Expand Down
30 changes: 0 additions & 30 deletions base/fuchsia/base_unittests.test-cmx

This file was deleted.

6 changes: 5 additions & 1 deletion build/config/fuchsia/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ https://fuchsia.dev/reference/fidl/fuchsia.web#CreateContextParams and
https://fuchsia.dev/reference/fidl/fuchsia.web#ContextFeatureFlags.
Any test-specific exceptions are documented for each file.

#### audio_capabilities.test-cmx
Corresponds to the `AUDIO` flag. Required for enabling audio input and output.

#### network_capabilities.test-cmx
Corresponds to the `NETWORK` flag. Required for enabling network access. Note
that access to the root SSL certificates is not needed if ContextProvider is
used to launch the `Context`.
used to launch the `Context`. The `fuchsia.device.NameProvider` dependency comes
from fdio.

#### present_view_capabilities.test-cmx
Services that are needed to render web content in a Scenic view and present it.
Expand Down
18 changes: 18 additions & 0 deletions build/config/fuchsia/test/audio_capabilities.test-cmx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"facets": {
"fuchsia.test": {
"injected-services": {
"fuchsia.mediacodec.CodecFactory": "fuchsia-pkg://fuchsia.com/codec_factory#meta/codec_factory.cmx"
},
"system-services": [
"fuchsia.media.Audio"
]
}
},
"sandbox": {
"services": [
"fuchsia.media.Audio",
"fuchsia.mediacodec.CodecFactory"
]
}
}
6 changes: 5 additions & 1 deletion build/config/fuchsia/test/network_capabilities.test-cmx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
"fuchsia.net.interfaces.State": "fuchsia-pkg://fuchsia.com/netstack#meta/netstack.cmx",
"fuchsia.posix.socket.Provider": "fuchsia-pkg://fuchsia.com/netstack#meta/netstack.cmx"
}
}
},
"system-services": [
"fuchsia.device.NameProvider"
]
},
"sandbox": {
"features": [
"root-ssl-certificates"
],
"services": [
"fuchsia.device.NameProvider",
"fuchsia.net.NameLookup",
"fuchsia.net.interfaces.State",
"fuchsia.posix.socket.Provider"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"fuchsia.web.ContextProvider": "fuchsia-pkg://fuchsia.com/web_engine#meta/context_provider.cmx",
},
"system-services": [
"fuchsia.device.NameProvider",
"fuchsia.scheduler.ProfileProvider",
"fuchsia.sysmem.Allocator"
]
Expand Down
44 changes: 0 additions & 44 deletions build/config/fuchsia/tests-with-exec.cmx

This file was deleted.

42 changes: 0 additions & 42 deletions build/config/fuchsia/tests.cmx

This file was deleted.

2 changes: 2 additions & 0 deletions fuchsia/http/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ test("http_service_tests") {
"//testing/gtest",
]
data = [ "testdata/" ]
additional_manifest_fragments =
[ "//build/config/fuchsia/test/network_capabilities.test-cmx" ]
}

if (is_official_build) {
Expand Down
2 changes: 1 addition & 1 deletion headless/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ if (is_fuchsia) {
cr_fuchsia_package("headless_shell_pkg") {
binary = ":headless_shell"
package_name_override = "headless_shell"
manifest = "//build/config/fuchsia/tests.cmx"
manifest = "//build/config/fuchsia/test/minimum_capabilities.test-cmx"
}

fuchsia_package_runner("headless_shell_fuchsia") {
Expand Down
11 changes: 7 additions & 4 deletions media/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,14 @@ test("media_unittests") {
}

if (is_fuchsia) {
deps += [
"//media/fuchsia/audio:unittests",
"//media/fuchsia/cdm/service:unittests",
additional_manifest_fragments = [
"//build/config/fuchsia/test/audio_capabilities.test-cmx",

# TODO(crbug.com/1185811): Figure out why jit_capabilities is needed.
"//build/config/fuchsia/test/jit_capabilities.test-cmx",

"//build/config/fuchsia/test/vulkan_capabilities.test-cmx",
]
manifest = "//media/fuchsia/media_unittests.test-cmx"
}

if (enable_media_remoting) {
Expand Down
5 changes: 5 additions & 0 deletions media/blink/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,9 @@ test("media_blink_unittests") {
deps += [ "//v8:v8_external_startup_data_assets" ]
}
}

if (is_fuchsia) {
additional_manifest_fragments =
[ "//build/config/fuchsia/test/jit_capabilities.test-cmx" ]
}
}
42 changes: 0 additions & 42 deletions media/fuchsia/media_unittests.test-cmx

This file was deleted.

2 changes: 2 additions & 0 deletions net/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4629,6 +4629,8 @@ test("net_unittests") {
"//third_party/fuchsia-sdk/sdk/pkg/fidl_cpp",
]
sources += [ "base/network_change_notifier_fuchsia_unittest.cc" ]
additional_manifest_fragments =
[ "//build/config/fuchsia/test/network_capabilities.test-cmx" ]
}

if (use_nss_certs) {
Expand Down
14 changes: 2 additions & 12 deletions testing/test.gni
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,8 @@ template("test") {
_pkg_target = "${_output_name}_pkg"
_exec_target = "${_output_name}__exec"

# TODO(crbug.com/1019938): make minimum_capabilities.test-cmx the default
# and have everything added via additional_manifest_fragments
if (!defined(invoker.manifest)) {
if (!defined(invoker.additional_manifest_fragments)) {
manifest_fragments = [ "//build/config/fuchsia/tests-with-exec.cmx" ]
} else {
manifest_fragments =
[ "//build/config/fuchsia/test/minimum_capabilities.test-cmx" ]
}
} else {
manifest_fragments = [ invoker.manifest ]
}
manifest_fragments =
[ "//build/config/fuchsia/test/minimum_capabilities.test-cmx" ]

if (defined(invoker.additional_manifest_fragments)) {
manifest_fragments += invoker.additional_manifest_fragments
Expand Down

0 comments on commit 50c8339

Please sign in to comment.