summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/canvas/tools/templates/testharness_element.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/canvas/tools/templates/testharness_element.html')
-rw-r--r--testing/web-platform/tests/html/canvas/tools/templates/testharness_element.html24
1 files changed, 16 insertions, 8 deletions
diff --git a/testing/web-platform/tests/html/canvas/tools/templates/testharness_element.html b/testing/web-platform/tests/html/canvas/tools/templates/testharness_element.html
index 56cde7936a..c8de772ea6 100644
--- a/testing/web-platform/tests/html/canvas/tools/templates/testharness_element.html
+++ b/testing/web-platform/tests/html/canvas/tools/templates/testharness_element.html
@@ -42,21 +42,29 @@
{% if test_type == 'promise' %}
promise_test(async t => {
- var canvas = document.getElementById('c');
- var ctx = canvas.getContext('2d'{% if attributes %}, {{ attributes }}{% endif %});
-{% else %}
+{% elif test_type == 'async' %}
+async_test(t => {
+{% elif test_type == 'sync' %}
+test(t => {
+{% endif %}
+{% if not test_type %}
var t = async_test("{{ desc | double_quote_escape }}");
_addTest(function(canvas, ctx) {
+
+{% else %}
+ var canvas = document.getElementById('c');
+ var ctx = canvas.getContext('2d'{% if attributes %}, {{ attributes }}{% endif %});
+
{% endif %}
- {# Test body: #}
- {{ code | trim | indent(2) }}
+ {#- Test body: #}
+ {{ code_element | trim | indent(2) }}
{# Promise vs. async test footer: #}
-{% if test_type == 'promise' %}
-}, "{{ desc }}");
-{% else %}
+{% if not test_type %}
}{% if attributes %}, {{ attributes }}{% endif %});
+{% else %}
+}, "{{ desc | double_quote_escape }}");
{% endif -%}
</script>