mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-11 02:19:56 -06:00
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.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user