diff options
Diffstat (limited to 'testing/web-platform/tests/html/canvas/tools/templates/testharness_worker_grid.js')
-rw-r--r-- | testing/web-platform/tests/html/canvas/tools/templates/testharness_worker_grid.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/canvas/tools/templates/testharness_worker_grid.js b/testing/web-platform/tests/html/canvas/tools/templates/testharness_worker_grid.js new file mode 100644 index 0000000000..53c3b69cb6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/tools/templates/testharness_worker_grid.js @@ -0,0 +1,27 @@ +{% if timeout %}// META: timeout={{ timeout }}{% endif %} +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:{{ name }} +// Description:{{ desc }} +// Note:{% if notes %}<p class="notes">{{ notes }}{% endif +%} + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); +{% for variant in worker_variants %} + +{% if test_type == 'promise' %} +promise_test(async t => { +{% elif test_type == 'async' %} +async_test(t => { +{% else %} +test(t => { +{% endif %} + const canvas = new OffscreenCanvas({{ + variant.size[0] }}, {{ variant.size[1] }}); + const ctx = canvas.getContext('2d'{% + if variant.attributes %}, {{ variant.attributes }}{% endif %}); + + {{ variant.code_worker | trim | indent(2)}} +}, "{{ variant.desc | double_quote_escape }}"); +{% endfor %} + +done(); |