mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 14:20:04 -04:00
Add Harness::new_eframe and TestRenderer trait (#5539)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
This commit is contained in:
@@ -405,7 +405,7 @@ mod tests {
|
||||
options.threshold = 2.1;
|
||||
}
|
||||
|
||||
let result = harness.try_wgpu_snapshot_options(&format!("demos/{name}"), &options);
|
||||
let result = harness.try_snapshot_options(&format!("demos/{name}"), &options);
|
||||
if let Err(err) = result {
|
||||
errors.push(err.to_string());
|
||||
}
|
||||
|
||||
@@ -235,21 +235,21 @@ mod tests {
|
||||
let mut results = Vec::new();
|
||||
|
||||
harness.run();
|
||||
results.push(harness.try_wgpu_snapshot("modals_1"));
|
||||
results.push(harness.try_snapshot("modals_1"));
|
||||
|
||||
harness.get_by_label("Save").click();
|
||||
// TODO(lucasmerlin): Remove these extra runs once run checks for repaint requests
|
||||
harness.run();
|
||||
harness.run();
|
||||
harness.run();
|
||||
results.push(harness.try_wgpu_snapshot("modals_2"));
|
||||
results.push(harness.try_snapshot("modals_2"));
|
||||
|
||||
harness.get_by_label("Yes Please").click();
|
||||
// TODO(lucasmerlin): Remove these extra runs once run checks for repaint requests
|
||||
harness.run();
|
||||
harness.run();
|
||||
harness.run();
|
||||
results.push(harness.try_wgpu_snapshot("modals_3"));
|
||||
results.push(harness.try_snapshot("modals_3"));
|
||||
|
||||
for result in results {
|
||||
result.unwrap();
|
||||
@@ -282,6 +282,6 @@ mod tests {
|
||||
harness.run();
|
||||
|
||||
// This snapshots should show the progress bar modal on top of the save modal.
|
||||
harness.wgpu_snapshot("modals_backdrop_should_prevent_focusing_lower_area");
|
||||
harness.snapshot("modals_backdrop_should_prevent_focusing_lower_area");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,6 +307,6 @@ mod tests {
|
||||
|
||||
harness.fit_contents();
|
||||
|
||||
harness.wgpu_snapshot("widget_gallery");
|
||||
harness.snapshot("widget_gallery");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -703,7 +703,7 @@ mod tests {
|
||||
|
||||
harness.fit_contents();
|
||||
|
||||
let result = harness.try_wgpu_snapshot(&format!("rendering_test/dpi_{dpi:.2}"));
|
||||
let result = harness.try_snapshot(&format!("rendering_test/dpi_{dpi:.2}"));
|
||||
if let Err(err) = result {
|
||||
errors.push(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user