Title: [274694] trunk/LayoutTests
Revision
274694
Author
[email protected]
Date
2021-03-18 18:15:22 -0700 (Thu, 18 Mar 2021)

Log Message

[GLIB] REGRESSION(r274273): fast/canvas/webgl/gl-teximage-imagebitmap.html is failing
https://bugs.webkit.org/show_bug.cgi?id=223297

Reviewed by Carlos Garcia Campos.

This test started failing in GTK after r274273. The test fails due to a pixel color difference of 1.
Change failing test to allow a tolerance of 1 when comparing expected and actual results.

* fast/canvas/webgl/gl-teximage-imagebitmap-expected.txt:
* fast/canvas/webgl/gl-teximage-imagebitmap.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (274693 => 274694)


--- trunk/LayoutTests/ChangeLog	2021-03-19 01:02:00 UTC (rev 274693)
+++ trunk/LayoutTests/ChangeLog	2021-03-19 01:15:22 UTC (rev 274694)
@@ -1,3 +1,16 @@
+2021-03-18  Diego Pino Garcia  <[email protected]>
+
+        [GLIB] REGRESSION(r274273): fast/canvas/webgl/gl-teximage-imagebitmap.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=223297
+
+        Reviewed by Carlos Garcia Campos.
+
+        This test started failing in GTK after r274273. The test fails due to a pixel color difference of 1.
+        Change failing test to allow a tolerance of 1 when comparing expected and actual results.
+
+        * fast/canvas/webgl/gl-teximage-imagebitmap-expected.txt:
+        * fast/canvas/webgl/gl-teximage-imagebitmap.html:
+
 2021-03-18  Robert Jenner  <[email protected]>
 
         [ macOS wk2 Release ARM64 ] 3 http/wpt/beacon/cors/cors-preflight-blob are flakey text failures

Modified: trunk/LayoutTests/fast/canvas/webgl/gl-teximage-imagebitmap-expected.txt (274693 => 274694)


--- trunk/LayoutTests/fast/canvas/webgl/gl-teximage-imagebitmap-expected.txt	2021-03-19 01:02:00 UTC (rev 274693)
+++ trunk/LayoutTests/fast/canvas/webgl/gl-teximage-imagebitmap-expected.txt	2021-03-19 01:15:22 UTC (rev 274694)
@@ -1,14 +1,14 @@
 PASS getError was expected value: NO_ERROR : Should be no errors from setup.
 PASS getError was expected value: NO_ERROR : Should be no errors from setup
-PASS pixel 0, 149 should be 0, 0, 0, 255 was 0, 0, 0, 255
-PASS pixel 150, 149 should be 0, 0, 255, 255 was 0, 0, 255, 255
-PASS pixel 299, 149 should be 255, 0, 0, 255 was 255, 0, 0, 255
-PASS pixel 0, 75 should be 255, 0, 255, 255 was 255, 0, 255, 255
-PASS pixel 150, 75 should be 255, 0, 0, 255 was 255, 0, 0, 255
-PASS pixel 299, 75 should be 0, 255, 0, 255 was 0, 255, 0, 255
-PASS pixel 0, 0 should be 255, 0, 0, 255 was 255, 0, 0, 255
-PASS pixel 150, 0 should be 255, 255, 0, 255 was 255, 255, 0, 255
-PASS pixel 299, 0 should be 255, 0, 0, 255 was 255, 0, 0, 255
+PASS pixel 0, 149 was 0, 0, 0, 255
+PASS pixel 150, 149 was 0, 0, 255, 255
+PASS pixel 299, 149 was 255, 0, 0, 255
+PASS pixel 0, 75 was 255, 0, 255, 255
+PASS pixel 150, 75 was 255, 0, 0, 255
+PASS pixel 299, 75 was 0, 255, 0, 255
+PASS pixel 0, 0 was 255, 0, 0, 255
+PASS pixel 150, 0 was 255, 255, 0, 255
+PASS pixel 299, 0 was 255, 0, 0, 255
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/canvas/webgl/gl-teximage-imagebitmap.html (274693 => 274694)


--- trunk/LayoutTests/fast/canvas/webgl/gl-teximage-imagebitmap.html	2021-03-19 01:02:00 UTC (rev 274693)
+++ trunk/LayoutTests/fast/canvas/webgl/gl-teximage-imagebitmap.html	2021-03-19 01:15:22 UTC (rev 274694)
@@ -19,9 +19,9 @@
   });
 }
 
-function checkPixel(buf, width, x, y, color) {
-  var off = (y * width + x) * 4;
-  var msg = "pixel " + x + ", " + y + " should be " +
+function checkPixel(buf, width, x, y, color, tolerance) {
+  function msgFailed() {
+    return "pixel " + x + ", " + y + " should be " +
             color[0] + ", " +
             color[1] + ", " +
             color[2] + ", " +
@@ -30,14 +30,23 @@
             buf[off + 1] + ", " +
             buf[off + 2] + ", " +
             buf[off + 3];
-
+  }
+  function msgPassed() {
+    return "pixel " + x + ", " + y + " was " +
+            color[0] + ", " +
+            color[1] + ", " +
+            color[2] + ", " +
+            color[3];
+  }
+  var off = (y * width + x) * 4;
   for (var ii = 0; ii < 4; ++ii) {
-    if (buf[off + ii] != color[ii]) {
-      testFailed(msg);
+    var delta = Math.abs(buf[off + ii] - color[ii]);
+    if (delta > tolerance) {
+      testFailed(msgFailed());
       return;
     }
   }
-  testPassed(msg);
+  testPassed(msgPassed());
 }
 
 function checkPixelRange(buf, width, x, y, color, allowedRange) {
@@ -102,6 +111,7 @@
   var buf = new Uint8Array(width * height * 4);
   gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
 
+  var tolerance = 1;
   var left = 0;
   var middle = Math.floor(width / 2);
   var right = width - 1;
@@ -113,7 +123,7 @@
   checkPixel(buf, width, right,  top,    [255,   0,   0, 255]);
   checkPixel(buf, width, left,   center, [255,   0, 255, 255]);
   checkPixel(buf, width, middle, center, [255,   0,   0, 255]);
-  checkPixel(buf, width, right,  center, [  0, 255,   0, 255]);
+  checkPixel(buf, width, right,  center, [  0, 255,   0, 255], tolerance);
   checkPixel(buf, width, left,   bottom, [255,   0,   0, 255]);
   checkPixel(buf, width, middle, bottom, [255, 255,   0, 255]);
   checkPixel(buf, width, right,  bottom, [255,   0,   0, 255]);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to