On Thu, 29 Aug 2024 04:22:52 GMT, Tejesh R <t...@openjdk.org> wrote: >> test/jdk/java/awt/Checkbox/CheckboxCheckerScalingTest.java line 51: >> >>> 49: private static BufferedImage imageAfterChecked; >>> 50: private static volatile boolean checkmarkFound = false; >>> 51: private static final int TOLERANCE = 10; >> >> Is this tolerance needed for the test to pass? Would just moving the test to >> the center be enough for this fix? I agree with Abhishek that there might be >> false positives, particularly with color profiles where the test should fail >> but would pass with this change, especially since this is a ui scaling test. > > Tolerance is required when we are going with screen capture comparison since > I see slight change in intensity of colors in captured image, not really sure > of what might be the exact cause for it on some machines/some test runs. Also > I've seen some tests considers this tolerance while testing. I confirmed it > by decoding the pixel color of captured image (Below image). > Coming to false positives, yes this is the trade off when the test is made > automatic. I see no other way to confirm the check mark with captured image. > Other option left is to make the test manual one, yet I feel this way is > better than manual. I've captured several runs without the fix where the > captured area will be just white background and with fix when checkmark is > drawn on UI scale of 2.0 it is drawn inside the area without any other > interference which might have led to false positive. > > <img width="20" alt="image" > src="https://github.com/user-attachments/assets/e84da671-0a6f-4871-a83c-0e134cd1d800">
One more thing, how did you arrive to this number as the tolerance? I assume that maybe other tests also set tolerance as 10? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20723#discussion_r1739185070