summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/canvas
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /testing/web-platform/tests/html/canvas
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/canvas')
-rw-r--r--testing/web-platform/tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.colormix.html33
-rw-r--r--testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html57
-rw-r--r--testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.exceptions.html57
-rw-r--r--testing/web-platform/tests/html/canvas/element/layers/2d.layer.layer-rendering-state-reset-in-layer.html7
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.image.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.imagepattern.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.3arg.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.5arg.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.basic.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destpos.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destsize.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcepos.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcesize.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.alpha.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.broken.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.clip.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.composite.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.floatsource.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedest.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedir.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativesource.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nonfinite.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nowrap.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.path.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.transform.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.image.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.type.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.crosscanvas.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord3.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.image.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.coord1.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.coord1.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.empty.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html57
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.worker.js57
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.html57
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.worker.js57
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.html11
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.worker.js11
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.convertToBlob.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.createImageBitmap.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.basic.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.scale.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.section.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.1.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.2.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.basic.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.1.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.2.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.center.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.ltr.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.rtl.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.left.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.right.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.ltr.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.rtl.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.alphabetic.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.hanging.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.fontface.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.notinpage.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.repeat.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.basic.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.end.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.nonspace.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.other.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.space.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.start.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.actualBoundingBox.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.advances.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.ahem.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.basic.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.empty.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.space.worker.js2
-rw-r--r--testing/web-platform/tests/html/canvas/tools/gentest.py5
-rw-r--r--testing/web-platform/tests/html/canvas/tools/gentestutilsunion.py599
-rw-r--r--testing/web-platform/tests/html/canvas/tools/templates/reftest.html2
-rw-r--r--testing/web-platform/tests/html/canvas/tools/templates/reftest_element.html3
-rw-r--r--testing/web-platform/tests/html/canvas/tools/templates/reftest_offscreen.html2
-rw-r--r--testing/web-platform/tests/html/canvas/tools/templates/reftest_worker.html2
-rw-r--r--testing/web-platform/tests/html/canvas/tools/templates/testharness_element.html24
-rw-r--r--testing/web-platform/tests/html/canvas/tools/templates/testharness_offscreen.html18
-rw-r--r--testing/web-platform/tests/html/canvas/tools/templates/testharness_worker.js17
-rw-r--r--testing/web-platform/tests/html/canvas/tools/yaml-new/color_space.yaml23
-rw-r--r--testing/web-platform/tests/html/canvas/tools/yaml-new/compositing.yaml12
-rw-r--r--testing/web-platform/tests/html/canvas/tools/yaml-new/conformance_requirements.yaml5
-rw-r--r--testing/web-platform/tests/html/canvas/tools/yaml-new/drawing-images-to-the-canvas.yaml32
-rw-r--r--testing/web-platform/tests/html/canvas/tools/yaml-new/drawing-rectangles-to-the-canvas.yaml12
-rw-r--r--testing/web-platform/tests/html/canvas/tools/yaml-new/fill-and-stroke-styles.yaml111
-rw-r--r--testing/web-platform/tests/html/canvas/tools/yaml-new/filters.yaml79
-rw-r--r--testing/web-platform/tests/html/canvas/tools/yaml-new/layers.yaml34
-rw-r--r--testing/web-platform/tests/html/canvas/tools/yaml-new/pixel-manipulation.yaml24
-rw-r--r--testing/web-platform/tests/html/canvas/tools/yaml-new/reset.yaml2
-rw-r--r--testing/web-platform/tests/html/canvas/tools/yaml-new/scroll.yaml13
-rw-r--r--testing/web-platform/tests/html/canvas/tools/yaml-new/shadows.yaml26
-rw-r--r--testing/web-platform/tests/html/canvas/tools/yaml-new/text.yaml28
-rw-r--r--testing/web-platform/tests/html/canvas/tools/yaml-new/video.yaml3
125 files changed, 617 insertions, 1047 deletions
diff --git a/testing/web-platform/tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.colormix.html b/testing/web-platform/tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.colormix.html
new file mode 100644
index 0000000000..f0dff89ae9
--- /dev/null
+++ b/testing/web-platform/tests/html/canvas/element/fill-and-stroke-styles/2d.gradient.colormix.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
+<title>Canvas test: 2d.gradient.colormix</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">
+<body class="show_output">
+
+<h1>2d.gradient.colormix</h1>
+<p class="desc">color-mix works as CanvasGradient color input</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+var t = async_test("color-mix works as CanvasGradient color input");
+_addTest(function(canvas, ctx) {
+
+ var g = ctx.createLinearGradient(0, 0, 100, 0);
+ g.addColorStop(0, '#f00');
+ g.addColorStop(1, 'color-mix(in srgb, #0f0, #00f)');
+ ctx.fillStyle = g;
+ ctx.fillRect(0, 0, 100, 50);
+ _assertPixelApprox(canvas, 25,25, 212,81,61,255, 3);
+ _assertPixelApprox(canvas, 50,25, 167,106,88,255, 3);
+ _assertPixelApprox(canvas, 75,25, 113,120,109,255, 3);
+
+});
+</script>
+
diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html
index 05984a47f8..8fc6377f83 100644
--- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html
+++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html
@@ -77,63 +77,6 @@ _addTest(function(canvas, ctx) {
{name: 'dropShadow', floodOpacity: [20]});
ctx.filter = new CanvasFilter(
{name: 'dropShadow', floodOpacity: '30'});
- // dx
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: 10});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: -1});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: 0.5});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: null});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: true});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: false});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: []});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: [20]});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: '30'});
- // dy
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: 10});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: -1});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: 0.5});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: null});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: true});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: false});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: []});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: [20]});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: '30'});
- // floodOpacity
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: 10});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: -1});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: 0.5});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: null});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: true});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: false});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: []});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: [20]});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: '30'});
// stdDeviation
ctx.filter = new CanvasFilter(
{name: 'dropShadow', stdDeviation: 10});
diff --git a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.exceptions.html b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.exceptions.html
index df5e0c7dc3..0c3b6a8ce9 100644
--- a/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.exceptions.html
+++ b/testing/web-platform/tests/html/canvas/element/filters/2d.filter.layers.dropShadow.exceptions.html
@@ -77,63 +77,6 @@ _addTest(function(canvas, ctx) {
{name: 'dropShadow', floodOpacity: [20]}}); ctx.endLayer();
ctx.beginLayer({filter:
{name: 'dropShadow', floodOpacity: '30'}}); ctx.endLayer();
- // dx
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: 10}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: -1}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: 0.5}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: null}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: true}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: false}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: []}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: [20]}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: '30'}}); ctx.endLayer();
- // dy
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: 10}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: -1}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: 0.5}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: null}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: true}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: false}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: []}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: [20]}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: '30'}}); ctx.endLayer();
- // floodOpacity
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: 10}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: -1}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: 0.5}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: null}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: true}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: false}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: []}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: [20]}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: '30'}}); ctx.endLayer();
// stdDeviation
ctx.beginLayer({filter:
{name: 'dropShadow', stdDeviation: 10}}); ctx.endLayer();
diff --git a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.layer-rendering-state-reset-in-layer.html b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.layer-rendering-state-reset-in-layer.html
index 9283fd39b7..5d755cfc49 100644
--- a/testing/web-platform/tests/html/canvas/element/layers/2d.layer.layer-rendering-state-reset-in-layer.html
+++ b/testing/web-platform/tests/html/canvas/element/layers/2d.layer.layer-rendering-state-reset-in-layer.html
@@ -16,8 +16,9 @@
<ul id="d"></ul>
<script>
-var t = async_test("Tests that layers ignore the global context filter.");
-_addTest(function(canvas, ctx) {
+test(t => {
+ var canvas = document.getElementById('c');
+ var ctx = canvas.getContext('2d');
ctx.globalAlpha = 0.5;
ctx.globalCompositeOperation = 'xor';
@@ -51,6 +52,6 @@ _addTest(function(canvas, ctx) {
_assertSame(ctx.shadowOffsetY, 20, "ctx.shadowOffsetY", "20");
_assertSame(ctx.shadowBlur, 30, "ctx.shadowBlur", "30");
-});
+}, "Tests that layers ignore the global context filter.");
</script>
diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.image.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.image.worker.js
index 20953417cc..1a181a1cc1 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.image.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.image.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -21,6 +20,5 @@ promise_test(async t => {
ctx.drawImage(bitmap, 0, 0);
_assertPixelApprox(canvas, 50,25, 2,253,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.imagepattern.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.imagepattern.worker.js
index c6ab163b65..cb8f1413a2 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.imagepattern.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.imagepattern.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -22,6 +21,5 @@ promise_test(async t => {
ctx.globalAlpha = 0.01;
ctx.fillRect(0, 0, 100, 50);
_assertPixelApprox(canvas, 50,25, 2,253,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.3arg.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.3arg.worker.js
index b2f860bc60..e91416b036 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.3arg.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.3arg.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -28,6 +27,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 99,0, 0,255,0,255, 2);
_assertPixelApprox(canvas, 0,49, 0,255,0,255, 2);
_assertPixelApprox(canvas, 99,49, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.5arg.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.5arg.worker.js
index f725acf011..a852f59e55 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.5arg.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.5arg.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -29,6 +28,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 99,0, 0,255,0,255, 2);
_assertPixelApprox(canvas, 0,49, 0,255,0,255, 2);
_assertPixelApprox(canvas, 99,49, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.basic.worker.js
index b2d6f7d860..ca5b6c223c 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.basic.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.basic.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -22,6 +21,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 99,0, 0,255,0,255, 2);
_assertPixelApprox(canvas, 0,49, 0,255,0,255, 2);
_assertPixelApprox(canvas, 99,49, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destpos.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destpos.worker.js
index 380d526f9b..aff6c21108 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destpos.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destpos.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -28,6 +27,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 99,0, 0,255,0,255, 2);
_assertPixelApprox(canvas, 0,49, 0,255,0,255, 2);
_assertPixelApprox(canvas, 99,49, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destsize.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destsize.worker.js
index 76e3e8baaf..a3c14535c5 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destsize.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destsize.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -30,6 +29,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 99,0, 0,255,0,255, 2);
_assertPixelApprox(canvas, 0,49, 0,255,0,255, 2);
_assertPixelApprox(canvas, 99,49, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcepos.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcepos.worker.js
index d3525435fa..0c060f7008 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcepos.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcepos.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -21,6 +20,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 99,0, 0,255,0,255, 2);
_assertPixelApprox(canvas, 0,49, 0,255,0,255, 2);
_assertPixelApprox(canvas, 99,49, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcesize.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcesize.worker.js
index aa15efb705..7d7f064b26 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcesize.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcesize.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -28,6 +27,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 80,20, 0,255,0,255, 2);
_assertPixelApprox(canvas, 20,30, 0,255,0,255, 2);
_assertPixelApprox(canvas, 80,30, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.alpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.alpha.worker.js
index 958a2431b6..6854a06d9f 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.alpha.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.alpha.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -20,6 +19,5 @@ promise_test(async t => {
ctx.drawImage(bitmap, 0, 0);
_assertPixelApprox(canvas, 50,25, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.broken.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.broken.worker.js
index dc695b5459..1b2b0f83ed 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.broken.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.broken.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -15,6 +14,5 @@ promise_test(async t => {
const blob = await response.blob();
await promise_rejects_dom(t, 'InvalidStateError', createImageBitmap(blob), 'The source image could not be decoded.');
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.clip.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.clip.worker.js
index fea2a7bac7..ce4231c2ac 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.clip.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.clip.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -25,6 +24,5 @@ promise_test(async t => {
ctx.clip();
ctx.drawImage(bitmap, 0, 0);
_assertPixelApprox(canvas, 50,25, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.composite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.composite.worker.js
index 0b17673b68..e9d0d9c77a 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.composite.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.composite.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -20,6 +19,5 @@ promise_test(async t => {
ctx.drawImage(bitmap, 0, 0);
_assertPixelApprox(canvas, 50,25, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.floatsource.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.floatsource.worker.js
index 1efc17d04d..18ecb11aac 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.floatsource.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.floatsource.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -16,6 +15,5 @@ promise_test(async t => {
const bitmap = await createImageBitmap(blob);
ctx.drawImage(bitmap, 10.1, 10.1, 0.1, 0.1, 0, 0, 100, 50);
_assertPixelApprox(canvas, 50,25, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedest.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedest.worker.js
index ce5cf5efad..36c4b27472 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedest.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedest.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -28,6 +27,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 51,48, 0,255,0,255, 2);
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
- t.done();
}, "Negative destination width/height represents the correct rectangle");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedir.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedir.worker.js
index c82b9ba1be..f774deef61 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedir.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedir.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -28,6 +27,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 51,48, 0,255,0,255, 2);
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
- t.done();
}, "Negative dimensions do not affect the direction of the image");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativesource.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativesource.worker.js
index f92d15774d..804a09f699 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativesource.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativesource.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -28,6 +27,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 51,48, 0,255,0,255, 2);
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
- t.done();
}, "Negative source width/height represents the correct rectangle");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nonfinite.worker.js
index a56f09e0b2..e9ca406fd2 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nonfinite.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nonfinite.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -319,6 +318,5 @@ promise_test(async t => {
ctx.drawImage(bitmap, 0, 0, 100, 50, 0, Infinity, 100, Infinity);
ctx.drawImage(bitmap, 0, 0, 100, 50, 0, 0, Infinity, Infinity);
_assertPixel(canvas, 50,25, 0,255,0,255);
- t.done();
}, "drawImage() with Infinity/NaN is ignored");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nowrap.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nowrap.worker.js
index 47a77834c0..5728d424d3 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nowrap.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nowrap.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -21,6 +20,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 45,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 50,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 55,25, 0,255,0,255, 2);
- t.done();
}, "Stretched images do not get pixels wrapping around the edges");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.path.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.path.worker.js
index 3259ff0258..b18d021074 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.path.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.path.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -20,6 +19,5 @@ promise_test(async t => {
ctx.drawImage(bitmap, 0, 0);
ctx.fill();
_assertPixelApprox(canvas, 50,25, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.transform.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.transform.worker.js
index 4a4cd07be9..1ba832155c 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.transform.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.transform.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -20,6 +19,5 @@ promise_test(async t => {
ctx.drawImage(bitmap, 0, 0);
_assertPixelApprox(canvas, 50,25, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.worker.js
index a80bfff562..61b70b0c47 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -20,6 +19,5 @@ promise_test(async t => {
ctx.drawImage(bitmap, 10, 10, 1, 0, 0, 0, 100, 50);
ctx.drawImage(bitmap, 10, 10, 0, 0, 0, 0, 100, 50);
_assertPixelApprox(canvas, 50,25, 0,255,0,255, 2);
- t.done();
}, "drawImage with zero-sized source rectangle draws nothing without exception");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.image.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.image.worker.js
index 14cfcbc993..cc2dc301ca 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.image.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.image.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -24,6 +23,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.type.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.type.worker.js
index 56a8a7d23c..382214a49e 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.type.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.type.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -20,6 +19,5 @@ promise_test(async t => {
var img = await createImageBitmap(blob);
var pattern = ctx.createPattern(img, 'no-repeat');
_assert(pattern.thisImplementsCanvasPattern, "pattern.thisImplementsCanvasPattern");
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.crosscanvas.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.crosscanvas.worker.js
index d9004fc028..ff2acc6851 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.crosscanvas.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.crosscanvas.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -22,6 +21,5 @@ promise_test(async t => {
ctx.fillRect(0, 0, 100, 50);
_assertPixel(canvas, 50,25, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.worker.js
index 9ac4e1605c..a093e61d25 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -25,6 +24,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.worker.js
index 6c4a1409b7..3b4365d6e7 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -28,6 +27,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.worker.js
index d2fdd86022..3314efdd3a 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -29,6 +28,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord3.worker.js
index 584a5d6cfd..6120bd0549 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord3.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord3.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -29,6 +28,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.worker.js
index 0b5fef95ce..b029f90a37 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -31,6 +30,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.image.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.image.worker.js
index b303b2d813..b3e61d53e9 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.image.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.image.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -31,6 +30,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "Image patterns do not get flipped when painted");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.worker.js
index 37f4c04228..872acb1c20 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -25,6 +24,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.worker.js
index efbd1c5846..009b072b22 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -26,6 +25,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.worker.js
index db707ecb0a..21e3349003 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -22,6 +21,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.worker.js
index e58cddccfe..39c6037ad0 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -25,6 +24,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.worker.js
index 4a173af0b4..2b4739fbb4 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -26,6 +25,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.worker.js
index e776f7a008..0b93221e07 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -27,6 +26,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.coord1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.coord1.worker.js
index 57c2102cc8..9dec7cea47 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.coord1.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.coord1.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -31,6 +30,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,25, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.worker.js
index e40f6aa207..65cfe4e5ed 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -28,6 +27,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.worker.js
index 6a53b5dc4d..ee717dcabc 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -27,6 +26,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.coord1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.coord1.worker.js
index d59abb6e07..e35777a8db 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.coord1.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.coord1.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -31,6 +30,5 @@ promise_test(async t => {
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 50,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.worker.js
index c4feba10ca..531ff55637 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -28,6 +27,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.empty.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.empty.worker.js
index 5aefc0dab3..c2ed94a4bb 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.empty.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.empty.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -24,6 +23,5 @@ promise_test(async t => {
_assertPixel(canvas, 98,1, 0,255,0,255);
_assertPixel(canvas, 1,48, 0,255,0,255);
_assertPixel(canvas, 98,48, 0,255,0,255);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html
index cdd501ba8e..4a4ce5a59a 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html
+++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html
@@ -78,63 +78,6 @@ t.step(function() {
{name: 'dropShadow', floodOpacity: [20]});
ctx.filter = new CanvasFilter(
{name: 'dropShadow', floodOpacity: '30'});
- // dx
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: 10});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: -1});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: 0.5});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: null});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: true});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: false});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: []});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: [20]});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: '30'});
- // dy
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: 10});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: -1});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: 0.5});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: null});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: true});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: false});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: []});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: [20]});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: '30'});
- // floodOpacity
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: 10});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: -1});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: 0.5});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: null});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: true});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: false});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: []});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: [20]});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: '30'});
// stdDeviation
ctx.filter = new CanvasFilter(
{name: 'dropShadow', stdDeviation: 10});
diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.worker.js
index 1d56865e68..b51af5757c 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.worker.js
@@ -74,63 +74,6 @@ t.step(function() {
{name: 'dropShadow', floodOpacity: [20]});
ctx.filter = new CanvasFilter(
{name: 'dropShadow', floodOpacity: '30'});
- // dx
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: 10});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: -1});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: 0.5});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: null});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: true});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: false});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: []});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: [20]});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dx: '30'});
- // dy
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: 10});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: -1});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: 0.5});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: null});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: true});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: false});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: []});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: [20]});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', dy: '30'});
- // floodOpacity
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: 10});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: -1});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: 0.5});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: null});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: true});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: false});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: []});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: [20]});
- ctx.filter = new CanvasFilter(
- {name: 'dropShadow', floodOpacity: '30'});
// stdDeviation
ctx.filter = new CanvasFilter(
{name: 'dropShadow', stdDeviation: 10});
diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.html
index 10392dea5a..45d81a6f2b 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.html
+++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.html
@@ -78,63 +78,6 @@ t.step(function() {
{name: 'dropShadow', floodOpacity: [20]}}); ctx.endLayer();
ctx.beginLayer({filter:
{name: 'dropShadow', floodOpacity: '30'}}); ctx.endLayer();
- // dx
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: 10}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: -1}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: 0.5}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: null}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: true}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: false}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: []}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: [20]}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: '30'}}); ctx.endLayer();
- // dy
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: 10}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: -1}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: 0.5}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: null}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: true}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: false}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: []}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: [20]}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: '30'}}); ctx.endLayer();
- // floodOpacity
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: 10}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: -1}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: 0.5}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: null}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: true}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: false}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: []}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: [20]}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: '30'}}); ctx.endLayer();
// stdDeviation
ctx.beginLayer({filter:
{name: 'dropShadow', stdDeviation: 10}}); ctx.endLayer();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.worker.js
index 86b8c56af6..65fc751215 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.layers.dropShadow.exceptions.worker.js
@@ -74,63 +74,6 @@ t.step(function() {
{name: 'dropShadow', floodOpacity: [20]}}); ctx.endLayer();
ctx.beginLayer({filter:
{name: 'dropShadow', floodOpacity: '30'}}); ctx.endLayer();
- // dx
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: 10}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: -1}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: 0.5}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: null}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: true}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: false}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: []}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: [20]}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dx: '30'}}); ctx.endLayer();
- // dy
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: 10}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: -1}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: 0.5}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: null}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: true}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: false}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: []}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: [20]}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', dy: '30'}}); ctx.endLayer();
- // floodOpacity
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: 10}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: -1}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: 0.5}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: null}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: true}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: false}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: []}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: [20]}}); ctx.endLayer();
- ctx.beginLayer({filter:
- {name: 'dropShadow', floodOpacity: '30'}}); ctx.endLayer();
// stdDeviation
ctx.beginLayer({filter:
{name: 'dropShadow', stdDeviation: 10}}); ctx.endLayer();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.html
index 867553b45e..cebdfd5f27 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.html
+++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.html
@@ -10,13 +10,7 @@
<script>
-var t = async_test("Tests that layers ignore the global context filter.");
-var t_pass = t.done.bind(t);
-var t_fail = t.step_func(function(reason) {
- throw reason;
-});
-t.step(function() {
-
+test(t => {
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -51,7 +45,6 @@ t.step(function() {
_assertSame(ctx.shadowOffsetX, 10, "ctx.shadowOffsetX", "10");
_assertSame(ctx.shadowOffsetY, 20, "ctx.shadowOffsetY", "20");
_assertSame(ctx.shadowBlur, 30, "ctx.shadowBlur", "30");
- t.done();
-});
+}, "Tests that layers ignore the global context filter.");
</script>
diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.worker.js
index 5c2bb73e8f..a566cccf14 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.worker.js
@@ -6,13 +6,7 @@
importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
-var t = async_test("Tests that layers ignore the global context filter.");
-var t_pass = t.done.bind(t);
-var t_fail = t.step_func(function(reason) {
- throw reason;
-});
-t.step(function() {
-
+test(t => {
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -47,6 +41,5 @@ t.step(function() {
_assertSame(ctx.shadowOffsetX, 10, "ctx.shadowOffsetX", "10");
_assertSame(ctx.shadowOffsetY, 20, "ctx.shadowOffsetY", "20");
_assertSame(ctx.shadowBlur, 30, "ctx.shadowBlur", "30");
- t.done();
-});
+}, "Tests that layers ignore the global context filter.");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.convertToBlob.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.convertToBlob.worker.js
index be0f4f2cde..8361e19108 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.convertToBlob.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.convertToBlob.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(200, 200);
var ctx = canvas.getContext('2d');
@@ -18,6 +17,5 @@ promise_test(async t => {
// Calling again inside a layer should throw.
ctx.beginLayer();
await promise_rejects_dom(t, 'InvalidStateError', canvas.convertToBlob());
- t.done();
}, "Check that exceptions are thrown for operations that are malformed while layers are open.");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.createImageBitmap.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.createImageBitmap.worker.js
index b286b7a9e7..d64f693864 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.createImageBitmap.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.createImageBitmap.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(200, 200);
var ctx = canvas.getContext('2d');
@@ -18,6 +17,5 @@ promise_test(async t => {
// Calling again inside a layer should throw.
ctx.beginLayer();
await promise_rejects_dom(t, 'InvalidStateError', createImageBitmap(canvas));
- t.done();
}, "Check that exceptions are thrown for operations that are malformed while layers are open.");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.worker.js
index 827bd2ce65..dee8927564 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -21,6 +20,5 @@ promise_test(async t => {
ctx.drawImage(img, 0, -50);
_assertPixelApprox(canvas, 50,25, 127,0,127,255, 2);
- t.done();
}, "Shadows are drawn correctly for partially-transparent images");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.basic.worker.js
index 2d02232c68..7aa17da784 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.basic.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.basic.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -21,6 +20,5 @@ promise_test(async t => {
ctx.drawImage(img, 0, -50);
_assertPixel(canvas, 50,25, 0,255,0,255);
- t.done();
}, "Shadows are drawn for images");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.scale.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.scale.worker.js
index 2c10381f98..3c1cf872ec 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.scale.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.scale.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -23,6 +22,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 50,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
- t.done();
}, "Shadows are drawn correctly for scaled images");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.section.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.section.worker.js
index 94affdfb6a..c357a3a3ab 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.section.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.section.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -23,6 +22,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 50,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
- t.done();
}, "Shadows are not drawn for areas outside image source rectangles");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.1.worker.js
index c5421d7042..5440944e93 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.1.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.1.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -21,6 +20,5 @@ promise_test(async t => {
ctx.drawImage(img, 0, -50);
_assertPixel(canvas, 50,25, 0,255,0,255);
- t.done();
}, "Shadows are not drawn for transparent images");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.2.worker.js
index 071c584fa8..0554c03750 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.2.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.2.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -27,6 +26,5 @@ promise_test(async t => {
_assertPixel(canvas, 25,25, 0,255,0,255);
_assertPixel(canvas, 50,25, 0,255,0,255);
_assertPixel(canvas, 75,25, 0,255,0,255);
- t.done();
}, "Shadows are not drawn for transparent parts of images");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.worker.js
index 41a826a158..9d5e5b07a9 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -23,6 +22,5 @@ promise_test(async t => {
ctx.fillRect(0, -50, 100, 50);
_assertPixelApprox(canvas, 50,25, 127,0,127,255, 2);
- t.done();
}, "Shadows are drawn correctly for partially-transparent fill patterns");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.basic.worker.js
index 7a8f7e8479..d2db2427c5 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.basic.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.basic.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -23,6 +22,5 @@ promise_test(async t => {
ctx.fillRect(0, -50, 100, 50);
_assertPixel(canvas, 50,25, 0,255,0,255);
- t.done();
}, "Shadows are drawn for fill patterns");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.1.worker.js
index 8414db6d08..af079851e6 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.1.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.1.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -23,6 +22,5 @@ promise_test(async t => {
ctx.fillRect(0, -50, 100, 50);
_assertPixel(canvas, 50,25, 0,255,0,255);
- t.done();
}, "Shadows are not drawn for transparent fill patterns");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.2.worker.js
index 726a42d6cd..1cf4f3ee36 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.2.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.2.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -27,6 +26,5 @@ promise_test(async t => {
_assertPixel(canvas, 25,25, 0,255,0,255);
_assertPixel(canvas, 50,25, 0,255,0,255);
_assertPixel(canvas, 75,25, 0,255,0,255);
- t.done();
}, "Shadows are not drawn for transparent parts of fill patterns");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.center.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.center.worker.js
index 44f093cdac..c11c8437e2 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.center.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.center.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -27,6 +26,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 5,45, 0,255,0,255, 2);
_assertPixelApprox(canvas, 95,45, 0,255,0,255, 2);
- t.done();
}, "textAlign center is the center of the em squares (not the bounding box)");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.ltr.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.ltr.worker.js
index 4bd0f5a314..f5c5769470 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.ltr.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.ltr.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -28,6 +27,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 5,45, 0,255,0,255, 2);
_assertPixelApprox(canvas, 95,45, 0,255,0,255, 2);
- t.done();
}, "textAlign end with ltr is the right edge");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.rtl.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.rtl.worker.js
index b3e62d8538..90e21f41dc 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.rtl.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.rtl.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -28,6 +27,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 5,45, 0,255,0,255, 2);
_assertPixelApprox(canvas, 95,45, 0,255,0,255, 2);
- t.done();
}, "textAlign end with rtl is the left edge");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.left.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.left.worker.js
index c7dc0bed42..0f92969632 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.left.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.left.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -27,6 +26,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 5,45, 0,255,0,255, 2);
_assertPixelApprox(canvas, 95,45, 0,255,0,255, 2);
- t.done();
}, "textAlign left is the left of the first em square (not the bounding box)");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.right.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.right.worker.js
index 58fe85e0b7..594192812a 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.right.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.right.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -27,6 +26,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 5,45, 0,255,0,255, 2);
_assertPixelApprox(canvas, 95,45, 0,255,0,255, 2);
- t.done();
}, "textAlign right is the right of the last em square (not the bounding box)");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.ltr.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.ltr.worker.js
index c0793d9af6..32e6fc0f20 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.ltr.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.ltr.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -28,6 +27,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 5,45, 0,255,0,255, 2);
_assertPixelApprox(canvas, 95,45, 0,255,0,255, 2);
- t.done();
}, "textAlign start with ltr is the left edge");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.rtl.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.rtl.worker.js
index ed706c287a..67a196daf7 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.rtl.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.rtl.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -28,6 +27,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 5,45, 0,255,0,255, 2);
_assertPixelApprox(canvas, 95,45, 0,255,0,255, 2);
- t.done();
}, "textAlign start with rtl is the right edge");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.alphabetic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.alphabetic.worker.js
index a98a5863d9..a0ab72915f 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.alphabetic.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.alphabetic.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -27,6 +26,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 5,45, 0,255,0,255, 2);
_assertPixelApprox(canvas, 95,45, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.worker.js
index 30f60c574b..e171388834 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -27,6 +26,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 5,45, 0,255,0,255, 2);
_assertPixelApprox(canvas, 95,45, 0,255,0,255, 2);
- t.done();
}, "textBaseline bottom is the bottom of the em square (not the bounding box)");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.hanging.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.hanging.worker.js
index 638506a279..906fdbbf27 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.hanging.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.hanging.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -27,6 +26,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 5,45, 0,255,0,255, 2);
_assertPixelApprox(canvas, 95,45, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.worker.js
index 7c682fb5f1..76ac1d9da2 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -27,6 +26,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 5,45, 0,255,0,255, 2);
_assertPixelApprox(canvas, 95,45, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.worker.js
index c373ab6c72..c288ab4c86 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -27,6 +26,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 5,45, 0,255,0,255, 2);
_assertPixelApprox(canvas, 95,45, 0,255,0,255, 2);
- t.done();
}, "textBaseline middle is the middle of the em square (not the bounding box)");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.worker.js
index effc4418c3..e7d0b167c0 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -27,6 +26,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 5,45, 0,255,0,255, 2);
_assertPixelApprox(canvas, 95,45, 0,255,0,255, 2);
- t.done();
}, "textBaseline top is the top of the em square (not the bounding box)");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.worker.js
index adcb45faaa..a314870f11 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -24,6 +23,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 95,5, 0,255,0,255, 2);
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
- t.done();
}, "fillText handles maxWidth based on line size, not bounding box size");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.fontface.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.fontface.worker.js
index 8df519b7d1..e225e70351 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.fontface.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.fontface.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -24,6 +23,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 95,5, 0,255,0,255, 2);
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
- t.done();
}, "fillText works on @font-face fonts");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.notinpage.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.notinpage.worker.js
index 628cb39506..c35c82d71f 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.notinpage.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.notinpage.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -24,6 +23,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 95,5, 0,255,0,255, 2);
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
- t.done();
}, "@font-face fonts should work even if they are not used in the page");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.repeat.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.repeat.worker.js
index 7567c09558..fb1f7980a6 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.repeat.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.repeat.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -27,6 +26,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 95,5, 0,255,0,255, 2);
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
- t.done();
}, "Draw with the font immediately, then wait a bit until and draw again. (This crashes some version of WebKit.)");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.worker.js
index 02257f0a06..a09a0f88d7 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -24,6 +23,5 @@ promise_test(async t => {
_assertPixelApprox(canvas, 95,5, 0,255,0,255, 2);
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
- t.done();
}, "");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.basic.worker.js
index ef09925c55..96bd4159c7 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.basic.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.basic.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -22,6 +21,5 @@ promise_test(async t => {
ctx.fillText('E EE', -100, 37.5);
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
- t.done();
}, "U+0020 is rendered the correct size (1em wide)");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.end.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.end.worker.js
index 9a9afa1e74..e9cd9dc829 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.end.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.end.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -23,6 +22,5 @@ promise_test(async t => {
ctx.fillText('EE ', 100, 37.5);
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 75,25, 255,0,0,255, 2);
- t.done();
}, "Space characters at the end of a line are NOT collapsed");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.nonspace.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.nonspace.worker.js
index a12c2f9a48..a37094e28c 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.nonspace.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.nonspace.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -22,6 +21,5 @@ promise_test(async t => {
ctx.fillText('E\x0b EE', -150, 37.5);
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
- t.done();
}, "Non-space characters are not converted to U+0020 and collapsed");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.other.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.other.worker.js
index bbf9e684be..1f090cb426 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.other.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.other.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -22,6 +21,5 @@ promise_test(async t => {
ctx.fillText('E \x09\x0a\x0c\x0d \x09\x0a\x0c\x0dEE', 0, 37.5);
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 75,25, 255,0,0,255, 2);
- t.done();
}, "Space characters are converted to U+0020, and are NOT collapsed");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.space.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.space.worker.js
index e5ab7b67f4..02551b7de7 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.space.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.space.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -22,6 +21,5 @@ promise_test(async t => {
ctx.fillText('E EE', 0, 37.5);
_assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);
_assertPixelApprox(canvas, 75,25, 255,0,0,255, 2);
- t.done();
}, "Space characters are converted to U+0020, and are NOT collapsed");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.start.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.start.worker.js
index 20fec7801f..bd6e523283 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.start.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.start.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -22,6 +21,5 @@ promise_test(async t => {
ctx.fillText(' EE', 0, 37.5);
_assertPixelApprox(canvas, 25,25, 255,0,0,255, 2);
_assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
- t.done();
}, "Space characters at the start of a line are NOT collapsed");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.actualBoundingBox.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.actualBoundingBox.worker.js
index c3d18ff878..aaec2e7e8e 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.actualBoundingBox.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.actualBoundingBox.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -41,6 +40,5 @@ promise_test(async t => {
_assert(ctx.measureText('ABCD').actualBoundingBoxRight >= 200, "ctx.measureText('ABCD').actualBoundingBoxRight >= 200");
_assert(ctx.measureText('ABCD').actualBoundingBoxAscent >= 85, "ctx.measureText('ABCD').actualBoundingBoxAscent >= 85");
_assert(ctx.measureText('ABCD').actualBoundingBoxDescent >= 37, "ctx.measureText('ABCD').actualBoundingBoxDescent >= 37");
- t.done();
}, "Testing actualBoundingBox");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.advances.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.advances.worker.js
index 4b02f06f2d..3bf2d9f719 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.advances.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.advances.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -32,6 +31,5 @@ promise_test(async t => {
_assertSame(ctx.measureText('Hello').advances[2], tm.advances[2], "ctx.measureText('Hello').advances[\""+(2)+"\"]", "tm.advances[\""+(2)+"\"]");
_assertSame(ctx.measureText('Hello').advances[3], tm.advances[3], "ctx.measureText('Hello').advances[\""+(3)+"\"]", "tm.advances[\""+(3)+"\"]");
_assertSame(ctx.measureText('Hello').advances[4], tm.advances[4], "ctx.measureText('Hello').advances[\""+(4)+"\"]", "tm.advances[\""+(4)+"\"]");
- t.done();
}, "Testing width advances");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker.js
index ddb48f4fe0..6e7b064ac8 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -25,6 +24,5 @@ promise_test(async t => {
_assertSame(Math.abs(ctx.measureText('ABCD').alphabeticBaseline), 0, "Math.abs(ctx.measureText('ABCD').alphabeticBaseline)", "0");
_assertSame(ctx.measureText('ABCD').ideographicBaseline, 6.25, "ctx.measureText('ABCD').ideographicBaseline", "6.25");
_assertSame(ctx.measureText('ABCD').hangingBaseline, 25, "ctx.measureText('ABCD').hangingBaseline", "25");
- t.done();
}, "Testing baselines");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker.js
index 09ee787309..cbcb5ec004 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -25,6 +24,5 @@ promise_test(async t => {
_assertSame(ctx.measureText('ABCD').emHeightAscent, 20, "ctx.measureText('ABCD').emHeightAscent", "20");
_assertSame(ctx.measureText('ABCD').emHeightDescent, 20, "ctx.measureText('ABCD').emHeightDescent", "20");
_assertSame(ctx.measureText('ABCD').emHeightDescent + ctx.measureText('ABCD').emHeightAscent, 40, "ctx.measureText('ABCD').emHeightDescent + ctx.measureText('ABCD').emHeightAscent", "40");
- t.done();
}, "Testing emHeights with reduced ascent metric");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker.js
index a2f09782c9..4b62bd5665 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -25,6 +24,5 @@ promise_test(async t => {
_assertSame(ctx.measureText('ABCD').emHeightAscent, 40, "ctx.measureText('ABCD').emHeightAscent", "40");
_assertSame(ctx.measureText('ABCD').emHeightDescent, 0, "ctx.measureText('ABCD').emHeightDescent", "0");
_assertSame(ctx.measureText('ABCD').emHeightDescent + ctx.measureText('ABCD').emHeightAscent, 40, "ctx.measureText('ABCD').emHeightDescent + ctx.measureText('ABCD').emHeightAscent", "40");
- t.done();
}, "Testing emHeights with zero descent metric");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker.js
index 0385d3d737..163394ff1b 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -25,6 +24,5 @@ promise_test(async t => {
_assertSame(ctx.measureText('ABCD').emHeightAscent, 30, "ctx.measureText('ABCD').emHeightAscent", "30");
_assertSame(ctx.measureText('ABCD').emHeightDescent, 10, "ctx.measureText('ABCD').emHeightDescent", "10");
_assertSame(ctx.measureText('ABCD').emHeightDescent + ctx.measureText('ABCD').emHeightAscent, 40, "ctx.measureText('ABCD').emHeightDescent + ctx.measureText('ABCD').emHeightAscent", "40");
- t.done();
}, "Testing emHeights");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker.js
index dea67ff8f6..6ea01b1496 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -23,6 +22,5 @@ promise_test(async t => {
_assertSame(ctx.measureText('ABCD').fontBoundingBoxAscent, 10, "ctx.measureText('ABCD').fontBoundingBoxAscent", "10");
_assertSame(ctx.measureText('ABCD').fontBoundingBoxDescent, 10, "ctx.measureText('ABCD').fontBoundingBoxDescent", "10");
- t.done();
}, "Testing fontBoundingBox for OffscreenCanvas with reduced ascent metric");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker.js
index 99a886d015..c8175eec3c 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -23,6 +22,5 @@ promise_test(async t => {
_assertSame(ctx.measureText('ABCD').fontBoundingBoxAscent, 30, "ctx.measureText('ABCD').fontBoundingBoxAscent", "30");
_assertSame(ctx.measureText('ABCD').fontBoundingBoxDescent, 0, "ctx.measureText('ABCD').fontBoundingBoxDescent", "0");
- t.done();
}, "Testing fontBoundingBox for OffscreenCanvas with zero descent metric");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.ahem.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.ahem.worker.js
index 255bcd108a..080a4d45b8 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.ahem.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.ahem.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -22,6 +21,5 @@ promise_test(async t => {
_assertSame(ctx.measureText('A').fontBoundingBoxDescent, 10, "ctx.measureText('A').fontBoundingBoxDescent", "10");
_assertSame(ctx.measureText('ABCD').fontBoundingBoxAscent, 40, "ctx.measureText('ABCD').fontBoundingBoxAscent", "40");
_assertSame(ctx.measureText('ABCD').fontBoundingBoxDescent, 10, "ctx.measureText('ABCD').fontBoundingBoxDescent", "10");
- t.done();
}, "Testing fontBoundingBox for font ahem");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker.js
index b2cde04c0d..5c28b8f688 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -23,6 +22,5 @@ promise_test(async t => {
_assertSame(ctx.measureText('ABCD').fontBoundingBoxAscent, 30, "ctx.measureText('ABCD').fontBoundingBoxAscent", "30");
_assertSame(ctx.measureText('ABCD').fontBoundingBoxDescent, 10, "ctx.measureText('ABCD').fontBoundingBoxDescent", "10");
- t.done();
}, "Testing fontBoundingBox measurements");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.basic.worker.js
index 866ad8b3c5..f653f20f8e 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.basic.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.basic.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -22,6 +21,5 @@ promise_test(async t => {
ctx.font = '100px CanvasTest';
_assertSame(ctx.measureText('A').width, 100, "ctx.measureText('A').width", "100");
- t.done();
}, "The width of character is same as font used");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.empty.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.empty.worker.js
index 6fb89c5ba7..932b82e129 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.empty.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.empty.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -17,6 +16,5 @@ promise_test(async t => {
await self.fonts.ready;
ctx.font = '50px CanvasTest';
_assertSame(ctx.measureText("").width, 0, "ctx.measureText(\"\").width", "0");
- t.done();
}, "The empty string has zero width");
done();
diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.space.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.space.worker.js
index d832feec5f..3f0e6d65da 100644
--- a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.space.worker.js
+++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.space.worker.js
@@ -7,7 +7,6 @@ importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
promise_test(async t => {
-
var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');
@@ -23,6 +22,5 @@ promise_test(async t => {
_assertSame(ctx.measureText(' AB').width, 150, "ctx.measureText(' AB').width", "150");
_assertSame(ctx.measureText('AB ').width, 150, "ctx.measureText('AB ').width", "150");
- t.done();
}, "Space characters are converted to U+0020 and NOT collapsed");
done();
diff --git a/testing/web-platform/tests/html/canvas/tools/gentest.py b/testing/web-platform/tests/html/canvas/tools/gentest.py
index 36cb7fe0f6..784005fc9a 100644
--- a/testing/web-platform/tests/html/canvas/tools/gentest.py
+++ b/testing/web-platform/tests/html/canvas/tools/gentest.py
@@ -1,3 +1,4 @@
+"""Script invoking the old and the new Canvas test generator."""
# To use this script:
# -make a python virtual environment somewhere (it doesn't matter where)
# python3 -m venv venv
@@ -9,10 +10,10 @@
# python3 gentest.py
from gentestutils import genTestUtils
-from gentestutilsunion import genTestUtils_union
+import gentestutilsunion
genTestUtils('../element', '../element', 'templates.yaml',
'name2dir-canvas.yaml', False)
genTestUtils('../offscreen', '../offscreen', 'templates.yaml',
'name2dir-offscreen.yaml', True)
-genTestUtils_union('name2dir.yaml')
+gentestutilsunion.generate_test_files('name2dir.yaml')
diff --git a/testing/web-platform/tests/html/canvas/tools/gentestutilsunion.py b/testing/web-platform/tests/html/canvas/tools/gentestutilsunion.py
index d7042810be..57077f6057 100644
--- a/testing/web-platform/tests/html/canvas/tools/gentestutilsunion.py
+++ b/testing/web-platform/tests/html/canvas/tools/gentestutilsunion.py
@@ -1,3 +1,4 @@
+"""Generates Canvas tests from YAML file definitions."""
# Current code status:
#
# This was originally written by Philip Taylor for use at
@@ -28,7 +29,8 @@
#
# * Test the tests, add new ones to Git, remove deleted ones from Git, etc.
-from typing import Any, DefaultDict, List, Mapping, Optional, Set, Tuple
+from typing import Any, DefaultDict, FrozenSet, List, Mapping, MutableMapping
+from typing import Optional, Set, Tuple
import re
import collections
@@ -36,10 +38,12 @@ import dataclasses
import enum
import importlib
import itertools
-import jinja2
import os
import pathlib
import sys
+import textwrap
+
+import jinja2
try:
import cairocffi as cairo # type: ignore
@@ -61,12 +65,12 @@ class InvalidTestDefinitionError(Error):
"""Raised on invalid test definition."""
-def _doubleQuoteEscape(string: str) -> str:
+def _double_quote_escape(string: str) -> str:
return string.replace('\\', '\\\\').replace('"', '\\"')
-def _escapeJS(string: str) -> str:
- string = _doubleQuoteEscape(string)
+def _escape_js(string: str) -> str:
+ string = _double_quote_escape(string)
# Kind of an ugly hack, for nicer failure-message output.
string = re.sub(r'\[(\w+)\]', r'[\\""+(\1)+"\\"]', string)
return string
@@ -135,15 +139,15 @@ def _expand_nonfinite(method: str, argstr: str, tail: str) -> str:
match = re.match('<(.*)>', arg)
if match is None:
raise InvalidTestDefinitionError(
- f"Expected arg to match format '<(.*)>', but was: {arg}")
+ f'Expected arg to match format "<(.*)>", but was: {arg}')
a = match.group(1)
args.append(a.split(' '))
calls = []
# Start with the valid argument list.
call = [args[j][0] for j in range(len(args))]
# For each argument alone, try setting it to all its invalid values:
- for i in range(len(args)):
- for a in args[i][1:]:
+ for i, arg in enumerate(args):
+ for a in arg[1:]:
c2 = call[:]
c2[i] = a
calls.append(c2)
@@ -162,7 +166,8 @@ def _expand_nonfinite(method: str, argstr: str, tail: str) -> str:
f(call, 0, 0)
- return '\n'.join('%s(%s)%s' % (method, ', '.join(c), tail) for c in calls)
+ str_calls = (', '.join(c) for c in calls)
+ return '\n'.join(f'{method}({params}){tail}' for params in str_calls)
def _get_test_sub_dir(name: str, name_to_sub_dir: Mapping[str, str]) -> str:
@@ -170,7 +175,7 @@ def _get_test_sub_dir(name: str, name_to_sub_dir: Mapping[str, str]) -> str:
if name.startswith(prefix):
return name_to_sub_dir[prefix]
raise InvalidTestDefinitionError(
- 'Test "%s" has no defined target directory mapping' % name)
+ f'Test "{name}" has no defined target directory mapping')
def _remove_extra_newlines(text: str) -> str:
@@ -183,6 +188,7 @@ def _remove_extra_newlines(text: str) -> str:
text = re.sub(r'\\-\n\s*', '', text, flags=re.MULTILINE | re.DOTALL)
return text
+
def _expand_test_code(code: str) -> str:
code = re.sub(r' @moz-todo', '', code)
@@ -215,48 +221,59 @@ def _expand_test_code(code: str) -> str:
flags=re.MULTILINE | re.DOTALL)
code = re.sub(
- r'@assert (.*) === (.*);', lambda m: '_assertSame(%s, %s, "%s", "%s");'
- % (m.group(1), m.group(2), _escapeJS(m.group(1)), _escapeJS(m.group(2))
- ), code)
+ r'@assert (.*) === (.*);', lambda m:
+ (f'_assertSame({m.group(1)}, {m.group(2)}, '
+ f'"{_escape_js(m.group(1))}", "{_escape_js(m.group(2))}");'), code)
code = re.sub(
r'@assert (.*) !== (.*);', lambda m:
- '_assertDifferent(%s, %s, "%s", "%s");' % (m.group(1), m.group(
- 2), _escapeJS(m.group(1)), _escapeJS(m.group(2))), code)
+ (f'_assertDifferent({m.group(1)}, {m.group(2)}, '
+ f'"{_escape_js(m.group(1))}", "{_escape_js(m.group(2))}");'), code)
code = re.sub(
- r'@assert (.*) =~ (.*);', lambda m: 'assert_regexp_match(%s, %s);' % (
- m.group(1), m.group(2)), code)
+ r'@assert (.*) =~ (.*);',
+ lambda m: f'assert_regexp_match({m.group(1)}, {m.group(2)});', code)
code = re.sub(
- r'@assert (.*);', lambda m: '_assert(%s, "%s");' % (m.group(
- 1), _escapeJS(m.group(1))), code)
+ r'@assert (.*);',
+ lambda m: f'_assert({m.group(1)}, "{_escape_js(m.group(1))}");', code)
- assert ('@' not in code)
+ assert '@' not in code
return code
-class CanvasType(str, enum.Enum):
- HTML_CANVAS = 'htmlcanvas'
- OFFSCREEN_CANVAS = 'offscreencanvas'
- WORKER = 'worker'
+_TestParams = Mapping[str, Any]
+_MutableTestParams = MutableMapping[str, Any]
+
+class _CanvasType(str, enum.Enum):
+ HTML_CANVAS = 'HtmlCanvas'
+ OFFSCREEN_CANVAS = 'OffscreenCanvas'
+ WORKER = 'Worker'
-def _get_enabled_canvas_types(test: Mapping[str, Any]) -> Set[CanvasType]:
- return {CanvasType(t.lower()) for t in test.get('canvasType', CanvasType)}
+
+class _TemplateType(str, enum.Enum):
+ REFERENCE = 'reference'
+ HTML_REFERENCE = 'html_reference'
+ TESTHARNESS = 'testharness'
@dataclasses.dataclass
-class TestConfig:
- out_dir: str
- image_out_dir: str
+class _OutputPaths:
+ element: str
+ offscreen: str
+
+ def sub_path(self, sub_dir: str):
+ """Create a new _OutputPaths that is a subpath of this _OutputPath."""
+ return _OutputPaths(element=os.path.join(self.element, sub_dir),
+ offscreen=os.path.join(self.offscreen, sub_dir))
-def _validate_test(test: Mapping[str, Any]):
+def _validate_test(test: _TestParams):
if test.get('expected', '') == 'green' and re.search(
r'@assert pixel .* 0,0,0,0;', test['code']):
- print('Probable incorrect pixel test in %s' % test['name'])
+ print(f'Probable incorrect pixel test in {test["name"]}')
if 'size' in test and (not isinstance(test['size'], list)
or len(test['size']) != 2):
@@ -264,21 +281,20 @@ def _validate_test(test: Mapping[str, Any]):
f'Invalid canvas size "{test["size"]}" in test {test["name"]}. '
'Expected an array with two numbers.')
- if 'test_type' in test and test['test_type'] != 'promise':
- raise InvalidTestDefinitionError(
- f'Test {test["name"]}\' test_type is invalid, it only accepts '
- '"promise" now for creating promise test type in the template '
- 'file.')
+ if test['template_type'] == _TemplateType.TESTHARNESS:
+ valid_test_types = {'sync', 'async', 'promise'}
+ else:
+ valid_test_types = {'promise'}
- if 'reference' in test and 'html_reference' in test:
+ test_type = test.get('test_type')
+ if test_type is not None and test_type not in valid_test_types:
raise InvalidTestDefinitionError(
- f'Test {test["name"]} is invalid, "reference" and "html_reference" '
- 'can\'t both be specified at the same time.')
+ f'Invalid test_type: {test_type}. '
+ f'Valid values are: {valid_test_types}.')
-def _render_template(jinja_env: jinja2.Environment,
- template: jinja2.Template,
- params: Mapping[str, Any]) -> str:
+def _render_template(jinja_env: jinja2.Environment, template: jinja2.Template,
+ params: _TestParams) -> str:
"""Renders the specified jinja template.
The template is repetitively rendered until no more changes are observed.
@@ -294,236 +310,276 @@ def _render_template(jinja_env: jinja2.Environment,
def _render(jinja_env: jinja2.Environment, template_name: str,
- params: Mapping[str, Any]):
- params = dict(params)
- params.update({
- # Render the code on its own, as it could contain templates expanding
- # to multuple lines. This is needed to get proper indentation of the
- # code in the main template.
- 'code': _render_template(jinja_env,
- jinja_env.from_string(params['code']),
- params)
- })
-
- return _render_template(jinja_env, jinja_env.get_template(template_name),
- params)
-
-
-def _write_reference_test(jinja_env: jinja2.Environment,
- params: Mapping[str, Any],
- enabled_tests: Set[CanvasType],
- canvas_path: str, offscreen_path: str):
- if CanvasType.HTML_CANVAS in enabled_tests:
- html_params = dict(params)
- html_params.update({'canvas_type': CanvasType.HTML_CANVAS.value})
- pathlib.Path(f'{canvas_path}.html').write_text(
- _render(jinja_env, "reftest_element.html", html_params), 'utf-8')
- if CanvasType.OFFSCREEN_CANVAS in enabled_tests:
- offscreen_params = dict(params)
- offscreen_params.update({
- 'canvas_type': CanvasType.OFFSCREEN_CANVAS.value
- })
- pathlib.Path(f'{offscreen_path}.html').write_text(
- _render(jinja_env, "reftest_offscreen.html", offscreen_params),
- 'utf-8')
- if CanvasType.WORKER in enabled_tests:
- worker_params = dict(params)
- worker_params.update({'canvas_type': CanvasType.WORKER.value})
- pathlib.Path(f'{offscreen_path}.w.html').write_text(
- _render(jinja_env, "reftest_worker.html", worker_params), 'utf-8')
-
- js_ref = params.get('reference', '')
- html_ref = params.get('html_reference', '')
- ref_params = dict(params)
- ref_params.update({
- 'is_test_reference': True,
- 'code': js_ref or html_ref
- })
- ref_template_name = 'reftest_element.html' if js_ref else 'reftest.html'
- if CanvasType.HTML_CANVAS in enabled_tests:
- pathlib.Path(f'{canvas_path}-expected.html').write_text(
- _render(jinja_env, ref_template_name, ref_params), 'utf-8')
- if {CanvasType.OFFSCREEN_CANVAS, CanvasType.WORKER} & enabled_tests:
- pathlib.Path(f'{offscreen_path}-expected.html').write_text(
- _render(jinja_env, ref_template_name, ref_params), 'utf-8')
-
-
-def _write_testharness_test(jinja_env: jinja2.Environment,
- params: Mapping[str, Any],
- enabled_tests: Set[CanvasType],
- canvas_path: str,
- offscreen_path: str):
- # Create test cases for canvas and offscreencanvas.
- if CanvasType.HTML_CANVAS in enabled_tests:
- html_params = dict(params)
- html_params.update({'canvas_type': CanvasType.HTML_CANVAS.value})
- pathlib.Path(f'{canvas_path}.html').write_text(
- _render(jinja_env, "testharness_element.html", html_params),
- 'utf-8')
-
- if CanvasType.OFFSCREEN_CANVAS in enabled_tests:
- offscreen_params = dict(params)
- offscreen_params.update({
- 'canvas_type': CanvasType.OFFSCREEN_CANVAS.value
- })
- pathlib.Path(f'{offscreen_path}.html').write_text(
- _render(jinja_env, "testharness_offscreen.html", offscreen_params),
- 'utf-8')
-
- if CanvasType.WORKER in enabled_tests:
- worker_params = dict(params)
- worker_params.update({'canvas_type': CanvasType.WORKER.value})
- pathlib.Path(f'{offscreen_path}.worker.js').write_text(
- _render(jinja_env, "testharness_worker.js", worker_params),
- 'utf-8')
-
-
-def _generate_expected_image(expected: str, name: str, sub_dir: str,
- enabled_canvas_types: Set[CanvasType],
- html_canvas_cfg: TestConfig,
- offscreen_canvas_cfg: TestConfig) -> str:
- """Creates a reference image using Cairo and returns the file location."""
- if expected == 'green':
- return '/images/green-100x50.png'
- if expected == 'clear':
- return '/images/clear-100x50.png'
- if ';' in expected:
- print('Found semicolon in %s' % name)
- expected = re.sub(
- r'^size (\d+) (\d+)',
- r'surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, \1, \2)'
- r'\ncr = cairo.Context(surface)', expected)
-
- if CanvasType.HTML_CANVAS in enabled_canvas_types:
- expected_canvas = (
- expected + "\nsurface.write_to_png('%s.png')\n" %
- os.path.join(html_canvas_cfg.image_out_dir, sub_dir, name))
- eval(compile(expected_canvas, '<test %s>' % name, 'exec'), {},
- {'cairo': cairo})
-
- if {CanvasType.OFFSCREEN_CANVAS, CanvasType.WORKER} & enabled_canvas_types:
- expected_offscreen = (
- expected + "\nsurface.write_to_png('%s.png')\n" %
- os.path.join(offscreen_canvas_cfg.image_out_dir, sub_dir, name))
- eval(compile(expected_offscreen, '<test %s>' % name, 'exec'), {},
- {'cairo': cairo})
-
- return '%s.png' % name
-
-
-def _generate_test(test: Mapping[str, Any], jinja_env: jinja2.Environment,
- name_to_sub_dir: Mapping[str, str],
- used_tests: DefaultDict[str, Set[CanvasType]],
- html_canvas_cfg: TestConfig,
- offscreen_canvas_cfg: TestConfig) -> None:
- _validate_test(test)
-
- name = test['name']
-
- sub_dir = _get_test_sub_dir(name, name_to_sub_dir)
- enabled_canvas_types = _get_enabled_canvas_types(test)
-
- # Defaults:
- params = {
- 'desc': '',
- 'size': [100, 50],
- }
-
- params.update(test)
-
- # Render parameters used in the test name.
- name = jinja_env.from_string(name).render(params)
- print('\r(%s)' % name, ' ' * 32, '\t')
-
- expected_img = None
- if 'expected' in test and test['expected'] is not None:
- expected_img = _generate_expected_image(test['expected'], name,
- sub_dir, enabled_canvas_types,
- html_canvas_cfg,
- offscreen_canvas_cfg)
-
- params.update({
- 'code': _expand_test_code(test['code']),
- 'expected_img': expected_img
- })
-
- already_tested = used_tests[name].intersection(enabled_canvas_types)
- if already_tested:
- raise InvalidTestDefinitionError(
- f'Test {name} is defined twice for types {already_tested}')
- used_tests[name].update(enabled_canvas_types)
+ params: _TestParams, output_file_name: str):
+ template = jinja_env.get_template(template_name)
+ file_content = _render_template(jinja_env, template, params)
+ pathlib.Path(output_file_name).write_text(file_content, 'utf-8')
+
+
+def _preprocess_code(jinja_env: jinja2.Environment, code: str,
+ params: _TestParams) -> str:
+ code = _expand_test_code(code)
+ # Render the code on its own, as it could contain templates expanding
+ # to multiple lines. This is needed to get proper indentation of the
+ # code in the main template.
+ code = _render_template(jinja_env, jinja_env.from_string(code), params)
+ return code
- canvas_path = os.path.join(html_canvas_cfg.out_dir, sub_dir, name)
- offscreen_path = os.path.join(offscreen_canvas_cfg.out_dir, sub_dir, name)
- if 'manual' in test:
- canvas_path += '-manual'
- offscreen_path += '-manual'
- if 'reference' in test or 'html_reference' in test:
- _write_reference_test(jinja_env, params, enabled_canvas_types,
- canvas_path, offscreen_path)
- else:
- _write_testharness_test(jinja_env, params, enabled_canvas_types,
- canvas_path, offscreen_path)
+class _Variant():
+
+ def __init__(self, params: _MutableTestParams) -> None:
+ self._params = params
+
+ @property
+ def params(self) -> _TestParams:
+ """Read-only getter for this variant's param dict."""
+ return self._params
+
+ @staticmethod
+ def create_with_defaults(test: _TestParams) -> '_Variant':
+ """Create a _Variant from the specified params.
+
+ Default values are added for certain parameters, if missing."""
+ params = {
+ 'desc': '',
+ 'size': [100, 50],
+ 'variant_names': [],
+ }
+ params.update(test)
+ return _Variant(params)
+ def _get_variant_name(self, jinja_env: jinja2.Environment) -> str:
+ name = self.params['name']
+ if self.params.get('append_variants_to_name', True):
+ name = '.'.join([name] + self.params['variant_names'])
-def _recursive_expand_variant_matrix(test_list: List[Mapping[str, Any]],
- variant_matrix: List[Mapping[str, Any]],
+ name = jinja_env.from_string(name).render(self.params)
+ return name
+
+ def _get_file_name(self) -> str:
+ file_name = self.params['name']
+
+ if 'manual' in self.params:
+ file_name += '-manual'
+
+ return file_name
+
+ def _get_canvas_types(self) -> FrozenSet[_CanvasType]:
+ canvas_types = self.params.get('canvas_types', _CanvasType)
+ invalid_types = {
+ type
+ for type in canvas_types if type not in list(_CanvasType)
+ }
+ if invalid_types:
+ raise InvalidTestDefinitionError(
+ f'Invalid canvas_types: {list(invalid_types)}. '
+ f'Accepted values are: {[t.value for t in _CanvasType]}')
+ return frozenset(_CanvasType(t) for t in canvas_types)
+
+ def _get_template_type(self) -> _TemplateType:
+ if 'reference' in self.params and 'html_reference' in self.params:
+ raise InvalidTestDefinitionError(
+ f'Test {self.params["name"]} is invalid, "reference" and '
+ '"html_reference" can\'t both be specified at the same time.')
+
+ if 'reference' in self.params:
+ return _TemplateType.REFERENCE
+ if 'html_reference' in self.params:
+ return _TemplateType.HTML_REFERENCE
+ return _TemplateType.TESTHARNESS
+
+ def finalize_params(self, jinja_env: jinja2.Environment) -> None:
+ """Finalize this variant by adding computed param fields."""
+ self._params['name'] = self._get_variant_name(jinja_env)
+ self._params['file_name'] = self._get_file_name()
+ self._params['canvas_types'] = self._get_canvas_types()
+ self._params['template_type'] = self._get_template_type()
+
+ if 'reference' in self._params:
+ self._params['reference'] = _preprocess_code(
+ jinja_env, self._params['reference'], self._params)
+
+ if 'html_reference' in self._params:
+ self._params['html_reference'] = _preprocess_code(
+ jinja_env, self._params['html_reference'], self._params)
+
+ code_params = dict(self.params)
+ if _CanvasType.HTML_CANVAS in self.params['canvas_types']:
+ code_params['canvas_type'] = _CanvasType.HTML_CANVAS.value
+ self._params['code_element'] = _preprocess_code(
+ jinja_env, self._params['code'], code_params)
+
+ if _CanvasType.OFFSCREEN_CANVAS in self.params['canvas_types']:
+ code_params['canvas_type'] = _CanvasType.OFFSCREEN_CANVAS.value
+ self._params['code_offscreen'] = _preprocess_code(
+ jinja_env, self._params['code'], code_params)
+
+ if _CanvasType.WORKER in self.params['canvas_types']:
+ code_params['canvas_type'] = _CanvasType.WORKER.value
+ self._params['code_worker'] = _preprocess_code(
+ jinja_env, self._params['code'], code_params)
+
+ _validate_test(self._params)
+
+ def generate_expected_image(self, output_dirs: _OutputPaths) -> None:
+ """Creates a reference image using Cairo and save filename in params."""
+ if 'expected' not in self.params:
+ return
+
+ expected = self.params['expected']
+ name = self.params['name']
+
+ if expected == 'green':
+ self._params['expected_img'] = '/images/green-100x50.png'
+ return
+ if expected == 'clear':
+ self._params['expected_img'] = '/images/clear-100x50.png'
+ return
+ if ';' in expected:
+ print(f'Found semicolon in {name}')
+ expected = re.sub(
+ r'^size (\d+) (\d+)',
+ r'surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, \1, \2)'
+ r'\ncr = cairo.Context(surface)', expected)
+
+ output_paths = output_dirs.sub_path(name)
+ if _CanvasType.HTML_CANVAS in self.params['canvas_types']:
+ expected_canvas = (
+ f'{expected}\n'
+ f'surface.write_to_png("{output_paths.element}.png")\n')
+ eval(compile(expected_canvas, f'<test {name}>', 'exec'), {},
+ {'cairo': cairo})
+
+ if {_CanvasType.OFFSCREEN_CANVAS, _CanvasType.WORKER
+ } & self.params['canvas_types']:
+ expected_offscreen = (
+ f'{expected}\n'
+ f'surface.write_to_png("{output_paths.offscreen}.png")\n')
+ eval(compile(expected_offscreen, f'<test {name}>', 'exec'), {},
+ {'cairo': cairo})
+
+ self._params['expected_img'] = f'{name}.png'
+
+ def _write_reference_test(self, jinja_env: jinja2.Environment,
+ output_files: _OutputPaths):
+ params = dict(self.params)
+ if _CanvasType.HTML_CANVAS in params['canvas_types']:
+ _render(jinja_env, 'reftest_element.html', params,
+ f'{output_files.element}.html')
+ if _CanvasType.OFFSCREEN_CANVAS in params['canvas_types']:
+ _render(jinja_env, 'reftest_offscreen.html', params,
+ f'{output_files.offscreen}.html')
+ if _CanvasType.WORKER in params['canvas_types']:
+ _render(jinja_env, 'reftest_worker.html', params,
+ f'{output_files.offscreen}.w.html')
+
+ params['is_test_reference'] = True
+ is_html_ref = params['template_type'] == _TemplateType.HTML_REFERENCE
+ ref_template = 'reftest.html' if is_html_ref else 'reftest_element.html'
+ if _CanvasType.HTML_CANVAS in params['canvas_types']:
+ _render(jinja_env, ref_template, params,
+ f'{output_files.element}-expected.html')
+ if {_CanvasType.OFFSCREEN_CANVAS, _CanvasType.WORKER
+ } & params['canvas_types']:
+ _render(jinja_env, ref_template, params,
+ f'{output_files.offscreen}-expected.html')
+
+ def _write_testharness_test(self, jinja_env: jinja2.Environment,
+ output_files: _OutputPaths):
+ # Create test cases for canvas and offscreencanvas.
+ if _CanvasType.HTML_CANVAS in self.params['canvas_types']:
+ _render(jinja_env, 'testharness_element.html', self.params,
+ f'{output_files.element}.html')
+
+ if _CanvasType.OFFSCREEN_CANVAS in self.params['canvas_types']:
+ _render(jinja_env, 'testharness_offscreen.html', self.params,
+ f'{output_files.offscreen}.html')
+
+ if _CanvasType.WORKER in self.params['canvas_types']:
+ _render(jinja_env, 'testharness_worker.js', self.params,
+ f'{output_files.offscreen}.worker.js')
+
+ def generate_test(self, jinja_env: jinja2.Environment,
+ output_dirs: _OutputPaths) -> None:
+ """Generate the test files to the specified output dirs."""
+ output_files = output_dirs.sub_path(self.params['file_name'])
+
+ if self.params['template_type'] in (_TemplateType.REFERENCE,
+ _TemplateType.HTML_REFERENCE):
+ self._write_reference_test(jinja_env, output_files)
+ else:
+ self._write_testharness_test(jinja_env, output_files)
+
+
+def _recursive_expand_variant_matrix(original_test: _TestParams,
+ variant_matrix: List[_TestParams],
current_selection: List[Tuple[str, Any]],
- original_test: Mapping[str, Any]):
+ test_variants: List[_Variant]):
if len(current_selection) == len(variant_matrix):
# Selection for each variant is done, so add a new test to test_list.
- test = original_test.copy()
+ test = dict(original_test)
variant_name_list = []
- should_append_variant_names = original_test.get(
- 'append_variants_to_name', True)
for variant_name, variant_params in current_selection:
- variant_name_list.append(variant_name)
- # Append variant name. Variant names starting with '_' are
- # not appended, which is useful to create variants with the same
- # name in different folders (element vs. offscreen).
- if (should_append_variant_names
- and not variant_name.startswith('_')):
- test['name'] += '.' + variant_name
test.update(variant_params)
- # Expose variant names as a list so they can be used from the yaml
- # files, which helps with better naming of tests.
- test.update({'variant_names': variant_name_list})
- test_list.append(test)
+ variant_name_list.append(variant_name)
+ # Expose variant names as a list so they can be used from the yaml
+ # files, which helps with better naming of tests.
+ test.update({'variant_names': variant_name_list})
+ test_variants.append(_Variant.create_with_defaults(test))
else:
# Continue the recursion with each possible selection for the current
# variant.
variant = variant_matrix[len(current_selection)]
for variant_options in variant.items():
current_selection.append(variant_options)
- _recursive_expand_variant_matrix(test_list, variant_matrix,
- current_selection, original_test)
+ _recursive_expand_variant_matrix(original_test, variant_matrix,
+ current_selection, test_variants)
current_selection.pop()
-def _expand_variant_matrix(
- variant_matrix: List[Mapping[str, Any]],
- original_test: Mapping[str, Any]) -> List[Mapping[str, Any]]:
+def _get_variants(test: _TestParams) -> List[_Variant]:
current_selection = []
- matrix_tests = []
- _recursive_expand_variant_matrix(matrix_tests, variant_matrix,
- current_selection, original_test)
- return matrix_tests
+ test_variants = []
+ variants = test.get('variants', [])
+ if not isinstance(variants, list):
+ raise InvalidTestDefinitionError(
+ textwrap.dedent("""
+ Variants must be specified as a list of variant dimensions, e.g.:
+ variants:
+ - dimension1-variant1:
+ param: ...
+ dimension1-variant2:
+ param: ...
+ - dimension2-variant1:
+ param: ...
+ dimension2-variant2:
+ param: ..."""))
+ _recursive_expand_variant_matrix(test, variants, current_selection,
+ test_variants)
+ return test_variants
+
+
+def _check_uniqueness(tested: DefaultDict[str, Set[_CanvasType]], name: str,
+ canvas_types: FrozenSet[_CanvasType]) -> None:
+ already_tested = tested[name].intersection(canvas_types)
+ if already_tested:
+ raise InvalidTestDefinitionError(
+ f'Test {name} is defined twice for types {already_tested}')
+ tested[name].update(canvas_types)
-def genTestUtils_union(NAME2DIRFILE: str) -> None:
- CANVASOUTPUTDIR = '../element'
- CANVASIMAGEOUTPUTDIR = '../element'
- OFFSCREENCANVASOUTPUTDIR = '../offscreen'
- OFFSCREENCANVASIMAGEOUTPUTDIR = '../offscreen'
+def generate_test_files(name_to_dir_file: str) -> None:
+ """Generate Canvas tests from YAML file definition."""
+ output_dirs = _OutputPaths(element='../element', offscreen='../offscreen')
jinja_env = jinja2.Environment(
- loader=jinja2.PackageLoader("gentestutilsunion"),
+ loader=jinja2.PackageLoader('gentestutilsunion'),
keep_trailing_newline=True,
trim_blocks=True,
lstrip_blocks=True)
- jinja_env.filters['double_quote_escape'] = _doubleQuoteEscape
+ jinja_env.filters['double_quote_escape'] = _double_quote_escape
# Run with --test argument to run unit tests.
if len(sys.argv) > 1 and sys.argv[1] == '--test':
@@ -531,16 +587,19 @@ def genTestUtils_union(NAME2DIRFILE: str) -> None:
doctest.testmod()
sys.exit()
- name_to_sub_dir = yaml.safe_load(pathlib.Path(NAME2DIRFILE).read_text())
+ name_to_sub_dir = (yaml.safe_load(
+ pathlib.Path(name_to_dir_file).read_text(encoding='utf-8')))
tests = []
test_yaml_directory = 'yaml-new'
- TESTSFILES = [
+ yaml_files = [
os.path.join(test_yaml_directory, f)
for f in os.listdir(test_yaml_directory) if f.endswith('.yaml')
]
- for t in sum(
- [yaml.safe_load(pathlib.Path(f).read_text()) for f in TESTSFILES], []):
+ for t in sum([
+ yaml.safe_load(pathlib.Path(f).read_text(encoding='utf-8'))
+ for f in yaml_files
+ ], []):
if 'DISABLED' in t:
continue
if 'meta' in t:
@@ -550,14 +609,11 @@ def genTestUtils_union(NAME2DIRFILE: str) -> None:
tests.append(t)
# Ensure the test output directories exist.
- testdirs = [
- CANVASOUTPUTDIR, OFFSCREENCANVASOUTPUTDIR, CANVASIMAGEOUTPUTDIR,
- OFFSCREENCANVASIMAGEOUTPUTDIR
- ]
+ test_dirs = [output_dirs.element, output_dirs.offscreen]
for sub_dir in set(name_to_sub_dir.values()):
- testdirs.append('%s/%s' % (CANVASOUTPUTDIR, sub_dir))
- testdirs.append('%s/%s' % (OFFSCREENCANVASOUTPUTDIR, sub_dir))
- for d in testdirs:
+ test_dirs.append(f'{output_dirs.element}/{sub_dir}')
+ test_dirs.append(f'{output_dirs.offscreen}/{sub_dir}')
+ for d in test_dirs:
try:
os.mkdir(d)
except FileExistsError:
@@ -565,24 +621,19 @@ def genTestUtils_union(NAME2DIRFILE: str) -> None:
used_tests = collections.defaultdict(set)
for test in tests:
- if 'variant_matrix' in test:
- variants = _expand_variant_matrix(test['variant_matrix'], test)
- elif 'variants' in test:
- variant_matrix = [test['variants']]
- variants = _expand_variant_matrix(variant_matrix, test)
- else:
- variants = [test]
-
- for variant in variants:
- _generate_test(variant,
- jinja_env,
- name_to_sub_dir,
- used_tests,
- html_canvas_cfg=TestConfig(
- out_dir=CANVASOUTPUTDIR,
- image_out_dir=CANVASIMAGEOUTPUTDIR),
- offscreen_canvas_cfg=TestConfig(
- out_dir=OFFSCREENCANVASOUTPUTDIR,
- image_out_dir=OFFSCREENCANVASIMAGEOUTPUTDIR))
+ print(test['name'])
+ for variant in _get_variants(test):
+ variant.finalize_params(jinja_env)
+ if test['name'] != variant.params['name']:
+ print(f' {variant.params["name"]}')
+
+ sub_dir = _get_test_sub_dir(variant.params['file_name'],
+ name_to_sub_dir)
+ output_sub_dirs = output_dirs.sub_path(sub_dir)
+
+ _check_uniqueness(used_tests, variant.params['name'],
+ variant.params['canvas_types'])
+ variant.generate_expected_image(output_sub_dirs)
+ variant.generate_test(jinja_env, output_sub_dirs)
print()
diff --git a/testing/web-platform/tests/html/canvas/tools/templates/reftest.html b/testing/web-platform/tests/html/canvas/tools/templates/reftest.html
index 4c9affbbbb..f68d4c4621 100644
--- a/testing/web-platform/tests/html/canvas/tools/templates/reftest.html
+++ b/testing/web-platform/tests/html/canvas/tools/templates/reftest.html
@@ -5,7 +5,7 @@
<p class="desc">{{ desc }}</p>
{% if notes %}<p class="notes">{{ notes }}{% endif %}
-{{ code | trim }}
+{{ html_reference | trim }}
{% for image in images %}
<img src="/images/{{ image }}" id="{{ image }}" class="resource">
{% endfor -%}
diff --git a/testing/web-platform/tests/html/canvas/tools/templates/reftest_element.html b/testing/web-platform/tests/html/canvas/tools/templates/reftest_element.html
index 6684e9c615..6f7a8c8507 100644
--- a/testing/web-platform/tests/html/canvas/tools/templates/reftest_element.html
+++ b/testing/web-platform/tests/html/canvas/tools/templates/reftest_element.html
@@ -20,7 +20,8 @@
const canvas = document.getElementById("canvas");
const ctx = canvas.getContext('2d'{% if attributes %}, {{ attributes }}{% endif %});
- {{ code | trim | indent(2) }}
+ {{ reference | trim | indent(2) if is_test_reference else
+ code_element | trim | indent(2) }}
{% if test_type == 'promise' %}
document.documentElement.classList.remove("reftest-wait");
{% endif %}
diff --git a/testing/web-platform/tests/html/canvas/tools/templates/reftest_offscreen.html b/testing/web-platform/tests/html/canvas/tools/templates/reftest_offscreen.html
index 1d0d93dfa1..abc840159f 100644
--- a/testing/web-platform/tests/html/canvas/tools/templates/reftest_offscreen.html
+++ b/testing/web-platform/tests/html/canvas/tools/templates/reftest_offscreen.html
@@ -18,7 +18,7 @@
const canvas = new OffscreenCanvas({{ size[0] }}, {{ size[1] }});
const ctx = canvas.getContext('2d'{% if attributes %}, {{ attributes }}{% endif %});
- {{ code | trim | indent(2) }}
+ {{ code_offscreen | trim | indent(2) }}
const outputCanvas = document.getElementById("canvas");
outputCanvas.getContext('2d'{% if attributes %}, {{ attributes }}{% endif %}).drawImage(canvas, 0, 0);
diff --git a/testing/web-platform/tests/html/canvas/tools/templates/reftest_worker.html b/testing/web-platform/tests/html/canvas/tools/templates/reftest_worker.html
index e636d3634b..02281af5d1 100644
--- a/testing/web-platform/tests/html/canvas/tools/templates/reftest_worker.html
+++ b/testing/web-platform/tests/html/canvas/tools/templates/reftest_worker.html
@@ -18,7 +18,7 @@
const canvas = new OffscreenCanvas({{ size[0] }}, {{ size[1] }});
const ctx = canvas.getContext('2d'{% if attributes %}, {{ attributes }}{% endif %});
- {{ code | trim | indent(4) }}
+ {{ code_worker | trim | indent(4) }}
const bitmap = canvas.transferToImageBitmap();
self.postMessage(bitmap, bitmap);
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>
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
index 8ebbff77a6..68147680e1 100644
--- a/testing/web-platform/tests/html/canvas/tools/templates/testharness_offscreen.html
+++ b/testing/web-platform/tests/html/canvas/tools/templates/testharness_offscreen.html
@@ -15,6 +15,11 @@
{#- Promise vs. async test header: +#}
{% if test_type == 'promise' %}
promise_test(async t => {
+
+{% elif test_type == 'async' %}
+async_test(t => {
+{% elif test_type == 'sync' %}
+test(t => {
{% else %}
var t = async_test("{{ desc | double_quote_escape }}");
var t_pass = t.done.bind(t);
@@ -22,22 +27,23 @@ var t_fail = t.step_func(function(reason) {
throw reason;
});
t.step(function() {
+
{% endif %}
-{# Test body: #}
+{#- Test body: #}
var canvas = new OffscreenCanvas({{ size[0] }}, {{ size[1] }});
var ctx = canvas.getContext('2d'{% if attributes %}, {{ attributes }}{% endif %});
- {{ code | trim | indent(2)}}
+ {{ code_offscreen | trim | indent(2)}}
{#- Promise vs. async test footer: +#}
-{% if test_type == 'promise' %}
-
-}, "{{ desc }}");
-{% else %}
+{% if not test_type %}
t.done();
});
+{% else %}
+
+}, "{{ desc | double_quote_escape }}");
{% endif %}
</script>
{% for svgimage in svgimages %}
diff --git a/testing/web-platform/tests/html/canvas/tools/templates/testharness_worker.js b/testing/web-platform/tests/html/canvas/tools/templates/testharness_worker.js
index f1f04e7bb6..570d479a0a 100644
--- a/testing/web-platform/tests/html/canvas/tools/templates/testharness_worker.js
+++ b/testing/web-platform/tests/html/canvas/tools/templates/testharness_worker.js
@@ -10,6 +10,10 @@ importScripts("/html/canvas/resources/canvas-tests.js");
{# Promise vs. async test header: #}
{% if test_type == 'promise' %}
promise_test(async t => {
+{% elif test_type == 'async' %}
+async_test(t => {
+{% elif test_type == 'sync' %}
+test(t => {
{% else %}
var t = async_test("{{ desc | double_quote_escape }}");
var t_pass = t.done.bind(t);
@@ -17,19 +21,20 @@ var t_fail = t.step_func(function(reason) {
throw reason;
});
t.step(function() {
+
{% endif %}
-{# Test body: #}
+{#- Test body: #}
var canvas = new OffscreenCanvas({{ size[0] }}, {{ size[1] }});
var ctx = canvas.getContext('2d'{% if attributes %}, {{ attributes }}{% endif %});
- {{ code | trim | indent(2)}}
- t.done();
+ {{ code_worker | trim | indent(2)}}
{#- Promise vs. async test footer: +#}
-{% if test_type == 'promise' %}
-}, "{{ desc }}");
-{% else %}
+{% if not test_type %}
+ t.done();
});
+{% else %}
+}, "{{ desc | double_quote_escape }}");
{% endif %}
done();
diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/color_space.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/color_space.yaml
index 39556caf0a..56f6d01d30 100644
--- a/testing/web-platform/tests/html/canvas/tools/yaml-new/color_space.yaml
+++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/color_space.yaml
@@ -36,8 +36,7 @@
- name: 2d.color.space.p3.toBlob.p3.canvas
desc: test if toblob returns p3 data from p3 color space canvas
attributes: '{colorSpace: "display-p3"}'
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
ctx.fillStyle = "rgba(155, 27, 27, 1)";
ctx.fillRect(0, 0, 1, 1);
@@ -68,8 +67,7 @@
- name: 2d.color.space.p3.toDataURL.p3.canvas
desc: test if toDataURL returns p3 data from canvas with p3 color space
attributes: '{colorSpace: "display-p3"}'
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
ctx.fillStyle = "rgba(155, 27, 27, 1)";
ctx.fillRect(0, 0, 1, 1);
@@ -96,8 +94,7 @@
- name: 2d.color.space.p3.toDataURL.jpeg.p3.canvas
desc: test if toDataURL('image/jpeg') returns p3 data from canvas with p3 color space
attributes: '{colorSpace: "display-p3"}'
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
ctx.fillStyle = "rgba(155, 27, 27, 1)";
ctx.fillRect(0, 0, 1, 1);
@@ -124,8 +121,7 @@
- name: 2d.color.space.p3.toBlob.with.putImageData
desc: Use putImageData to put some p3 data in canvas and test if toBlob returns the same data
attributes: '{colorSpace: "display-p3"}'
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
canvas.width = 2;
canvas.height = 2;
@@ -162,8 +158,7 @@
- name: 2d.color.space.p3.toDataURL.with.putImageData
desc: Use putImageData to put some p3 data in canvas and test if toDataURL returns the same data
attributes: '{colorSpace: "display-p3"}'
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
canvas.width = 2;
canvas.height = 2;
@@ -197,7 +192,7 @@
- name: 2d.color.space.p3.fillText
desc: Test if fillText can be used with a solid display-p3 color
attributes: '{colorSpace: "display-p3"}'
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
deferTest();
@@ -236,8 +231,7 @@
- name: 2d.color.space.p3.strokeText
desc: Test if strokeText can be used with a solid display-p3 color
attributes: '{colorSpace: "display-p3"}'
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
deferTest();
@@ -277,8 +271,7 @@
- name: 2d.color.space.p3.fillText.shadow
desc: Test if fillText can be used with a display-p3 shadow color
attributes: '{colorSpace: "display-p3"}'
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
deferTest();
diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/compositing.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/compositing.yaml
index bd7fae1d62..6bd0aaad8a 100644
--- a/testing/web-platform/tests/html/canvas/tools/yaml-new/compositing.yaml
+++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/compositing.yaml
@@ -43,7 +43,7 @@
expected: green
- name: 2d.composite.globalAlpha.canvas
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
var canvas2 = document.createElement('canvas');
canvas2.width = 100;
@@ -61,7 +61,7 @@
expected: green
- name: 2d.composite.globalAlpha.canvaspattern
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
var canvas2 = document.createElement('canvas');
canvas2.width = 100;
@@ -80,7 +80,7 @@
expected: green
- name: 2d.composite.globalAlpha.canvascopy
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
var canvas2 = document.createElement('canvas');
canvas2.width = 100;
@@ -173,7 +173,7 @@
expected: green
- name: 2d.composite.globalAlpha.canvas
- canvasType: ['OffscreenCanvas', 'Worker']
+ canvas_types: ['OffscreenCanvas', 'Worker']
code: |
var offscreenCanvas2 = new OffscreenCanvas(100, 50);
var ctx2 = offscreenCanvas2.getContext('2d');
@@ -203,7 +203,7 @@
expected: green
- name: 2d.composite.globalAlpha.canvaspattern
- canvasType: ['OffscreenCanvas', 'Worker']
+ canvas_types: ['OffscreenCanvas', 'Worker']
code: |
var offscreenCanvas2 = new OffscreenCanvas(100, 50);
var ctx2 = offscreenCanvas2.getContext('2d');
@@ -218,7 +218,7 @@
@assert pixel 50,25 ==~ 2,253,0,255;
- name: 2d.composite.globalAlpha.canvascopy
- canvasType: ['OffscreenCanvas', 'Worker']
+ canvas_types: ['OffscreenCanvas', 'Worker']
code: |
var offscreenCanvas2 = new OffscreenCanvas(100, 50);
var ctx2 = offscreenCanvas2.getContext('2d');
diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/conformance_requirements.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/conformance_requirements.yaml
index 3483d115f4..a070c0a6ef 100644
--- a/testing/web-platform/tests/html/canvas/tools/yaml-new/conformance_requirements.yaml
+++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/conformance_requirements.yaml
@@ -1,7 +1,7 @@
- name: 2d.conformance.requirements.delete
desc: window.CanvasRenderingContext2D is Configurable
notes: &bindings Defined in "Web IDL" (draft)
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
@assert window.CanvasRenderingContext2D !== undefined;
@assert delete window.CanvasRenderingContext2D === true;
@@ -172,7 +172,6 @@
desc: void methods return undefined
images:
- yellow.png
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
@assert ctx.drawImage(document.getElementById('yellow.png'), 0, 0, 1, 1, 0, 0, 0, 0) === undefined;
-
diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/drawing-images-to-the-canvas.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/drawing-images-to-the-canvas.yaml
index 09e9e00186..7ebe9cca85 100644
--- a/testing/web-platform/tests/html/canvas/tools/yaml-new/drawing-images-to-the-canvas.yaml
+++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/drawing-images-to-the-canvas.yaml
@@ -1,5 +1,5 @@
- name: 2d.drawImage.canvas
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
var canvas2 = document.createElement('canvas');
canvas2.width = 100;
@@ -70,12 +70,12 @@
desc: Incorrect image types in drawImage do not match any defined overloads, so
WebIDL throws a TypeError
notes: &bindings Defined in "Web IDL" (draft)
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
@assert throws TypeError ctx.drawImage(document.createElement('p'), 0, 0);
- name: 2d.drawImage.incomplete.nosrc
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
mozilla: {throws: !!null ''}
code: |
ctx.fillStyle = '#0f0';
@@ -86,7 +86,7 @@
expected: green
- name: 2d.drawImage.incomplete.immediate
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- red.png
code: |
@@ -103,7 +103,7 @@
expected: green
- name: 2d.drawImage.incomplete.reload
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- yellow.png
- red.png
@@ -122,7 +122,7 @@
expected: green
- name: 2d.drawImage.incomplete.emptysrc
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- red.png
mozilla: {throws: !!null ''}
@@ -136,7 +136,7 @@
expected: green
- name: 2d.drawImage.incomplete.removedsrc
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- red.png
mozilla: {throws: !!null ''}
@@ -150,7 +150,7 @@
expected: green
- name: 2d.drawImage.nonexistent
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- not-found-at-all.png
code: |
@@ -159,7 +159,7 @@
- name: 2d.drawImage.zerocanvas
desc: drawImage with zero-sized canvas as the source shoud throw exception
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
var canvas2 = document.createElement('canvas');
canvas2.width = 0;
@@ -176,7 +176,7 @@
- name: 2d.drawImage.animated.gif
desc: drawImage() of an animated GIF draws the first frame
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- anim-gr.gif
code: |
@@ -330,7 +330,7 @@
@assert pixel 99,49 ==~ 0,255,0,255;
- name: 2d.drawImage.canvas
- canvasType: ['OffscreenCanvas', 'Worker']
+ canvas_types: ['OffscreenCanvas', 'Worker']
code: |
var offscreenCanvas2 = new OffscreenCanvas(100, 50);
var ctx2 = offscreenCanvas2.getContext('2d');
@@ -344,7 +344,7 @@
@assert pixel 99,49 ==~ 0,255,0,255;
- name: 2d.drawImage.zerocanvas
- canvasType: ['OffscreenCanvas', 'Worker']
+ canvas_types: ['OffscreenCanvas', 'Worker']
code: |
var offscreenCanvas2 = new OffscreenCanvas(0, 10);
@assert throws INVALID_STATE_ERR ctx.drawImage(offscreenCanvas2, 0, 0);
@@ -385,7 +385,7 @@
- name: 2d.drawImage.zerosource.image
desc: drawImage with zero-sized source rectangle from image draws nothing without exception
test_type: promise
- canvasType: ['HTMLCanvas', 'OffscreenCanvas']
+ canvas_types: ['HtmlCanvas', 'OffscreenCanvas']
code: |
ctx.fillStyle = '#0f0';
ctx.fillRect(0, 0, 100, 50);
@@ -483,7 +483,7 @@
- name: 2d.drawImage.outsidesource
DISABLED: fix this to match the current spec (transparent black outside source)
- canvasType: ['OffscreenCanvas', 'Worker']
+ canvas_types: ['OffscreenCanvas', 'Worker']
code: |
const response_red = await fetch('/images/red.png');
const blob_red = await response_red.blob();
@@ -518,7 +518,7 @@
- name: 2d.drawImage.svg
desc: drawImage() of an SVG image
test_type: promise
- canvasType: ['HTMLCanvas', 'OffscreenCanvas']
+ canvas_types: ['HtmlCanvas', 'OffscreenCanvas']
code: |
const img = new Image();
const imageLoadPromise = new Promise((resolve, reject) => {
@@ -641,7 +641,7 @@
- name: 2d.drawImage.detachedcanvas
desc: drawImage with detached OffscreenCanvas as the source should throw exception
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
var canvas2 = new OffscreenCanvas(80, 80);
(new MessageChannel()).port1.postMessage(canvas2, [canvas2]);
diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/drawing-rectangles-to-the-canvas.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/drawing-rectangles-to-the-canvas.yaml
index 408e932abe..cb7ae0d858 100644
--- a/testing/web-platform/tests/html/canvas/tools/yaml-new/drawing-rectangles-to-the-canvas.yaml
+++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/drawing-rectangles-to-the-canvas.yaml
@@ -375,8 +375,7 @@
- name: 2d.fillStyle.colorObject
desc: ctx.fillStyle works with color objects
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
ctx.fillStyle = {r: 1, g: 0, b: 0};
ctx.fillRect(0, 0, 100, 50);
@@ -400,8 +399,7 @@
- name: 2d.fillStyle.colorObject.transparency
desc: ctx.fillStyle with color objects has transparency
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
ctx.fillStyle = {r: 0, g: 1, b: 0, a: 0};
ctx.fillRect(0, 0, 100, 50);
@@ -422,8 +420,7 @@
- name: 2d.strokeStyle.colorObject
desc: ctx.strokeStyle works with color objects
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
ctx.lineWidth = 50;
ctx.strokeStyle = {r: 1, g: 0, b: 0};
@@ -448,8 +445,7 @@
- name: 2d.strokeStyle.colorObject.transparency
desc: ctx.strokeStyle with color objects has transparency
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
ctx.lineWidth = 50;
ctx.strokeStyle = {r: 0, g: 1, b: 0, a: 0};
diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/fill-and-stroke-styles.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/fill-and-stroke-styles.yaml
index c992af6e7c..72d027a634 100644
--- a/testing/web-platform/tests/html/canvas/tools/yaml-new/fill-and-stroke-styles.yaml
+++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/fill-and-stroke-styles.yaml
@@ -1,6 +1,6 @@
- name: 2d.fillStyle.parse.current.basic
desc: currentColor is computed from the canvas element
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
canvas.setAttribute('style', 'color: #0f0');
ctx.fillStyle = '#f00';
@@ -11,7 +11,7 @@
- name: 2d.fillStyle.parse.current.changed
desc: currentColor is computed when the attribute is set, not when it is painted
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
canvas.setAttribute('style', 'color: #0f0');
ctx.fillStyle = '#f00';
@@ -23,7 +23,7 @@
- name: 2d.fillStyle.parse.current.removed
desc: currentColor is solid black when the canvas element is not in a document
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
// Try not to let it undetectably incorrectly pick up opaque-black
// from other parts of the document:
@@ -119,7 +119,7 @@
desc: window.CanvasGradient exists and has the right properties
notes: &bindings Defined in "Web IDL" (draft)
code: |
- {% set root = 'self' if canvas_type == 'worker' else 'window' %}
+ {% set root = 'self' if canvas_type == 'Worker' else 'window' %}
@assert {{ root }}.CanvasGradient !== undefined;
@assert {{ root }}.CanvasGradient.prototype.addColorStop !== undefined;
@@ -127,7 +127,7 @@
desc: createLinearGradient() and createRadialGradient() returns objects implementing
CanvasGradient
code: |
- {% set root = 'self' if canvas_type == 'worker' else 'window' %}
+ {% set root = 'self' if canvas_type == 'Worker' else 'window' %}
{{ root }}.CanvasGradient.prototype.thisImplementsCanvasGradient = true;
var g1 = ctx.createLinearGradient(0, 0, 100, 0);
@@ -483,16 +483,17 @@
ctx.fillRect(0, 0, 100, 50);
@assert pixel 50,25 ==~ 0,255,0,255;
expected: green
+ append_variants_to_name: false
variants:
- _HtmlCanvas:
- canvasType: ['HtmlCanvas']
+ - HtmlCanvas:
+ canvas_types: ['HtmlCanvas']
create_canvas: document.createElement('canvas')
- _OffscreenCanvas:
- canvasType: ['OffscreenCanvas', 'Worker']
+ OffscreenCanvas:
+ canvas_types: ['OffscreenCanvas', 'Worker']
create_canvas: new OffscreenCanvas(100, 50)
- name: 2d.gradient.object.current
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
canvas.setAttribute('style', 'color: #f00');
@@ -1126,7 +1127,7 @@
images:
- green.png
code: |
- {% set root = 'self' if canvas_type == 'worker' else 'window' %}
+ {% set root = 'self' if canvas_type == 'Worker' else 'window' %}
@assert {{ root }}.CanvasPattern !== undefined;
{{ root }}.CanvasPattern.prototype.thisImplementsCanvasPattern = true;
@@ -1135,11 +1136,13 @@
var pattern = ctx.createPattern(img, 'no-repeat');
@assert pattern.thisImplementsCanvasPattern;
variants: &load-image-variant-definition
- _HtmlCanvas:
- canvasType: ['HtmlCanvas']
+ - HtmlCanvas:
+ append_variants_to_name: false
+ canvas_types: ['HtmlCanvas']
load_image: var img = document.getElementById('{{ (images or svgimages)[0] }}');
- _OffscreenCanvas:
- canvasType: ['OffscreenCanvas', 'Worker']
+ OffscreenCanvas:
+ append_variants_to_name: false
+ canvas_types: ['OffscreenCanvas', 'Worker']
test_type: promise
load_image: |-
var response = await fetch('/images/{{ (images or svgimages)[0] }}')
@@ -1189,14 +1192,16 @@
@assert pixel 98,48 == 0,255,0,255;
expected: green
variants: &create-canvas2-variant-definition
- _HtmlCanvas:
- canvasType: ['HtmlCanvas']
+ - HtmlCanvas:
+ append_variants_to_name: false
+ canvas_types: ['HtmlCanvas']
create_canvas2: |-
var canvas2 = document.createElement('canvas');
canvas2.width = 100;
canvas2.height = 50;
- _OffscreenCanvas:
- canvasType: ['OffscreenCanvas', 'Worker']
+ OffscreenCanvas:
+ append_variants_to_name: false
+ canvas_types: ['OffscreenCanvas', 'Worker']
create_canvas2: |-
var canvas2 = new OffscreenCanvas(100, 50);
@@ -1299,13 +1304,13 @@
@assert throws TypeError ctx.createPattern('../images/red.png', 'repeat');
- name: 2d.pattern.image.incomplete.nosrc
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
var img = new Image();
@assert ctx.createPattern(img, 'repeat') === null;
- name: 2d.pattern.image.incomplete.immediate
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- red.png
code: |
@@ -1318,7 +1323,7 @@
@assert ctx.createPattern(img, 'repeat') === null; @moz-todo
- name: 2d.pattern.image.incomplete.reload
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- yellow.png
- red.png
@@ -1333,7 +1338,7 @@
@assert ctx.createPattern(img, 'repeat') === null; @moz-todo
- name: 2d.pattern.image.incomplete.emptysrc
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- red.png
mozilla: {throws: !!null ''}
@@ -1343,7 +1348,7 @@
@assert ctx.createPattern(img, 'repeat') === null;
- name: 2d.pattern.image.incomplete.removedsrc
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- red.png
mozilla: {throws: !!null ''}
@@ -1353,7 +1358,7 @@
@assert ctx.createPattern(img, 'repeat') === null;
- name: 2d.pattern.image.broken
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- broken.png
code: |
@@ -1361,7 +1366,7 @@
@assert throws INVALID_STATE_ERR ctx.createPattern(img, 'repeat');
- name: 2d.pattern.image.nonexistent
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- no-such-image-really.png
code: |
@@ -1369,7 +1374,7 @@
@assert throws INVALID_STATE_ERR ctx.createPattern(img, 'repeat');
- name: 2d.pattern.svgimage.nonexistent
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
svgimages:
- no-such-image-really.png
code: |
@@ -1377,7 +1382,7 @@
@assert throws INVALID_STATE_ERR ctx.createPattern(img, 'repeat');
- name: 2d.pattern.image.nonexistent-but-loading
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
var img = document.createElement("img");
img.src = "/images/no-such-image-really.png";
@@ -1387,7 +1392,7 @@
@assert ctx.createPattern(img, 'repeat') === null;
- name: 2d.pattern.image.nosrc
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
var img = document.createElement("img");
@assert ctx.createPattern(img, 'repeat') === null;
@@ -1395,7 +1400,7 @@
@assert ctx.createPattern(img, 'repeat') === null;
- name: 2d.pattern.image.zerowidth
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- red-zerowidth.svg
code: |
@@ -1403,7 +1408,7 @@
@assert ctx.createPattern(img, 'repeat') === null;
- name: 2d.pattern.image.zeroheight
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- red-zeroheight.svg
code: |
@@ -1411,7 +1416,7 @@
@assert ctx.createPattern(img, 'repeat') === null;
- name: 2d.pattern.svgimage.zerowidth
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
svgimages:
- red-zerowidth.svg
code: |
@@ -1419,7 +1424,7 @@
@assert ctx.createPattern(img, 'repeat') === null;
- name: 2d.pattern.svgimage.zeroheight
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
svgimages:
- red-zeroheight.svg
code: |
@@ -1469,7 +1474,7 @@
@assert throws SYNTAX_ERR ctx.createPattern(canvas, "repeat\0");
- name: 2d.pattern.modify.image1
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- green.png
code: |
@@ -1490,7 +1495,7 @@
expected: green
- name: 2d.pattern.modify.image2
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- green.png
code: |
@@ -1515,7 +1520,7 @@
expected: green
- name: 2d.pattern.modify.canvas1
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
{{ create_canvas2 }}
var ctx2 = canvas2.getContext('2d');
@@ -1577,13 +1582,14 @@
@assert pixel 50,25 == 0,255,0,255;
expected: green
+ append_variants_to_name: false
variants:
- _HtmlCanvas:
- canvasType: ['HtmlCanvas']
+ - HtmlCanvas:
+ canvas_types: ['HtmlCanvas']
load_image: var img = document.getElementById('{{ images[0] }}');
create_canvas: document.createElement('canvas')
- _OffscreenCanvas:
- canvasType: ['OffscreenCanvas', 'Worker']
+ OffscreenCanvas:
+ canvas_types: ['OffscreenCanvas', 'Worker']
test_type: promise
load_image: |-
var response = await fetch('/images/{{ images[0] }}')
@@ -1987,7 +1993,7 @@
- name: 2d.pattern.animated.gif
desc: createPattern() of an animated GIF draws the first frame
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- anim-gr.gif
code: |
@@ -2006,7 +2012,7 @@
- name: 2d.fillStyle.CSSRGB
desc: CSSRGB works as color input
- canvasType: ['HtmlCanvas', 'OffscreenCanvas']
+ canvas_types: ['HtmlCanvas', 'OffscreenCanvas']
code: |
ctx.fillStyle = new CSSRGB(1, 0, 1);
@assert ctx.fillStyle === '#ff00ff';
@@ -2046,7 +2052,7 @@
- name: 2d.fillStyle.CSSHSL
desc: CSSHSL works as color input
- canvasType: ['HtmlCanvas', 'OffscreenCanvas']
+ canvas_types: ['HtmlCanvas', 'OffscreenCanvas']
code: |
ctx.fillStyle = new CSSHSL(CSS.deg(180), 0.5, 0.5);
ctx.fillRect(0, 0, 100, 50);
@@ -2077,7 +2083,7 @@
- name: 2d.fillStyle.colormix
desc: color-mix works as color input
- canvasType: ['HtmlCanvas', 'OffscreenCanvas', 'Worker']
+ canvas_types: ['HtmlCanvas', 'OffscreenCanvas', 'Worker']
code: |
ctx.fillStyle = "color-mix(in srgb, red, blue)";
@assert ctx.fillStyle === 'color(srgb 0.5 0 0.5)';
@@ -2086,7 +2092,7 @@
- name: 2d.fillStyle.colormix.currentcolor
desc: color-mix works as color input with currentcolor
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
canvas.setAttribute('style', 'color: magenta');
ctx.fillStyle = "color-mix(in srgb, black, currentcolor)";
@@ -2096,9 +2102,22 @@
- name: 2d.strokeStyle.colormix
desc: color-mix works as color input
- canvasType: ['HtmlCanvas', 'OffscreenCanvas']
+ canvas_types: ['HtmlCanvas', 'OffscreenCanvas']
code: |
ctx.strokeStyle = "color-mix(in srgb, red, blue)";
@assert ctx.strokeStyle === 'color(srgb 0.5 0 0.5)';
ctx.strokeStyle = "color-mix(in srgb, red, color(srgb 1 0 0))";
@assert ctx.strokeStyle === 'color(srgb 1 0 0)';
+
+- name: 2d.gradient.colormix
+ desc: color-mix works as CanvasGradient color input
+ canvas_types: ['HtmlCanvas']
+ code: |
+ var g = ctx.createLinearGradient(0, 0, 100, 0);
+ g.addColorStop(0, '#f00');
+ g.addColorStop(1, 'color-mix(in srgb, #0f0, #00f)');
+ ctx.fillStyle = g;
+ ctx.fillRect(0, 0, 100, 50);
+ @assert pixel 25,25 ==~ 212,81,61,255 +/- 3;
+ @assert pixel 50,25 ==~ 167,106,88,255 +/- 3;
+ @assert pixel 75,25 ==~ 113,120,109,255 +/- 3;
diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/filters.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/filters.yaml
index f327b9fe94..1ce9d8ed74 100644
--- a/testing/web-platform/tests/html/canvas/tools/yaml-new/filters.yaml
+++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/filters.yaml
@@ -34,8 +34,7 @@
- name: 2d.filter.canvasFilterObject.tentative
desc: Test CanvasFilter() object
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
@assert ctx.filter == 'none';
ctx.filter = 'blur(5px)';
@@ -63,7 +62,7 @@
- name: 2d.filter.canvasFilterObject.tentative
desc: Test CanvasFilter() object
- canvasType: ['OffscreenCanvas', 'Worker']
+ canvas_types: ['OffscreenCanvas', 'Worker']
code: |
@assert ctx.filter == 'none';
ctx.filter = 'blur(5px)';
@@ -106,7 +105,7 @@
"{name: 'gaussianBlur', stdDeviation: {}}") }};
append_variants_to_name: false
variants:
- layers:
+ - layers:
filter_declaration: |-
ctx.beginLayer({filter:
param})
@@ -199,7 +198,7 @@
@assert pixel 60,30 ==~ 0,255,0,255;
append_variants_to_name: false
variants:
- layers:
+ - layers:
filter_declaration: |-
ctx.beginLayer({filter:
param})
@@ -251,7 +250,7 @@
{{ close_layer -}}
append_variants_to_name: false
variants:
- layers:
+ - layers:
filter_declaration: |-
ctx.beginLayer({filter:
param})
@@ -325,7 +324,7 @@
{{ close_layer }}
append_variants_to_name: false
variants:
- layers:
+ - layers:
filter_declaration: |-
ctx.beginLayer({filter: param})
close_layer: ctx.endLayer();
@@ -376,7 +375,7 @@
}
append_variants_to_name: false
variants:
- layers:
+ - layers:
filter_declaration: |-
ctx.beginLayer({filter: param})
close_layer: ctx.endLayer();
@@ -451,7 +450,7 @@
}
append_variants_to_name: false
variants:
- layers:
+ - layers:
filter_declaration: |-
ctx.beginLayer({filter: param})
close_layer: ctx.endLayer();
@@ -530,7 +529,7 @@
}
append_variants_to_name: false
variants:
- layers:
+ - layers:
filter_declaration: |-
ctx.beginLayer({filter: param})
close_layer: ctx.endLayer();
@@ -608,7 +607,7 @@
}
append_variants_to_name: false
variants:
- layers:
+ - layers:
filter_declaration: |-
ctx.beginLayer({filter: param})
close_layer: ctx.endLayer();
@@ -641,30 +640,30 @@
fill="teal" filter="url(#blur)" />
</svg>
append_variants_to_name: false
- variant_matrix:
- - layers:
- filter_declaration: |-
- ctx.beginLayer({filter: param});
- close_layer: ctx.endLayer();
- canvasFilterObject:
- filter_declaration: |-
- ctx.filter = new CanvasFilter(param);
- tentative: .tentative
- - x-only:
- blur_x: 4
- blur_y: 0
- mostly-x:
- blur_x: 4
- blur_y: 1
- isotropic:
- blur_x: 4
- blur_y: 4
- mostly-y:
- blur_x: 1
- blur_y: 4
- y-only:
- blur_x: 0
- blur_y: 4
+ variants:
+ - layers:
+ filter_declaration: |-
+ ctx.beginLayer({filter: param});
+ close_layer: ctx.endLayer();
+ canvasFilterObject:
+ filter_declaration: |-
+ ctx.filter = new CanvasFilter(param);
+ tentative: .tentative
+ - x-only:
+ blur_x: 4
+ blur_y: 0
+ mostly-x:
+ blur_x: 4
+ blur_y: 1
+ isotropic:
+ blur_x: 4
+ blur_y: 4
+ mostly-y:
+ blur_x: 1
+ blur_y: 4
+ y-only:
+ blur_x: 0
+ blur_y: 4
- name: 2d.filter.{{ variant_names[0] }}.dropShadow{{ tentative }}
desc: Test CanvasFilter() dropShadow object.
@@ -818,7 +817,7 @@
</svg>
append_variants_to_name: false
variants:
- layers:
+ - layers:
filter_declaration: |-
ctx.beginLayer({filter: param});
close_layer: |
@@ -838,10 +837,6 @@
<10 | -1 | 0.5 | null | true | false | [] | [20] | '30'>}") }};
@unroll {{ filter_declaration | replace("param", "{\-
name: 'dropShadow', \-
- <dx | dy | floodOpacity>: \-
- <10 | -1 | 0.5 | null | true | false | [] | [20] | '30'>}") }};
- @unroll {{ filter_declaration | replace("param", "{\-
- name: 'dropShadow', \-
<stdDeviation>: \-
<10 | -1 | 0.5 | null | true | false | [] | [20] | '30' | \-
[10, -1] | [0.5, null] | [true, false] | [[], [20]] | \-
@@ -869,7 +864,7 @@
<'test' | 'rgba(NaN, 3, 2, 1)' | 10 | undefined | null | NaN>}") }};
append_variants_to_name: false
variants:
- layers:
+ - layers:
filter_declaration: |-
ctx.beginLayer({filter:
param}); ctx.endLayer()
@@ -990,7 +985,7 @@
}
append_variants_to_name: false
variants:
- layers:
+ - layers:
filter_declaration: |-
ctx.beginLayer({filter: param})
close_layer: "\n ctx.endLayer();"
diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/layers.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/layers.yaml
index 437a70c3f7..d1e9a97043 100644
--- a/testing/web-platform/tests/html/canvas/tools/yaml-new/layers.yaml
+++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/layers.yaml
@@ -41,7 +41,8 @@
ctx2.fillRect(70, 70, 75, 50);
ctx.drawImage(canvas2, 0, 0);
- variants: &global-state-variants
+ variants:
+ - &global-state-variants
no-global-states:
render_states: // No global states.
alpha: &global-state-alpha
@@ -168,7 +169,7 @@
};
img.src = 'data:image/svg+xml;base64,' + btoa(svg);
variants:
- <<: *global-state-variants
+ - <<: *global-state-variants
alpha:
<<: *global-state-alpha
fuzzy: maxDifference=0-2; totalPixels=0-6766
@@ -287,6 +288,7 @@
- name: 2d.layer.layer-rendering-state-reset-in-layer
desc: Tests that layers ignore the global context filter.
+ test_type: sync
code: |
ctx.globalAlpha = 0.5;
ctx.globalCompositeOperation = 'xor';
@@ -556,7 +558,7 @@
- name: 2d.layer.flush-on-frame-presentation
desc: Check that layers state stack is flushed and rebuilt on frame renders.
size: [200, 200]
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
test_type: "promise"
code: |
ctx.fillStyle = 'purple';
@@ -612,7 +614,7 @@
assert_throws_dom("InvalidStateError",
() => {{ operation }});
variants:
- createPattern:
+ - createPattern:
operation: ctx.createPattern(canvas, 'repeat')
drawImage:
setup: |-
@@ -630,10 +632,10 @@
operation: |-
ctx.putImageData(data, 0, 0)
toDataURL:
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
operation: canvas.toDataURL()
transferToImageBitmap:
- canvasType: ['OffscreenCanvas', 'Worker']
+ canvas_types: ['OffscreenCanvas', 'Worker']
operation: canvas.transferToImageBitmap()
- name: 2d.layer.malformed-operations-with-promises
@@ -651,14 +653,14 @@
ctx.beginLayer();
await promise_rejects_dom(t, 'InvalidStateError', {{ operation }});
variants:
- convertToBlob:
- canvasType: ['OffscreenCanvas', 'Worker']
+ - convertToBlob:
+ canvas_types: ['OffscreenCanvas', 'Worker']
operation: |-
canvas.convertToBlob()
createImageBitmap:
operation: createImageBitmap(canvas)
toBlob:
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
operation: |-
new Promise(resolve => canvas.toBlob(resolve))
@@ -824,7 +826,7 @@
- name: 2d.layer.valid-calls
desc: No exception raised on {{ variant_desc }}.
variants:
- save:
+ - save:
variant_desc: lone save() calls
code: ctx.save();
beginLayer:
@@ -867,7 +869,7 @@
{{ call_sequence | indent(2) }}
});
variants:
- endLayer:
+ - endLayer:
variant_desc: lone endLayer calls
call_sequence: ctx.endLayer();
save-endLayer:
@@ -995,7 +997,7 @@
};
img.src = 'data:image/svg+xml;base64,' + btoa(svg);
variants:
- no-clipping:
+ - no-clipping:
clipping: // No clipping.
with-clipping:
clipping: |-
@@ -1029,7 +1031,7 @@
ctx.fillStyle = 'green';
ctx.fillRect(0, 0, 100, 100);
variants:
- short-distance:
+ - short-distance:
distance: |-
const delta = 1;
clipping: // No clipping.
@@ -1056,7 +1058,7 @@
desc: Checks that layer blending works inside opaque canvas
size: [300, 300]
code: |
- {% if canvas_type == 'htmlcanvas' %}
+ {% if canvas_type == 'HtmlCanvas' %}
const canvas2 = document.createElement('canvas');
canvas2.width = 200;
canvas2.height = 200;
@@ -1126,7 +1128,7 @@
</g>
</svg>
variants:
- blur:
+ - blur:
ctx_filter: |-
'blur(10px)'
svg_filter: |-
@@ -1149,7 +1151,7 @@
code: *filter-test-code
html_reference: *filter-test-reference
variants:
- x-only:
+ - x-only:
ctx_filter: |-
{ name: 'gaussianBlur', stdDeviation: [4, 0] }
svg_filter: |-
diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/pixel-manipulation.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/pixel-manipulation.yaml
index 0643b047b1..6721f5ffde 100644
--- a/testing/web-platform/tests/html/canvas/tools/yaml-new/pixel-manipulation.yaml
+++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/pixel-manipulation.yaml
@@ -11,7 +11,7 @@
- name: 2d.imageData.create2.type
desc: createImageData(sw, sh) returns an ImageData object containing a Uint8ClampedArray
object
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
@assert window.ImageData !== undefined;
@assert window.Uint8ClampedArray !== undefined;
@@ -24,7 +24,7 @@
- name: 2d.imageData.create1.type
desc: createImageData(imgdata) returns an ImageData object containing a Uint8ClampedArray
object
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
@assert window.ImageData !== undefined;
@assert window.Uint8ClampedArray !== undefined;
@@ -36,7 +36,7 @@
- name: 2d.imageData.create2.this
desc: createImageData(sw, sh) should throw when called with the wrong |this|
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
notes: &bindings Defined in "Web IDL" (draft)
code: |
@assert throws TypeError CanvasRenderingContext2D.prototype.createImageData.call(null, 1, 1); @moz-todo
@@ -45,7 +45,7 @@
- name: 2d.imageData.create1.this
desc: createImageData(imgdata) should throw when called with the wrong |this|
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
notes: *bindings
code: |
var imgdata = ctx.createImageData(1, 1);
@@ -160,7 +160,7 @@
- name: 2d.imageData.create.and.resize
desc: Verify no crash when resizing an image bitmap to zero.
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
images:
- red.png
code: |
@@ -179,7 +179,7 @@
@assert ctx.getImageData(0, 0, 100, 50) !== null;
- name: 2d.imageData.get.type
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
desc: getImageData() returns an ImageData object containing a Uint8ClampedArray
object
code: |
@@ -502,7 +502,7 @@
@assert imgdata.data[3] === 0;
- name: 2d.imageData.object.ctor.size
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
desc: ImageData has a usable constructor
code: |
@assert window.ImageData !== undefined;
@@ -516,7 +516,7 @@
}
- name: 2d.imageData.object.ctor.basics
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
desc: Testing different type of ImageData constructor
code: |
function setRGBA(imageData, i, rgba)
@@ -608,7 +608,7 @@
- name: 2d.imageData.object.ctor.array
desc: ImageData has a usable constructor
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
@assert window.ImageData !== undefined;
@@ -620,7 +620,7 @@
- name: 2d.imageData.object.ctor.array.bounds
desc: ImageData has a usable constructor
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
@assert window.ImageData !== undefined;
@@ -803,7 +803,7 @@
- name: 2d.imageData.put.cross
desc: putImageData() accepts image data got from a different canvas
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
var canvas2 = document.createElement('canvas');
var ctx2 = canvas2.getContext('2d');
@@ -818,7 +818,7 @@
- name: 2d.imageData.put.cross
desc: putImageData() accepts image data got from a different canvas
- canvasType: ['OffscreenCanvas', 'Worker']
+ canvas_types: ['OffscreenCanvas', 'Worker']
code: |
var offscreenCanvas2 = new OffscreenCanvas(100, 50);
var ctx2 = offscreenCanvas2.getContext('2d');
diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/reset.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/reset.yaml
index 086fb04e04..27764e4550 100644
--- a/testing/web-platform/tests/html/canvas/tools/yaml-new/reset.yaml
+++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/reset.yaml
@@ -24,7 +24,7 @@
@assert ctx.{{ state_name }} == default_value;
variants:
- letter_spacing:
+ - letter_spacing:
state_name: letterSpacing
new_value: "'12px'"
diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/scroll.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/scroll.yaml
index dd088aa396..0579a8b3d7 100644
--- a/testing/web-platform/tests/html/canvas/tools/yaml-new/scroll.yaml
+++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/scroll.yaml
@@ -1,7 +1,6 @@
- name: 2d.scrollPathIntoView.basic
desc: scrollPathIntoView() works
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
var div = document.createElement('div');
div.style.cssText = 'width: 200vw; height: 200vh';
@@ -18,8 +17,7 @@
- name: 2d.scrollPathIntoView.verticalLR
desc: scrollPathIntoView() works in vertical-lr writing mode
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
document.documentElement.style.cssText = 'writing-mode: vertical-lr';
var div = document.createElement('div');
@@ -37,8 +35,7 @@
- name: 2d.scrollPathIntoView.verticalRL
desc: scrollPathIntoView() works in vertical-rl writing mode
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
document.documentElement.style.cssText = 'writing-mode: vertical-rl';
var div = document.createElement('div');
@@ -58,8 +55,7 @@
- name: 2d.scrollPathIntoView.path
desc: scrollPathIntoView() with path argument works
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
var div = document.createElement('div');
div.style.cssText = 'width: 200vw; height: 200vh';
@@ -73,4 +69,3 @@
var rect = canvas.getBoundingClientRect();
@assert Math.round(rect.top) === -8;
@assert Math.round(rect.left) === 200;
-
diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/shadows.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/shadows.yaml
index 953ab2c555..e42237dadb 100644
--- a/testing/web-platform/tests/html/canvas/tools/yaml-new/shadows.yaml
+++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/shadows.yaml
@@ -136,7 +136,7 @@
- name: 2d.shadow.attributes.shadowColor.current.basic
desc: currentColor is computed from the canvas element
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
canvas.style.color = '#0f0';
ctx.shadowColor = 'currentColor';
@@ -144,7 +144,7 @@
- name: 2d.shadow.attributes.shadowColor.current.changed
desc: currentColor is computed when the attribute is set, not when it is painted
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
canvas.style.color = '#0f0';
ctx.shadowColor = 'currentColor';
@@ -153,7 +153,7 @@
- name: 2d.shadow.attributes.shadowColor.current.removed
desc: currentColor is solid black when the canvas element is not in a document
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
// Try not to let it undetectably incorrectly pick up opaque-black
// from other parts of the document:
@@ -518,11 +518,13 @@
@assert pixel 50,25 == 0,255,0,255;
expected: green
variants: &load-image-variant-definition
- _HtmlCanvas:
- canvasType: ['HtmlCanvas']
+ - HtmlCanvas:
+ append_variants_to_name: false
+ canvas_types: ['HtmlCanvas']
load_image: var img = document.getElementById('{{ images[0] }}');
- _OffscreenCanvas:
- canvasType: ['OffscreenCanvas', 'Worker']
+ OffscreenCanvas:
+ append_variants_to_name: false
+ canvas_types: ['OffscreenCanvas', 'Worker']
test_type: promise
load_image: |-
var response = await fetch('/images/{{ images[0] }}')
@@ -640,14 +642,16 @@
@assert pixel 50,25 == 0,255,0,255;
expected: green
variants: &create-canvas2-variant-definition
- _HtmlCanvas:
- canvasType: ['HtmlCanvas']
+ - HtmlCanvas:
+ append_variants_to_name: false
+ canvas_types: ['HtmlCanvas']
create_canvas2: |-
var canvas2 = document.createElement('canvas');
canvas2.width = 100;
canvas2.height = 50;
- _OffscreenCanvas:
- canvasType: ['OffscreenCanvas', 'Worker']
+ OffscreenCanvas:
+ append_variants_to_name: false
+ canvas_types: ['OffscreenCanvas', 'Worker']
create_canvas2: |-
var canvas2 = new OffscreenCanvas(100, 50);
diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/text.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/text.yaml
index ca945c2953..7f2047bc9c 100644
--- a/testing/web-platform/tests/html/canvas/tools/yaml-new/text.yaml
+++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/text.yaml
@@ -38,7 +38,7 @@
- name: 2d.text.font.parse.size.percentage
canvas: 'style="font-size: 144px"'
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
ctx.font = '50% serif';
@assert ctx.font === '72px serif'; @moz-todo
@@ -46,7 +46,7 @@
@assert ctx.font === '72px serif'; @moz-todo
- name: 2d.text.font.parse.size.percentage.default
- canvasType: ['HtmlCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
var canvas2 = document.createElement('canvas');
var ctx2 = canvas2.getContext('2d');
@@ -113,7 +113,7 @@
@assert ctx.font === '10px sans-serif';
- name: 2d.text.font.relative_size
- canvasType: ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
var canvas2 = document.createElement('canvas');
var ctx2 = canvas2.getContext('2d');
@@ -121,7 +121,7 @@
@assert ctx2.font === '10px sans-serif';
- name: 2d.text.font.relative_size
- canvasType: ['OffscreenCanvas', 'Worker']
+ canvas_types: ['OffscreenCanvas', 'Worker']
code: |
ctx.font = '1em sans-serif';
@assert ctx.font === '10px sans-serif';
@@ -236,16 +236,18 @@
@assert pixel 95,45 ==~ 0,255,0,255;
expected: green
variants: &load-font-variant-definition
- _HtmlCanvas:
- canvasType: ['HtmlCanvas']
+ - HtmlCanvas:
+ append_variants_to_name: false
+ canvas_types: ['HtmlCanvas']
load_font: |-
await document.fonts.ready;
- _OffscreenCanvas:
- canvasType: ['OffscreenCanvas', 'Worker']
+ OffscreenCanvas:
+ append_variants_to_name: false
+ canvas_types: ['OffscreenCanvas', 'Worker']
load_font: |-
var f = new FontFace("{{ fonts[0] }}", "url('/fonts/{{ fonts[0] }}.ttf')");
f.load();
- {% set root = 'self' if canvas_type == 'worker' else 'document' %}
+ {% set root = 'self' if canvas_type == 'Worker' else 'document' %}
{{ root }}.fonts.add(f);
await {{ root }}.fonts.ready;
@@ -813,7 +815,7 @@
code: |
{{ load_font }}
ctx.font = '50px CanvasTest';
- {% if canvas_type != 'htmlcanvas' %}
+ {% if canvas_type != 'HtmlCanvas' %}
ctx.direction = 'ltr';
{% endif %}
ctx.fillStyle = '#f00';
@@ -839,7 +841,7 @@
code: |
{{ load_font }}
ctx.font = '50px CanvasTest';
- {% if canvas_type != 'htmlcanvas' %}
+ {% if canvas_type != 'HtmlCanvas' %}
ctx.direction = 'rtl';
{% endif %}
ctx.fillStyle = '#f00';
@@ -865,7 +867,7 @@
code: |
{{ load_font }}
ctx.font = '50px CanvasTest';
- {% if canvas_type != 'htmlcanvas' %}
+ {% if canvas_type != 'HtmlCanvas' %}
ctx.direction = 'ltr';
{% endif %}
ctx.fillStyle = '#f00';
@@ -891,7 +893,7 @@
code: |
{{ load_font }}
ctx.font = '50px CanvasTest';
- {% if canvas_type != 'htmlcanvas' %}
+ {% if canvas_type != 'HtmlCanvas' %}
ctx.direction = 'rtl';
{% endif %}
ctx.fillStyle = '#f00';
diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/video.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/video.yaml
index f9b48fb8da..ca8a1ab816 100644
--- a/testing/web-platform/tests/html/canvas/tools/yaml-new/video.yaml
+++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/video.yaml
@@ -1,7 +1,6 @@
- name: 2d.video.invalid
desc: Verify test doesn't crash with invalid video.
- canvasType:
- ['HTMLCanvas']
+ canvas_types: ['HtmlCanvas']
code: |
var v = document.createElement('video');
v.play();