Skip to content

Commit

Permalink
Increase tolerance for Canvas ConicGradient WPT tests
Browse files Browse the repository at this point in the history
Bug: 1355539
Change-Id: I3dc852a209200b9fd154096ef6740ce7283a0efc
  • Loading branch information
Fernando Serboncini authored and chromium-wpt-export-bot committed Aug 30, 2022
1 parent 0e75a8e commit ec44dd6
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
Expand Up @@ -27,8 +27,8 @@ <h1>2d.gradient.conic.negative.rotation</h1>
g.addColorStop(0.75, "#f00");
ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50);
_assertPixel(canvas, 25,15, 255,0,0,255, "25,15", "255,0,0,255");
_assertPixel(canvas, 75,40, 0,255,0,255, "75,40", "0,255,0,255");
_assertPixelApprox(canvas, 25,15, 255,0,0,255, "25,15", "255,0,0,255", 3);
_assertPixelApprox(canvas, 75,40, 0,255,0,255, "75,40", "0,255,0,255", 3);


});
Expand Down
Expand Up @@ -27,8 +27,8 @@ <h1>2d.gradient.conic.positive.rotation</h1>
g.addColorStop(0.75, "#f00");
ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50);
_assertPixel(canvas, 25,15, 255,0,0,255, "25,15", "255,0,0,255");
_assertPixel(canvas, 75,40, 0,255,0,255, "75,40", "0,255,0,255");
_assertPixelApprox(canvas, 25,15, 255,0,0,255, "25,15", "255,0,0,255", 3);
_assertPixelApprox(canvas, 75,40, 0,255,0,255, "75,40", "0,255,0,255", 3);


});
Expand Down
Expand Up @@ -28,8 +28,8 @@ <h1>2d.gradient.conic.negative.rotation</h1>
g.addColorStop(0.75, "#f00");
ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50);
_assertPixel(canvas, 25,15, 255,0,0,255, "25,15", "255,0,0,255");
_assertPixel(canvas, 75,40, 0,255,0,255, "75,40", "0,255,0,255");
_assertPixelApprox(canvas, 25,15, 255,0,0,255, "25,15", "255,0,0,255", 3);
_assertPixelApprox(canvas, 75,40, 0,255,0,255, "75,40", "0,255,0,255", 3);
t.done();

});
Expand Down
Expand Up @@ -24,8 +24,8 @@ g.addColorStop(0.50, "#0f0");
g.addColorStop(0.75, "#f00");
ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50);
_assertPixel(canvas, 25,15, 255,0,0,255, "25,15", "255,0,0,255");
_assertPixel(canvas, 75,40, 0,255,0,255, "75,40", "0,255,0,255");
_assertPixelApprox(canvas, 25,15, 255,0,0,255, "25,15", "255,0,0,255", 3);
_assertPixelApprox(canvas, 75,40, 0,255,0,255, "75,40", "0,255,0,255", 3);
t.done();

});
Expand Down
Expand Up @@ -28,8 +28,8 @@ <h1>2d.gradient.conic.positive.rotation</h1>
g.addColorStop(0.75, "#f00");
ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50);
_assertPixel(canvas, 25,15, 255,0,0,255, "25,15", "255,0,0,255");
_assertPixel(canvas, 75,40, 0,255,0,255, "75,40", "0,255,0,255");
_assertPixelApprox(canvas, 25,15, 255,0,0,255, "25,15", "255,0,0,255", 3);
_assertPixelApprox(canvas, 75,40, 0,255,0,255, "75,40", "0,255,0,255", 3);
t.done();

});
Expand Down
Expand Up @@ -24,8 +24,8 @@ g.addColorStop(0.50, "#0f0");
g.addColorStop(0.75, "#f00");
ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50);
_assertPixel(canvas, 25,15, 255,0,0,255, "25,15", "255,0,0,255");
_assertPixel(canvas, 75,40, 0,255,0,255, "75,40", "0,255,0,255");
_assertPixelApprox(canvas, 25,15, 255,0,0,255, "25,15", "255,0,0,255", 3);
_assertPixelApprox(canvas, 75,40, 0,255,0,255, "75,40", "0,255,0,255", 3);
t.done();

});
Expand Down
8 changes: 4 additions & 4 deletions html/canvas/tools/yaml/element/fill-and-stroke-styles.yaml
Expand Up @@ -1213,8 +1213,8 @@
g.addColorStop(0.75, "#f00");
ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50);
@assert pixel 25,15 == 255,0,0,255;
@assert pixel 75,40 == 0,255,0,255;
@assert pixel 25,15 ==~ 255,0,0,255 +/- 3;
@assert pixel 75,40 ==~ 0,255,0,255 +/- 3;
expected: green

- name: 2d.gradient.conic.negative.rotation
Expand All @@ -1228,8 +1228,8 @@
g.addColorStop(0.75, "#f00");
ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50);
@assert pixel 25,15 == 255,0,0,255;
@assert pixel 75,40 == 0,255,0,255;
@assert pixel 25,15 ==~ 255,0,0,255 +/- 3;
@assert pixel 75,40 ==~ 0,255,0,255 +/- 3;
expected: green

- name: 2d.gradient.conic.invalid.inputs
Expand Down
8 changes: 4 additions & 4 deletions html/canvas/tools/yaml/offscreen/fill-and-stroke-styles.yaml
Expand Up @@ -969,8 +969,8 @@
g.addColorStop(0.75, "#f00");
ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50);
@assert pixel 25,15 == 255,0,0,255;
@assert pixel 75,40 == 0,255,0,255;
@assert pixel 25,15 ==~ 255,0,0,255 +/- 3;
@assert pixel 75,40 ==~ 0,255,0,255 +/- 3;
t.done();
- name: 2d.gradient.conic.negative.rotation
Expand All @@ -984,8 +984,8 @@
g.addColorStop(0.75, "#f00");
ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50);
@assert pixel 25,15 == 255,0,0,255;
@assert pixel 75,40 == 0,255,0,255;
@assert pixel 25,15 ==~ 255,0,0,255 +/- 3;
@assert pixel 75,40 ==~ 0,255,0,255 +/- 3;
t.done();
- name: 2d.gradient.conic.invalid.inputs
Expand Down

0 comments on commit ec44dd6

Please sign in to comment.