blob: c748bbae12d6c9553a3f9cfb6e63b7d4bd208f7f [file] [log] [blame]
// Copyright 2024 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.driver.testing;
using fuchsia.component.sandbox;
using fuchsia.driver.test;
using fuchsia.io;
using fuchsia.testing.harness;
using fuchsia.url;
/// RealmOptions tells the RealmFactory protocol how to create the test realm.
type RealmOptions = resource table {
/// The RealmArgs for the driver test realm.
/// This is required.
1: driver_test_realm_start_args fuchsia.driver.test.RealmArgs;
/// This is an override for the url to use for the driver test realm.
/// By default, the url used is "#meta/driver_test_realm.cm", and it
/// should not be overriden unless the intent is to replace the
/// driver test realm that is provided by the driver framework team.
/// This is optional.
2: driver_test_realm_url fuchsia.url.Url;
/// The server end that the topological devfs gets served on.
/// This is optional.
3: dev_topological server_end:fuchsia.io.Directory;
/// The server end that the class based devfs gets served on.
/// This is optional.
4: dev_class server_end:fuchsia.io.Directory;
/// This is the client end to a directory that provides all of the |offers| specified in the
/// |driver_test_realm_start_args| to drivers under test.
/// This is required if and only if |offers| is provided in |driver_test_realm_start_args|.
5: offers_client client_end:fuchsia.io.Directory;
};
@discoverable
open protocol RealmFactory {
/// Creates a new realm and binds the given RealmProxy server end to it.
flexible CreateRealm(resource struct {
options RealmOptions;
realm_server server_end:fuchsia.testing.harness.RealmProxy;
}) -> () error fuchsia.testing.harness.OperationError;
/// Creates a new realm and returns a dictionary containing its exposed capabilities.
flexible CreateRealm2(resource struct {
options RealmOptions;
dictionary server_end:fuchsia.component.sandbox.Dictionary;
}) -> () error fuchsia.testing.harness.OperationError;
};