Fix test failures

This commit is contained in:
Mikayla 2024-01-16 22:30:44 -08:00
parent cae35d3334
commit a99ee5e599
No known key found for this signature in database
3 changed files with 40 additions and 51 deletions

View file

@ -568,6 +568,11 @@ pub struct VisualTestContext {
}
impl<'a> VisualTestContext {
/// Get the underlying window handle underlying this context.
pub fn handle(&self) -> AnyWindowHandle {
self.window
}
/// Provides the `WindowContext` for the duration of the closure.
pub fn update<R>(&mut self, f: impl FnOnce(&mut WindowContext) -> R) -> R {
self.cx.update_window(self.window, |_, cx| f(cx)).unwrap()