Randomly detach requests on guest to let them race with other local ops
This commit is contained in:
parent
e3c4ce208a
commit
1fbcea6c0d
3 changed files with 58 additions and 26 deletions
|
@ -492,6 +492,15 @@ impl TestAppContext {
|
|||
self.cx.borrow().background().clone()
|
||||
}
|
||||
|
||||
pub fn spawn<F, Fut, T>(&self, f: F) -> Task<T>
|
||||
where
|
||||
F: FnOnce(AsyncAppContext) -> Fut,
|
||||
Fut: 'static + Future<Output = T>,
|
||||
T: 'static,
|
||||
{
|
||||
self.cx.borrow_mut().spawn(f)
|
||||
}
|
||||
|
||||
pub fn simulate_new_path_selection(&self, result: impl FnOnce(PathBuf) -> Option<PathBuf>) {
|
||||
self.foreground_platform.simulate_new_path_selection(result);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue