Drive the profiler through `frame_end` purely on the CPU side (gpu_enabled stays false). Each "frame" pushes a single sample with the given cpu_us so the histogram totals are known.
(p: &mut Profiler, cpu_us: f64)
| 368 | /// sample with the given cpu_us so the histogram totals are |
| 369 | /// known. |
| 370 | fn fake_frame(p: &mut Profiler, cpu_us: f64) { |
| 371 | p.frame.push(FrameSample { label: "fake", cpu_us, gpu_us: None }); |
| 372 | // Skip the gpu readback path (no device available) and go |
| 373 | // straight to the CPU-only histogram + drain path. |
| 374 | p.frame_end_cpu(); |
| 375 | } |
| 376 | |
| 377 | #[test] |
| 378 | fn frame_history_empty_before_any_frames() { |