mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-12-06 05:53:49 -05:00
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.
This commit is contained in:
1 parent
4b35beb68d
commit
fe66fcc499
1 file changed
+15
-9
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user