From 4fbe7364d96bcedaa552995a486e554817f96dda Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 3 Dec 2026 12:12:26 -0800 Subject: [PATCH] Tests: read the coalesced release and press from the frame that took them review_596866_owned_up_then_new_down_in_one_frame_keeps_the_next_click_single checked the release and press edges in the step's last frame. The press's Down comes in a second pass of the same frame only when another part of the UI asks for a rerun; otherwise it comes in the next frame, whose first pass has no events. Keying the Image Trace sliders on the selection moves the status bar's rerun to an earlier step, so the Down came in a second frame and the precondition failed while every behavior assertion still held. The edges are now read with frame_event, which looks at the first pass of each frame in the step. --- crates/ui-egui/tests/image_trace_ignore_sampler.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/tests/image_trace_ignore_sampler.rs b/crates/ui-egui/tests/image_trace_ignore_sampler.rs index f9e6bff2ed..91edfb5512 100644 --- a/crates/ui-egui/tests/image_trace_ignore_sampler.rs +++ b/crates/ui-egui/tests/image_trace_ignore_sampler.rs @@ -1155,7 +1155,9 @@ fn review_596866_owned_release_then_press(coalesced: bool) { let history = (app.session.active().unwrap().history.undo.len(), app.session.active().unwrap().history.redo.len()); if coalesced { frame_at(&mut app, &ctx, start + step, vec![review_596866_button(at, false), review_596866_button(at, true)]); - assert!(frame_input(&ctx, |i| i.pointer.primary_released() && i.pointer.primary_pressed() && i.pointer.primary_down())); + // The press's Down comes in a second pass of this frame when another part of the UI asks for a rerun, and in the + // next frame otherwise. The coalesced release and press are read from the frame whose first pass took them. + assert!(frame_event(&ctx, |i| i.pointer.primary_released() && i.pointer.primary_pressed() && i.pointer.primary_down())); } else { review_gesture_release(&mut app, &ctx, at, start + step); assert_eq!(app.session.active().unwrap().selection.objects, Vec::::new(), "CONTROL: the owned Up remains consumed");