diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
commit | 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch) | |
tree | a4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.worker.js | |
parent | Adding debian version 124.0.1-1. (diff) | |
download | firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.worker.js')
-rw-r--r-- | testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.worker.js | 69 |
1 files changed, 49 insertions, 20 deletions
diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.worker.js index d214e1d836..62e4582efd 100644 --- a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.worker.js +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.worker.js @@ -1,12 +1,12 @@ // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. // OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.colorMatrix.tentative -// Description:Test the functionality of ColorMatrix filters in CanvasFilter objects +// Description:Test the functionality of ColorMatrix filters // Note: importScripts("/resources/testharness.js"); importScripts("/html/canvas/resources/canvas-tests.js"); -var t = async_test("Test the functionality of ColorMatrix filters in CanvasFilter objects"); +var t = async_test("Test the functionality of ColorMatrix filters"); var t_pass = t.done.bind(t); var t_fail = t.step_func(function(reason) { throw reason; @@ -16,38 +16,67 @@ t.step(function() { var canvas = new OffscreenCanvas(100, 50); var ctx = canvas.getContext('2d'); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'colorMatrix', values: undefined}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'colorMatrix', values: 'foo'}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'colorMatrix', values: null}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'colorMatrix', values: [1, 2, 3]}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'colorMatrix', values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 'a']}); }); - assert_throws_js(TypeError, function() { new CanvasFilter({name: 'colorMatrix', values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, Infinity]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'colorMatrix', values: undefined}); }); + + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'colorMatrix', values: 'foo'}); }); + + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'colorMatrix', values: null}); }); + + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'colorMatrix', values: [1, 2, 3]}); }); + + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'colorMatrix', + values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 'a']}); }); + + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter( + {name: 'colorMatrix', + values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, Infinity]}); }); + ctx.fillStyle = '#f00'; - ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'hueRotate', values: 0}); + ctx.filter = new CanvasFilter( + {name: 'colorMatrix', type: 'hueRotate', values: 0}); ctx.fillRect(0, 0, 100, 50); _assertPixelApprox(canvas, 10,10, 255,0,0,255, 2); - ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'hueRotate', values: 90}); + + ctx.filter = new CanvasFilter( + {name: 'colorMatrix', type: 'hueRotate', values: 90}); ctx.fillRect(0, 0, 100, 50); _assertPixelApprox(canvas, 10,10, 0,91,0,255, 2); - ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'hueRotate', values: 180}); + + ctx.filter = new CanvasFilter( + {name: 'colorMatrix', type: 'hueRotate', values: 180}); ctx.fillRect(0, 0, 100, 50); _assertPixelApprox(canvas, 10,10, 0,109,109,255, 2); - ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'hueRotate', values: 270}); + + ctx.filter = new CanvasFilter( + {name: 'colorMatrix', type: 'hueRotate', values: 270}); ctx.fillRect(0, 0, 100, 50); _assertPixelApprox(canvas, 10,10, 109,18,255,255, 2); - ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'saturate', values: 0.5}); + + ctx.filter = new CanvasFilter( + {name: 'colorMatrix', type: 'saturate', values: 0.5}); ctx.fillRect(0, 0, 100, 50); _assertPixelApprox(canvas, 10,10, 155,27,27,255, 2); + ctx.clearRect(0, 0, 100, 50); - ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'luminanceToAlpha'}); + ctx.filter = new CanvasFilter( + {name: 'colorMatrix', type: 'luminanceToAlpha'}); ctx.fillRect(0, 0, 100, 50); _assertPixelApprox(canvas, 10,10, 0,0,0,54, 2); - ctx.filter = new CanvasFilter({name: 'colorMatrix', values: [ - 0, 0, 0, 0, 0, - 1, 1, 1, 1, 0, - 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0 - ]}); + + ctx.filter = new CanvasFilter( + {name: 'colorMatrix', values: [ + 0, 0, 0, 0, 0, + 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0 + ]}); ctx.fillRect(0, 0, 50, 25); ctx.fillStyle = '#0f0'; ctx.fillRect(50, 0, 50, 25); |