From 539195d68b00d2ca2f1130c42f3a7500415baeb9 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 4 Nov 2026 08:28:11 -0800 Subject: [PATCH] Tests: native menu tests wait for the installed fonts' scan VectorcraftApp::new starts the installed fonts' scan in the background, and Type > Font lists only the loaded fonts until it ends (#5483). When the scan ended between two reads of the menus, the second read had the installed families too, and every_in_window_item_is_in_the_mac_menu_bar_once and documents_and_selections_change_state_not_structure failed. The tests' app() helper now waits for the scan after making the app. --- crates/ui-egui/src/tests/nativemenu.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ui-egui/src/tests/nativemenu.rs b/crates/ui-egui/src/tests/nativemenu.rs index 5d1d1c26f..a72e6cf6c 100644 --- a/crates/ui-egui/src/tests/nativemenu.rs +++ b/crates/ui-egui/src/tests/nativemenu.rs @@ -15,8 +15,12 @@ use crate::i18n::Lang; use crate::native_menu::{self, Backend, MenuBar, MenuRole, NativeMenu, Node, Standard}; use crate::{VectorcraftApp, menus}; +/// A new app, after the installed fonts' scan it starts has ended: until then Type › Font lists +/// only the loaded fonts (#5483), and a scan that ends part way through a test adds items between +/// two reads of the menus. fn app(doc: bool) -> VectorcraftApp { let mut app = VectorcraftApp::new(Session::new(), Default::default()); + vectorcraft_text::FontDb::global().family_list(); if doc { app.run("file.new", json!({"width": 400, "height": 300})).unwrap(); app.run("shape.rectangle", json!({"x": 20, "y": 20, "width": 37, "height": 40})).unwrap();