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

image: Fix options.imagebitmap on Firefox #616

Merged
merged 4 commits into from
Jan 28, 2020

Conversation

ibgreen
Copy link
Collaborator

@ibgreen ibgreen commented Jan 11, 2020

As reported by @isaacbrodsky, Firefox crashes if options are passed to createImageBitmap.

This fix chooses to still support options.imagebitmap on browsers that do support that parameter.

@Pessimistress While trying to test this fix, I realized that the page served by yarn test browser is dependent on puppeteer and can't be run in other browsers. Would be nice to have the option to easily run our unit tests in other browsers. Not sure if we could just make the puppeteer calls optional if not run on Chromium, or if we'd need a separate ocular sub target.

}

function isEmptyObject(object) {
for (const key in object) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn’t seem to account for object===undefined

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn’t seem to account for object===undefined

Shouldn't happen due to the way options are merged with defaults that said adding the check doesn't cost much., will do.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the previous attempt: d348845

Does it throw immediately or does the promise reject?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it throw immediately or does the promise reject?

Yes I believe you have a point. async await converts automatically between promise rejections and exceptions, so I'll update to use async syntax.

Still this makes it obvious that I have not been able to test these changes, due to our test harness limitations.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you hold on merging while I fix the testing?

@coveralls
Copy link

coveralls commented Jan 11, 2020

Coverage Status

Coverage increased (+0.6%) to 51.654% when pulling 950a93d on ib/image-fix-options.imagebitmap into 7676191 on master.

@Pessimistress
Copy link
Collaborator

yarn test browser is dependent on puppeteer and can't be run in other browsers

Ye we can make the dependency optional. Render tests won’t work because the screen capture and comparison is done on the server side.

Puppeteer has experimental support for Firefox but I have never tried.

@ibgreen
Copy link
Collaborator Author

ibgreen commented Jan 11, 2020

Puppeteer has experimental support for Firefox but I have never tried.

That's cool, it would be great if we could have dual browser test automation, though I'd prioritize the puppeteer-less mode so that we can run unit tests in Safari and other browsers too.

@Pessimistress
Copy link
Collaborator

I have not been able to test these changes, due to our test harness limitations.

uber-web/probe.gl#124

@Pessimistress Pessimistress added this to the v 2.0.0 milestone Jan 12, 2020
@ibgreen ibgreen modified the milestones: v 2.0.0, v 2.1.0 Jan 28, 2020
@ibgreen
Copy link
Collaborator Author

ibgreen commented Jan 28, 2020

Image tests are passing on Firefox (however the new setup uncovered two stream related errors which is great). Will follow up on those separately.

@ibgreen ibgreen merged commit 4855a43 into master Jan 28, 2020
@ibgreen ibgreen deleted the ib/image-fix-options.imagebitmap branch January 28, 2020 22:30
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.

3 participants