pub struct FakeServicesHandle { /* private fields */ }Expand description
The test’s side of FakeServices.
Implementations§
Source§impl FakeServicesHandle
impl FakeServicesHandle
pub fn clipboard(&self) -> Option<String>
Sourcepub fn set_clipboard(&self, text: &str)
pub fn set_clipboard(&self, text: &str)
Puts text on the fake clipboard, as if copied from another app.
Sourcepub fn take_alert(&self) -> Option<PendingAlert>
pub fn take_alert(&self) -> Option<PendingAlert>
The oldest alert still waiting for an answer.
pub fn take_open_file(&self) -> Option<PendingOpen>
pub fn take_save_file(&self) -> Option<PendingSave>
Sourcepub fn take_trash(&self) -> Option<PendingTrash>
pub fn take_trash(&self) -> Option<PendingTrash>
The oldest request to trash items. Nothing has been moved: the test does what it wants the platform to have done, then answers.
Sourcepub fn take_launch(&self) -> Option<PendingLaunch>
pub fn take_launch(&self) -> Option<PendingLaunch>
The oldest request to open something in another app.
Sourcepub fn notifications(&self) -> Vec<Notification>
pub fn notifications(&self) -> Vec<Notification>
The notifications showing, oldest first: those withdrawn or clicked are gone, and one replaced by another with its id is where it was, with the new text.
Sourcepub fn set_notification_error(&self, error: Option<ServiceError>)
pub fn set_notification_error(&self, error: Option<ServiceError>)
Makes notify fail with error from now on (Cancelled: the user
turned the app’s notifications off; Unavailable: nothing to show
them), or show them again with None.
Sourcepub fn click_notification(&self, id: &str) -> bool
pub fn click_notification(&self, id: &str) -> bool
Clicks the notification with this id, as the user would: it goes
from the list and the app hears of it. Returns false if there’s
none.
Sourcepub fn pending_requests(&self) -> usize
pub fn pending_requests(&self) -> usize
Requests of any kind still waiting for an answer.
The menus the app installed.
A window’s own menus (a MenuBar in its content), without the app’s.
The item at path, e.g. ["File", "Open Recent", "notes.txt"]:
a menu, its submenus, then the item’s title. Looks in the app’s
menus, then in each window’s.
Chooses the item at path (see menu_item),
like a click or its shortcut would. Returns false if there is no
such item or it is disabled.