diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index bc84d95a1..16c4e1ee9 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -1099,40 +1099,6 @@ pub(crate) mod test_window { pub fn panel_rect(h: &Harness<'static, Window>, id: &str) -> egui::Rect { egui::containers::panel::PanelState::load(&h.ctx, egui::Id::new(id)).map(|s| s.outer_rect).unwrap() } -} - -/// The whole window in a headless test harness, at a chosen window size. -#[cfg(test)] -pub(crate) mod test_window { - use egui_kittest::Harness; - - pub struct Window { - pub app: crate::DesignApp, - ready: bool, - } - - /// The window at `size` with a new document open. - pub fn open(mut app: crate::DesignApp, size: egui::Vec2) -> Harness<'static, Window> { - if app.session.active().is_none() { - app.run("file.new", serde_json::json!({})).unwrap(); - } - let mut h = Harness::builder().with_size(size).with_max_steps(1000).build_ui_state( - |ui, w: &mut Window| { - // The builder runs a frame before the texture size can be raised: skip it. - if !w.ready { - return; - } - let ctx = ui.ctx().clone(); - w.app.logic(&ctx); - w.app.ui(ui); - }, - Window { app, ready: false }, - ); - h.input_mut().max_texture_side = Some(8192); - h.state_mut().ready = true; - h.run_steps(6); - h - } /// A primary click at `pos`, then a few frames. pub fn click_at(h: &mut Harness<'static, Window>, pos: egui::Pos2) {