Skip to content

Commit

Permalink
[web-tests] Fix incorrect fuzziness parameter minimums
Browse files Browse the repository at this point in the history
A W(P)T may specify fuzziness parameters as either an inclusive range
[min, max], or a single expected value [1] (e.g., `totalPixels=30` means
exactly 30 pixels must be different for a test/reference to match).

This patch corrects a few tests that mistakenly reject exact matches
(i.e., maxDifference = totalPixels = 0) because they specify exact
nonzero parameters. WPT unfortunately doesn't interpret this as `0-<N>`,
even though this is almost always what we want in practice.

`run_web_tests.py` allowed these parameters to land because it ignores
fuzzy parameters when the image hashes match exactly. Now, to be
consistent with [1] and its implementation in wptrunner, only skip
diffing when exact matches are expected.

[1]: https://web-platform-tests.org/writing-tests/reftests.html#fuzzy-matching

Bug: 1254776
Change-Id: I868e571a891b2a570934d17dd605f42db22a0ddf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4908234
Reviewed-by: Weizhong Xia <[email protected]>
Commit-Queue: Jonathan Lee <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1206623}
  • Loading branch information
jonathan-j-lee authored and chromium-wpt-export-bot committed Oct 6, 2023
1 parent 8c76a95 commit 8a68da2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html class="reftest-wait">
<title>Composited images correctly re-raster when the image and bounds change</title>
<meta charset="utf-8">
<meta name=fuzzy content="maxDifference=150;totalPixels=296">
<meta name=fuzzy content="maxDifference=0-150;totalPixels=0-296">
<link rel="match" href="image-compositing-change-ref.html"/>
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-img-element">
<style>
Expand Down

0 comments on commit 8a68da2

Please sign in to comment.