diff options
Diffstat (limited to 'testing/web-platform/tests/html/canvas/tools/templates/testharness_offscreen.html')
-rw-r--r-- | testing/web-platform/tests/html/canvas/tools/templates/testharness_offscreen.html | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/canvas/tools/templates/testharness_offscreen.html b/testing/web-platform/tests/html/canvas/tools/templates/testharness_offscreen.html new file mode 100644 index 0000000000..8ebbff77a6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/tools/templates/testharness_offscreen.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> +<title>OffscreenCanvas test: {{ name }}</title> +{% if timeout %}<meta name="timeout" content="{{ timeout }}">{% endif %} +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/html/canvas/resources/canvas-tests.js"></script> + +<h1>{{ name }}</h1> +<p class="desc">{{ desc }}</p> + +{% if notes %}<p class="notes">{{ notes }}{% endif +%} +<script> + +{#- Promise vs. async test header: +#} +{% if test_type == 'promise' %} +promise_test(async t => { +{% else %} +var t = async_test("{{ desc | double_quote_escape }}"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { +{% endif %} + +{# Test body: #} + var canvas = new OffscreenCanvas({{ size[0] }}, {{ size[1] }}); + var ctx = canvas.getContext('2d'{% if attributes %}, {{ attributes }}{% endif %}); + + {{ code | trim | indent(2)}} + +{#- Promise vs. async test footer: +#} +{% if test_type == 'promise' %} + +}, "{{ desc }}"); +{% else %} + t.done(); + +}); +{% endif %} +</script> +{% for svgimage in svgimages %} +<svg><image xlink:href="/images/{{ svgimage }}" id="{{ svgimage }}" class="resource"></svg> +{% endfor %} |