| // Copyright 2020 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.sl4f; |
| |
| using zx; |
| |
| /// Implemented by a backend component hosting one or more facades. Used to acquire the list of |
| /// facades hosted by a `FacadeProvider` instance. |
| protocol FacadeIterator { |
| GetNext() -> (struct { |
| facades vector<string:MAX>:MAX; |
| }); |
| }; |
| |
| /// Implemented by a backend component hosting one or more facades. A facade must only be hosted by |
| /// a signel `FacadeProvider` instance. |
| /// NOTE: The current implementation uses ComponentsV1 and only supports a single `FacadeProvider` |
| /// instance. This is intended to change and may result in changes to the protocol. |
| @discoverable |
| protocol FacadeProvider { |
| /// Connect to a `FacadeIterator` to obtain the list of facades hosted by this `FacadeProvider`. |
| GetFacades(resource struct { |
| iterator server_end:FacadeIterator; |
| }); |
| |
| /// Executes 'command' on 'facade'. Returns an optional result JSON blob and error string. |
| Execute(resource struct { |
| facade string:MAX; |
| command string:MAX; |
| params_blob zx.handle:VMO; |
| }) -> (resource struct { |
| result_blob zx.handle:<VMO, optional>; |
| error string:<MAX, optional>; |
| }); |
| |
| /// Cleans up any resources and transient state associated with SL4F facades hosted by this |
| /// `FacadeProvider`. Returns on completion. |
| Cleanup() -> (); |
| |
| /// Prints the state of all facades hosted by this `FacadeProvider`. Returns on completion. |
| Print() -> (); |
| }; |