diff --git a/crates/ui-egui/src/chrome/tests.rs b/crates/ui-egui/src/chrome/tests.rs index 9dbf91b4e7..0caf6ca592 100644 --- a/crates/ui-egui/src/chrome/tests.rs +++ b/crates/ui-egui/src/chrome/tests.rs @@ -772,6 +772,10 @@ fn current_tool_names_the_selection_tool_cmd_lends() { /// color profile. #[test] fn the_status_bar_info_field_shows_the_chosen_readout() { + // Assigning a profile to the front document changes the process's active color settings. + if !crate::testing::in_own_process("chrome::tests::the_status_bar_info_field_shows_the_chosen_readout") { + return; + } let mut bar = status_readout_app(); let texts = status_readout_frame(&mut bar); assert!(texts.iter().any(|t| t.text == "Selection"), "Current Tool by default: {texts:?}"); diff --git a/crates/ui-egui/src/panels/separations.rs b/crates/ui-egui/src/panels/separations.rs index 53961fb0ab..96d558186a 100644 --- a/crates/ui-egui/src/panels/separations.rs +++ b/crates/ui-egui/src/panels/separations.rs @@ -546,6 +546,10 @@ mod tests { /// model's profile stays as it was. #[test] fn assign_rows_follow_the_document_color_mode() { + // Assigning a profile to the front document changes the process's active color settings. + if !crate::testing::in_own_process("panels::separations::tests::assign_rows_follow_the_document_color_mode") { + return; + } let mut app = VectorcraftApp::new(Session::new(), Default::default()); app.run("file.new", json!({})).unwrap(); for (mode, key, kind, other) in [("rgb", "rgb", ProfileKind::Rgb, "cmyk"), ("cmyk", "cmyk", ProfileKind::Cmyk, "rgb")] { diff --git a/crates/ui-egui/src/testing.rs b/crates/ui-egui/src/testing.rs index 1af93e507d..3650c423f8 100644 --- a/crates/ui-egui/src/testing.rs +++ b/crates/ui-egui/src/testing.rs @@ -94,8 +94,11 @@ pub(crate) fn custom_dictionary() -> std::sync::MutexGuard<'static, ()> { /// Runs the test `name` (its path in the crate, such as `canvas::tests::a_test`) alone in a child test process, for a /// test that loads or removes a color profile. The loaded profiles are the whole process's, and the canvas's frame key /// holds their generation ([`vectorcraft_color::cms::profiles_generation`]), so a profile loaded in this process while -/// another test renders changes that test's keys. In the child it returns `true`, and the test goes on. Here it waits -/// for the child, fails when the child's test fails, and returns `false`. +/// another test renders changes that test's keys. A test that assigns a profile to its front document, or changes +/// Color Settings, also runs here: the active color settings ([`vectorcraft_color::cms::active`]) are the whole +/// process's too, and another test converting a color while they are changed gets that profile's values. In the child +/// it returns `true`, and the test goes on. Here it waits for the child, fails when the child's test fails, and returns +/// `false`. pub(crate) fn in_own_process(name: &str) -> bool { const CHILD: &str = "VECTORCRAFT_TEST_OWN_PROCESS"; if std::env::var_os(CHILD).is_some_and(|v| v == name) {