OffscreenCanvas conformance tests (#4260)

The spec for OffscreenCanvas has officially landed here:
https://html.spec.whatwg.org/multipage/scripting.html#the-offscreencanvas-interface

This pull request adds conformance tests for OffscreenCanvas and its 2D context.

Notice that in the spec for OffscreenCanvasRenderingContext2D, it looks like this:
OffscreenCanvasRenderingContext2D implements CanvasState;
which means that the tests for OffscreenCanvasRenderingContext2D can follow the tests for CanvasRenderingContext2D. Luckily we have a loooot of tests under 2dcontext/, and most of them are automatically generated by using the scripts in 2dcontext/tools/gentest.py

So this pull requests add the following scripts:
1. offscreen-canvas/tools/gentest.py: this is the main auto-generation script that is modified based on 2dcontext/tools/gentest.py
2. offscreen-canvas/tools/name2dir.yaml: a mapping for each test to its directory.
3. offscreen-canvas/tools/templates.yaml: this is also modified based on 2dcontext/tools/templates.yaml, notice that applying the templates here also generates tests in a worker, which is the main difference compared to the one under 2dcontext.
4. offscreen-canvas/tools/tests2d.yaml: modified based on 2dcontext/tools/tests2d.yaml and 2dcontext/tools/tests.yaml

When running the script gentest.py, there will be 1458 tests (729 in main and 729 in a worker) generated. For now, I have not included these automatically generated tests because it would be really distracting. Once the scripts are approved, I will include all the tests.

@junov @RByers @foolip @mephisto41 Please review.

View on GitHub: https://github.com/w3c/web-platform-tests/pull/4260

Received on Tuesday, 29 November 2016 15:09:32 UTC