On Thu, 29 Aug 2024 12:55:50 GMT, Alexey Ivanov <[email protected]> wrote:
>> On analysis of captured image, it is observed that there are few pixels
>> which vary slightly w.r.t to expected color. Hence tolerance is included in
>> color comparison.
>> Tested in mach5 multiple time and its green.
>
> test/jdk/javax/swing/JFrame/JFrameBackgroundRefreshTest.java line 151:
>
>> 149: }
>> 150:
>> 151: private static boolean compareColor(Color c1, Color c2) {
>
> Shall we move such a method into `Util`?
>
> More and more test cases add tolerance to color comparison. Yeah, it's simple
> enough… and adding a library makes it somewhat harder to run a test in
> stand-alone mode, without jtreg.
Yeah, adding it to library will make it harder to run a test in stand-alone
mode. There is this `Util.testBoundsColor()` in Util and I don't see much of
test using it though. I guess it's better to leave the comparison to individual
test, rather than trying to make it generic.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20760#discussion_r1738062680