Struct display_mocks::MockCoordinator
source · pub struct MockCoordinator { /* private fields */ }
Expand description
MockCoordinator
implements the server-end of the fuchsia.hardware.display.Coordinator
protocol. It minimally reproduces the display coordinator driver state machine to respond to
FIDL messages in a predictable and configurable manner.
Implementations§
source§impl MockCoordinator
impl MockCoordinator
sourcepub fn new(
coordinator_server_end: ServerEnd<CoordinatorMarker>,
listener_client_end: ClientEnd<CoordinatorListenerMarker>,
) -> Result<MockCoordinator>
pub fn new( coordinator_server_end: ServerEnd<CoordinatorMarker>, listener_client_end: ClientEnd<CoordinatorListenerMarker>, ) -> Result<MockCoordinator>
Bind a new MockCoordinator
to the server end of a FIDL channel.
sourcepub fn assign_displays(&mut self, displays: Vec<Info>) -> Result<()>
pub fn assign_displays(&mut self, displays: Vec<Info>) -> Result<()>
Replace the list of available display devices with the given collection and send a
fuchsia.hardware.display.Coordinator.OnDisplaysChanged
event reflecting the changes.
All the new displays will be reported as added while previously present displays will be reported as removed, regardless of their content.
Returns an error if displays
contains entries with repeated display IDs.
sourcepub fn emit_vsync_event(
&self,
display_id_value: u64,
stamp: ConfigStamp,
) -> Result<()>
pub fn emit_vsync_event( &self, display_id_value: u64, stamp: ConfigStamp, ) -> Result<()>
Sends a single OnVsync event to the client. The vsync event will appear to be sent from the
given display_id
even if a corresponding fake display has not been assigned by a call to
assign_displays
.