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

Offscreen canvas tests only test one flavor #49987

Open
schenney-chromium opened this issue Jan 8, 2025 · 3 comments
Open

Offscreen canvas tests only test one flavor #49987

schenney-chromium opened this issue Jan 8, 2025 · 3 comments
Assignees

Comments

@schenney-chromium
Copy link
Contributor

The OffscreenCanvas tests create an OffscreenCanvas using the JS constructor then operate on it. This is just one way to create an OffscreenCanvas, the other is to transfer control from an HTML canvas.

Some aspects of the OffscreenCanvasRenderingContext2d behavior depend on whether or not the Offscreen is a placeholder for a DOM canvas. I'm talking text direction and the proposed lang text property. Currently there is no way to test the behavior in this situation (specifically the behavior with the "inherit" value for the text direction and lang property).

I propose adding an additional canvas test target, "TransferredOffscreen" or something similar so that we can test this behavior.

@AndresRPerez12
Copy link
Contributor

There is certainly value in testing this flavor of OffscreenCanvas.

By target do you mean adding a new directory under wpt/html/canvas? If yes, I would think that is a bit overkill, especially as most tests are generated from the yaml files and for most scenarios it is not necessary to run both the existing version of OffscreenCanvas tests and Transferred Canvas tests.

Other approaches that come to mind would be adding these tests to the manual directory inside wpt/html/canvas/offscreen, that has the tests that are not generated from the yaml files.

A more thorough although more time consuming option would be to modify the Jinja templates and the generator so that it's possible to configure this from the yaml via some parameter. Having that, applying variants would enable to test with both OffscreenCanvas versions when needed.

@schenney-chromium
Copy link
Contributor Author

I was going to go all in and add a an additional directory under wpt/html/canvas with the ability to tag only tests that need this flavor of testing because the tests I'm considering would need to run in all flavors.

Although on further consideration the output should differ in each scenario, so maybe bespoke tests in manual would be better.

Anyways, I'll experiment and see what's works.

@gsnedders
Copy link
Member

If you're going to change the generation, it might be worthwhile trying to land #33613 (merging the duplicated copies we have of the canvas test generation code) first?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants