From fe66fcc49952f57eb5f0fb7eb5db12ee7471638e Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Tue, 1 Dec 2026 12:42:40 +0100 Subject: [PATCH] Keep machine font discovery out of the embedded-font fixture The picker switches catalogs when the host font scan completes. Issue #8937 observed the row and its pointer target change during this integration test. Hold the scan with the existing manual-jobs fixture while exercising the document font row and saved edit. --- crates/ui-egui/tests/it/edit.rs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/crates/ui-egui/tests/it/edit.rs b/crates/ui-egui/tests/it/edit.rs index e390ff6d0b..79046b06bf 100644 --- a/crates/ui-egui/tests/it/edit.rs +++ b/crates/ui-egui/tests/it/edit.rs @@ -13,18 +13,21 @@ use crate::support::AppHarness as _; /// Builds a test harness loaded with the standard single-page form fixture. fn harness() -> Harness<'static, PdfCraftApp> { - let bytes = include_bytes!("../data/form.pdf").to_vec(); - let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(0.25).build_eframe(move |cc| { - crate::support::install_runtime(&cc.egui_ctx); - let mut app = crate::control::new_app(); - app.set_option(&cc.egui_ctx, "language", "en").unwrap(); - app.open_bytes(&cc.egui_ctx, "form.pdf", None, bytes.clone()).unwrap(); - app - }); + let mut h = harness_for(crate::control::new_app()); crate::support::settle(&mut h); h } +fn harness_for(mut app: PdfCraftApp) -> Harness<'static, PdfCraftApp> { + let bytes = include_bytes!("../data/form.pdf").to_vec(); + Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(0.25).build_eframe(move |cc| { + crate::support::install_runtime(&cc.egui_ctx); + app.set_option(&cc.egui_ctx, "language", "en").unwrap(); + app.open_bytes(&cc.egui_ctx, "form.pdf", None, bytes).unwrap(); + app + }) +} + /// Registers the bundled Inter-Regular face on page 0 and returns its `(resource, face)` pair. fn register_inter(h: &mut Harness<'static, PdfCraftApp>) -> (String, String) { let id = h.state().views[0].id; @@ -178,7 +181,10 @@ fn add_text_ui_draft_with_custom_font_is_not_blocked() { #[test] fn format_text_font_picker_applies_document_font_to_added_text() { let _gpu = gpu(); - let mut h = harness(); + let (app, jobs) = crate::control::app_with_manual_jobs(); + let mut h = harness_for(app); + crate::support::settle_held(&mut h, &jobs); + // Keep host font discovery queued. The test only needs the embedded document font. let id = h.state().views[0].id; let (resource, face) = register_inter(&mut h);