mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-25 22:39:07 +00:00
test(layers): synchronize thumbnail queue assertion (#6318)
This commit is contained in:
@@ -957,10 +957,15 @@ mod tests {
|
||||
assert!(thumbs.texture(&ctx, &src_b, n, 24).is_some(), "the shown document's thumbnails are shown");
|
||||
}
|
||||
// Shown again, document 1's rows are asked for again and come back.
|
||||
// Hold the worker so texture() cannot collect a completed row before the count.
|
||||
let release = hold(&thumbs);
|
||||
for n in &a_rows {
|
||||
assert!(thumbs.texture(&ctx, &src_a, n, 24).is_none());
|
||||
}
|
||||
assert_eq!(thumbs.pending.keys().filter(|k| k.0 == 1).count(), 3);
|
||||
release.send(()).expect("the held job is waiting");
|
||||
let held = thumbs.worker.as_ref().and_then(ThumbWorker::wait).expect("the held job finishes");
|
||||
assert_eq!(held.key.0, (0, NodeId(0)));
|
||||
for _ in &a_rows {
|
||||
receive_checked(&ctx, &mut thumbs, 1, &a, &a_rows);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user