mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-29 01:34:29 +01:00
Merge pull request #9889 from dotCooCoo/fix/color-picker-live-artboard-flaky
Tests: run the profile-assigning status bar and Assign rows tests in their own process
This commit is contained in:
3 files changed
+13
-2
No files matched your search
@@ -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:?}");
|
||||
|
||||
@@ -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")] {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user