blob: 70babed09887eca8d7f70b49a7aea591e7e21ba9 [file] [log] [blame] [edit]
// Copyright 2023 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.
library fuchsia.testing.harness;
using zx;
/// This protocol mediates a test suite's access to a component under test.
///
/// A RealmProxy is a test harness which allows some test suite to create instances
/// of the component(s) under test on demand. Most importantly, the test suite
/// does not have to know which components are created or how they are created;
/// It is only required to know which capabilities the components expose.
///
/// For example, a generic test suite for Fuchsia filesystems can use the RealmProxy
/// protocol to spawn components that serve protocols from the fuchsia.io FIDL
/// library. The test suite doesn't need to know which filesystem it's testing
/// or how the filesystem is initialized. It just needs to call
/// [ConnectToNamedProtocol] with the name of a fuchsia.io protocol and start
/// testing. By running this test suite with different proxies that initialize
/// different filesystems, we can use the same suite to validate each system.
@discoverable
protocol RealmProxy {
/// Connects [server_end] to the [protocol] from this proxy's namespace.
ConnectToNamedProtocol(resource struct {
protocol string:1000;
server_end zx.handle:CHANNEL;
}) -> () error OperationError;
};