RFR: 8368185: Test javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java failed: Synth ButtonUI does not handle PRESSED & MOUSE_OVER state
Prasanta Sadhukhan
psadhukhan at openjdk.org
Fri Oct 3 06:11:46 UTC 2025
On Wed, 1 Oct 2025 09:41:26 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> Test frame is changed to Red for Mouse PRESSED and MOUSE_OVER state but it seem time is too less before it is moved to Green when mouse press is released so it retrieves Green instead of Red.
>> Also, the pixel color retrieval point is conflicting with mouse cursor position, which gets picked up during `robot.createSceenCapture` execution so retrieval point is moved slightly up instead of down.
>>
>> 100 iterations of the test passed in all platforms.
>
> test/jdk/javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java line 92:
>
>> 90: robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
>> 91: robot.waitForIdle();
>> 92: robot.delay(2000);
>
> I wonder if syncing with `mousePressed` event handler on the button and adding a little delay after `mousePressed` is triggered would allow for smaller delay. Anyway, using an event handler will *guarantee*, the same handler is called in `ButtonUI`. We will still need a delay to allow the button UI delegate to handle the event and to repaint the button, yet that delay less than 2 seconds would be enough.
Since the color change to Red will happen on MOUSE_PRESSED and MOUSE_OVER state, I wanted to give it more time to be in red color state so that robot can pick the color..
The failure was that it was picking up Green color even though the CI failure artifact shows background is Red
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27444#discussion_r2400905436
More information about the client-libs-dev
mailing list