RFR: 8338103: Stabilize and open source a Swing OGL ButtonResizeTest

Tejesh R tr at openjdk.org
Mon Aug 19 09:54:47 UTC 2024


On Mon, 19 Aug 2024 09:29:12 GMT, Tejesh R <tr at openjdk.org> wrote:

>>> > The test is failing on my windows machine with an error - _java.lang.RuntimeException: Button renderings are different after window resize, num of Diff Pixels=1576_ Images are uploaded for reference.
>>> > ![image1](https://private-user-images.githubusercontent.com/94159358/359016384-349f9300-25ba-4402-9668-d9e89321b23c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwNTgwMzEsIm5iZiI6MTcyNDA1NzczMSwicGF0aCI6Ii85NDE1OTM1OC8zNTkwMTYzODQtMzQ5ZjkzMDAtMjViYS00NDAyLTk2NjgtZDllODkzMjFiMjNjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDA4NTUzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVlYmY4MzNkZGJiMjY0MDUzN2Q0YzNhNzllZGUxOTU4OWY4ZjBiMDBhM2Y1YzI0OTFmYTdlYmQ5MzVjN2Q2NzMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.pgGc3C1vDtfnl_Zqx6wDFW7jkzsC-AjfGYdRTK3Op-s) ![image2](https://private-user-images.githubusercontent.com/94159358/359016448-c25fb95e-1f80-4762-9388-1b799a0184e8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e
 yJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwNTgwMzEsIm5iZiI6MTcyNDA1NzczMSwicGF0aCI6Ii85NDE1OTM1OC8zNTkwMTY0NDgtYzI1ZmI5NWUtMWY4MC00NzYyLTkzODgtMWI3OTlhMDE4NGU4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDA4NTUzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNiZGU1MDRhZjZmNzViNzk3YjQ0MzkxMDJiZDIxZDJlN2FkZjk3MDU5NTA4NDE4N2RkOWMwMDY5MzI2MDY2ZTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.8rwB9KPKg3Hpi_diZ7Rrm7BLbsVocU9j6Dn1F8j0mUM)
>>> 
>>> @TejeshR13 I have run it multiple times on different windows machines(Windows 2022, 10, 11) in mach5 and it passed everywhere and visibly I don't see any differences in the images attached by you. Can you try with the updated test which is attached to the bug(it will generate two diff images if the test fails), so that we will come to know what exactly is the difference between the images.
>> 
>> If u can notice there is a slight positional difference of desktop icon of the Java app....... I guess the image comparison includes those also?
>
>> @TejeshR13 , no, it just compares the Button renderings only, nothing else. `bimage = robot.createScreenCapture(new Rectangle(buttonLoc.x, buttonLoc.y, button.getWidth(), button.getHeight()));`
> 
> Which is exactly in the image right?

> > > @TejeshR13 , no, it just compares the Button renderings only, nothing else. `bimage = robot.createScreenCapture(new Rectangle(buttonLoc.x, buttonLoc.y, button.getWidth(), button.getHeight()));`
> > 
> > 
> > Which is exactly in the image right?
> 
> Yes, your images contain the Windows taskbar also, but I'm not sure why it is taking that also when we capture the screen based on button's dimensions, could it be because of button.getWidth() and button.getHeight() returning wrong values?

Not wrong values, its just that the button is slightly behind the window icons. Better to move the button up so that it wont mix up with icon.

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

PR Comment: https://git.openjdk.org/jdk/pull/20532#issuecomment-2296151827


More information about the client-libs-dev mailing list