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.html68
1 files changed, 68 insertions, 0 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
new file mode 100644
index 0000000000..56cde7936a
--- /dev/null
+++ b/testing/web-platform/tests/html/canvas/tools/templates/testharness_element.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
+<title>Canvas test: {{ name }}</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/html/canvas/resources/canvas-tests.js"></script>
+<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
+{% if fonts %}
+<style>
+{% for font in fonts %}
+@font-face {
+ font-family: {{ font }};
+ src: url("/fonts/{{ font }}.ttf");
+}
+{% endfor %}
+</style>
+{% endif %}
+<body class="show_output">
+
+<h1>{{ name }}</h1>
+<p class="desc">{{ desc }}</p>
+
+{% if notes %}<p class="notes">{{ notes }}
+{% else %}
+
+{% endif %}
+{% if fonts and not font_unused_in_dom %}
+{% for font in fonts %}
+<span style="font-family: {{ font }}; position: absolute; visibility: hidden">A</span>
+{% endfor %}
+{% endif %}
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="{{ size[0] }}" height="{{ size[1] }}"
+ {{- canvas}}><p class="fallback">FAIL (fallback content)</p></canvas>
+{% if expected_img %}
+<p class="output expectedtext">Expected output:<p><img src="{{ expected_img }}" class="output expected" id="expected" alt="">
+{%- endif +%}
+<ul id="d"></ul>
+<script>
+
+{#- Promise vs. async test header: +#}
+{% if test_type == 'promise' %}
+promise_test(async t => {
+
+ var canvas = document.getElementById('c');
+ var ctx = canvas.getContext('2d'{% if attributes %}, {{ attributes }}{% endif %});
+{% else %}
+var t = async_test("{{ desc | double_quote_escape }}");
+_addTest(function(canvas, ctx) {
+{% endif %}
+
+ {# Test body: #}
+ {{ code | trim | indent(2) }}
+
+{# Promise vs. async test footer: #}
+{% if test_type == 'promise' %}
+}, "{{ desc }}");
+{% else %}
+}{% if attributes %}, {{ attributes }}{% endif %});
+{% endif -%}
+
+</script>
+{% for image in images %}
+<img src="/images/{{ image }}" id="{{ image }}" class="resource">
+{% endfor -%}
+{% for svgimage in svgimages %}
+<svg><image xlink:href="/images/{{ svgimage }}" id="{{ svgimage }}" class="resource"></svg>
+{% endfor +%}