This is a test of the
launch_component_in_nested_environment function in
fuchsia_component. Its goal is to ensure the following:
add_proxy_servicefunction successfully proxies a loader for the new environment, allowing components to be launched.
add_proxy_service_tofunction successfully proxies a FIDL service implemented within the environment to other components within the environment.
The test ensures this by running four separate components.
fuchsia_component_test_outer_componentsimulates the “outer world”. It spawns
fuchsia_component_test_middle_sibling_componentwhich exposes an implementation of
EchoExposedBySiblingto the nested environment, which multiplies all inputs by 2. It then runs
fuchsia_component_test_middle_componentin the nested environment containing
EchoHiddenByParent, each of which echos a number and returns it to the client.
fuchsia_component_test_middle_componentsimulates a parent component attempting to create an isolated child. After confirming that it can successfully access
EchoHiddenByParent, it launches
fuchsia_component_test_inner_componentin a nested environment that only has access to
EchoExposedByParent, which has been overridden to always return ‘42’.
fuchsia_component_test_inner_componnentsimulates the isolated child component. It confirms that it can't access
EchoExposedBySibling, and that
EchoExposedByParenthas been successfully overwritten, always returning ‘42’.
fx run-test fuchsia_component_test_outer