S046: snail test
This commit is contained in:
parent
6f06b10792
commit
fdbb007f53
1 changed files with 10 additions and 4 deletions
|
|
@ -97,10 +97,16 @@ mod tests {
|
|||
use eframe::egui::pos2;;
|
||||
for (on, repaints) in [(false, false), (true, true)] {
|
||||
let ctx = Context::default();
|
||||
let mut out = ctx.run_ui(RawInput::default(), |ui| {
|
||||
button(ui.ctx(), &t, pos2(300.0, 300.0), on, "Ctrl+Shift+S");
|
||||
});
|
||||
out.textures_delta.clear();
|
||||
let mut out = None;
|
||||
// The first frames settle the layout; the last one tells.
|
||||
for _ in 0..4 {
|
||||
let mut o = ctx.run_ui(RawInput::default(), |ui| {
|
||||
button(ui.ctx(), &t, pos2(300.0, 300.0), on, "Ctrl+Shift+S");
|
||||
});
|
||||
o.textures_delta.clear();
|
||||
out = Some(o);
|
||||
}
|
||||
let out = out.unwrap();
|
||||
let after = out.viewport_output[&ViewportId::ROOT].repaint_delay;
|
||||
assert_eq!(after < std::time::Duration::from_secs(1), repaints, "on={on}: {after:?}");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue