RFR: 8342098: Write a test to compare the images [v2]

Phil Race prr at openjdk.org
Thu Oct 17 18:51:34 UTC 2024


On Wed, 16 Oct 2024 16:34:01 GMT, Naveen Narayanan <duke at openjdk.org> wrote:

>> test/jdk/java/awt/Robot/ScreenCaptureRobotTest.java line 140:
>> 
>>> 138: 
>>> 139:         difference = toleranceLevel;
>>> 140:         if (toleranceLevel > 100) {
>> 
>> Why is a tolerance level needed in this test ?
>> That would seem to suggest it can't test the only thing it exists for.
>
> We may be comparing around 20K pixels.
> Thought will keep a  0.5% variation as permissible.
> Reduced a bit more now.
> If this doesn’t make sense, surely we can take tolerance out.

it should be gone. If the system is configured properly it should be a perfect match.
You probably should use -Dsun.java2d.uiScale=1 on this test to avoid any issues when run on a scaled desktop.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21524#discussion_r1805263931


More information about the client-libs-dev mailing list