Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't call img.onload() manually during test as images might've already loaded #5331

Merged
merged 1 commit into from
Jul 7, 2023

Conversation

mrxz
Copy link
Contributor

@mrxz mrxz commented Jul 7, 2023

Description:
One of the a-assets tests waits for an image to be loaded, but then proceeds to manually invoke img.onload(). With the change made in #5253 it's possible that this onload isn't defined, causing the test to fail. This seems to happen consistently with Firefox 115, but not on Chrome or older Firefox versions.

There is actually no need for the test to call onload. It might've been done in an attempt to speed the loading up(?), but that partially invalidates the test, not to mention that other tests do wait on the underlying assets to load naturally.

Fixes #5095

Changes proposed:

  • Don't manually invoke img.onload(), but instead rely on the actual loading mechanism (either short-circuiting if already completed or onload)

@mrxz mrxz mentioned this pull request Jul 7, 2023
@dmarcos
Copy link
Member

dmarcos commented Jul 7, 2023

Thanks!

@dmarcos dmarcos merged commit 888cf3f into aframevr:master Jul 7, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants