testharness_offscreen_grid.html (931B)
1 <!DOCTYPE html> 2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> 3 <meta charset="UTF-8"> 4 <title>OffscreenCanvas test: {{ name }}</title> 5 {% if timeout %}<meta name="timeout" content="{{ timeout }}"> 6 {% endif %} 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <script src="/html/canvas/resources/canvas-tests.js"></script> 10 11 <h1>{{ name }}</h1> 12 13 <script> 14 {% for variant in variants %} 15 16 {% if test_type == 'promise' %} 17 promise_test(async t => { 18 {% elif test_type == 'async' %} 19 async_test(t => { 20 {% else %} 21 test(t => { 22 {% endif %} 23 const canvas = new OffscreenCanvas({{ 24 variant.size[0] }}, {{ variant.size[1] }}); 25 const ctx = canvas.getContext('2d'{% 26 if variant.attributes %}, {{ variant.attributes }}{% endif %}); 27 28 {{ variant.code | trim | indent(2)}} 29 }, "{{ variant.desc | double_quote_escape }}"); 30 {% endfor %} 31 32 </script>