summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/canvas/tools/templates.yaml
blob: 0806872cbd1d8edeed8eda21a7c4fc440c8a79ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
offscreen: |
    <!DOCTYPE html>
    <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
    <title>OffscreenCanvas test: %(name)s</title>%(timeout)s
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <script src="/html/canvas/resources/canvas-tests.js"></script>

    <h1>%(name)s</h1>
    <p class="desc">%(desc)s</p>

    %(notes)s
    <script>
    var t = async_test("%(escaped_desc)s");
    var t_pass = t.done.bind(t);
    var t_fail = t.step_func(function(reason) {
        throw reason;
    });
    t.step(function() {

      var canvas = new OffscreenCanvas(%(width)s, %(height)s);
      var ctx = canvas.getContext(%(context_args)s);

    %(code)s

    });
    </script>


worker: |
    %(timeout_js)s// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
    // OffscreenCanvas test in a worker:%(name)s
    // Description:%(desc)s
    // Note:%(notes)s

    importScripts("/resources/testharness.js");
    importScripts("/html/canvas/resources/canvas-tests.js");

    var t = async_test("%(escaped_desc)s");
    var t_pass = t.done.bind(t);
    var t_fail = t.step_func(function(reason) {
        throw reason;
    });
    t.step(function() {

      var canvas = new OffscreenCanvas(%(width)s, %(height)s);
      var ctx = canvas.getContext(%(context_args)s);

    %(code)s
    });
    done();


element: |
    <!DOCTYPE html>
    <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
    <title>Canvas test: %(name)s</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">
    %(fonts)s<body class="show_output">

    <h1>%(name)s</h1>
    <p class="desc">%(desc)s</p>

    %(notes)s
    %(fonthack)s<p class="output">Actual output:</p>
    <canvas id="c" class="output" width="%(width)s" height="%(height)s"%(canvas)s>%(fallback)s</canvas>
    %(expected)s
    <ul id="d"></ul>
    <script>
    var t = async_test("%(escaped_desc)s");
    _addTest(function(canvas, ctx) {

    %(code)s

    }%(attributes)s);
    </script>
    %(images)s