Add ImageLoader::has_pending and wait_for_pending_images#7030
Merged
lucasmerlin merged 4 commits intomainfrom May 8, 2025
Merged
Add ImageLoader::has_pending and wait_for_pending_images#7030lucasmerlin merged 4 commits intomainfrom
ImageLoader::has_pending and wait_for_pending_images#7030lucasmerlin merged 4 commits intomainfrom
Conversation
This reverts commit 2947821.
|
Preview available at https://egui-pr-preview.github.io/pr/7030-lucasharness-wait-for-loading-images |
f889705 to
f855a9f
Compare
|
How do we call the Egui Update function for exiting native egui app in egui_Kittest Struct as we need to pass e frame object ? |
darkwater
pushed a commit
to darkwater/egui
that referenced
this pull request
Aug 24, 2025
) With kittest it was difficult to wait for images to be loaded before taking a snapshot test. This PR adds `Harness::with_wait_for_pending_images` (true by default) which will cause `Harness::run` to sleep until all images are loaded (or `HarnessBuilder::with_max_steps` is exceeded). It also adds a new ImageLoader::has_pending and BytesLoader::has_pending, which should be implemented if things are loaded / decoded asynchronously. It reverts emilk#6901 which was my previous attempt to fix this (but this didn't work since only the tested crate is compiled with cfg(test) and not it's dependencies)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With kittest it was difficult to wait for images to be loaded before taking a snapshot test.
This PR adds
Harness::with_wait_for_pending_images(true by default) which will causeHarness::runto sleep until all images are loaded (orHarnessBuilder::with_max_stepsis exceeded).It also adds a new ImageLoader::has_pending and BytesLoader::has_pending, which should be implemented if things are loaded / decoded asynchronously.
It reverts #6901 which was my previous attempt to fix this (but this didn't work since only the tested crate is compiled with cfg(test) and not it's dependencies)