pub async fn serve_fake_wake_alarms(
message_counter: Counter,
response_type: Response,
stream: WakeAlarmsRequestStream,
once: bool,
)
Expand description
Serves a fake fuchsia.time.alarms/Wake
API. The behavior is simplistic when compared to
the “real” implementation in that it never actually expires alarms on its own, and has
fixed behavior for each scheduled alarm, which is selected at the beginning of the test.
Despite this, we can use it to check a number of correctness scenarios with unit tests.
This allows us to remove the flakiness that may arise from the use of real time, and also
avoid the complications of fake time. If you want an alarm that expires, schedule it with
a deadline of MAGIC_EXPIRE_DEADLINE
above, and call this with response_type == Response::Delayed
.