| // 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. | |
| /// A test-only library for extracting syscall information from a test fixture | |
| /// that serves the `Control` protocol. | |
| /// | |
| /// Use by connecting to [Control]. | |
| @available(added=HEAD) | |
| library fuchsia.test.syscalls; | |
| using zx; | |
| /// Internal state of the code instrumented with tests syscalls. | |
| type State = struct { | |
| /// Number of calls to zx_system_suspend_enter for the lifetime of this | |
| /// test fixture. | |
| zx_system_suspend_enter_calls_count uint32; | |
| }; | |
| closed protocol Control { | |
| /// Set the status that the fixture returns on a return from | |
| /// zx_system_suspend_enter. | |
| strict SetSuspendEnterResult(struct { | |
| status zx.Result; | |
| }) -> (); | |
| /// Gets the internal state of the instrumented driver. | |
| strict GetState() -> (State); | |
| }; | |
| /// Serves the Control protocol as a service. Only needed due to | |
| /// driver test realm implementation detail. | |
| service ControlService { | |
| control client_end:Control; | |
| }; |