From 1ba9c55f8e4b563e78f65760d5bf048b41aed3f2 Mon Sep 17 00:00:00 2001 From: Terra854 Date: Wed, 2 Dec 2026 05:38:43 +0800 Subject: [PATCH] Test: drive toolbar double-clicks within the click interval (#18744) --- .../ui-egui/src/panels/toolbar_rotate_view_reset_tests.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/panels/toolbar_rotate_view_reset_tests.rs b/crates/ui-egui/src/panels/toolbar_rotate_view_reset_tests.rs index 64a9e28e8e..2cc3991808 100644 --- a/crates/ui-egui/src/panels/toolbar_rotate_view_reset_tests.rs +++ b/crates/ui-egui/src/panels/toolbar_rotate_view_reset_tests.rs @@ -3,12 +3,16 @@ use super::*; use egui::{Modifiers, PointerButton}; use egui_kittest::Harness; -use egui_kittest::kittest::{NodeT, Queryable}; +use egui_kittest::kittest::Queryable; +/// Use 60 Hz frames so two clicks fall inside the double-click interval. fn harness(documents: usize) -> Harness<'static, Box> { - let mut h = Harness::builder().with_size(egui::vec2(1200.0, 1100.0)).with_max_steps(64).build_eframe(move |cc| { + let mut h = Harness::builder().with_step_dt(1.0 / 60.0).with_size(egui::vec2(1200.0, 1100.0)).with_max_steps(64).build_eframe(move |cc| { PhotocraftApp::setup_context(&cc.egui_ctx, crate::theme::AppTheme::pro()); let mut app = PhotocraftApp::with_context(cc.egui_ctx.clone(), photocraft_engine::Session::new(), crate::Services::default()); + app.run("prefs.set", json!({"values": {"general.animatedZoom": false}})).expect("disable zoom animation"); + // Home hides the toolbar, so the empty-document case uses the workspace. + app.session.edit_prefs(|prefs| prefs.general.auto_show_home_screen = false); for _ in 0..documents { app.run("file.new", json!({"width": 3000, "height": 2000})).expect("new document"); }