pub struct MockCaptureSession(/* private fields */);Expand description
A camera session the app started, as the test sees it. Its photos answer what the test gave, or that the session does not run; its recordings answer when they are stopped, writing nothing. Every clone is the same session.
Implementations§
Source§impl MockCaptureSession
impl MockCaptureSession
pub fn camera(&self) -> Camera
Sourcepub fn picked(&self) -> CameraFormat
pub fn picked(&self) -> CameraFormat
The format the app picked.
Sourcepub fn format(&self) -> CameraFormat
pub fn format(&self) -> CameraFormat
The format it runs in: the one picked, or the one of the session it joined.
Sourcepub fn preview_layer(&self) -> Option<Arc<dyn CompositionLayer>>
pub fn preview_layer(&self) -> Option<Arc<dyn CompositionLayer>>
The layer the preview shows on, among the outputs given.
Sourcepub fn frame_reader(&self) -> Option<Arc<dyn VideoFrameReader>>
pub fn frame_reader(&self) -> Option<Arc<dyn VideoFrameReader>>
The reader the frames go to, among the outputs given.
Sourcepub fn photo_size(&self) -> Option<Size>
pub fn photo_size(&self) -> Option<Size>
The size photos are taken at, among the outputs given.
Sourcepub fn movie_options(&self) -> Option<MovieOptions>
pub fn movie_options(&self) -> Option<MovieOptions>
What recordings ask for, among the outputs given.
Sourcepub fn recordings(&self) -> Vec<PathBuf>
pub fn recordings(&self) -> Vec<PathBuf>
The paths the app recorded to, in order.
pub fn is_dropped(&self) -> bool
Sourcepub fn set_rotation_angles(&self, preview: u32, capture: u32)
pub fn set_rotation_angles(&self, preview: u32, capture: u32)
Reports preview and capture as its rotation angles from now on, as the system would
have turned them with the device.
Sourcepub fn answering_photo(&self, photo: Photo)
pub fn answering_photo(&self, photo: Photo)
Answers each photo with photo from now on, while the session runs.
Sourcepub fn set_state(&self, state: CaptureState)
pub fn set_state(&self, state: CaptureState)
Reports state from now on, as the system would have changed it.