On Fri, 26 Sep 2025 07:46:39 GMT, Prasanta Sadhukhan <[email protected]> 
wrote:

>> Actually, it seems like moving the addition of the listener can cause some 
>> issues that lead to failures. Moving it as you suggested works fine locally, 
>> but in testing on CI the test fails on all OS's due to 
>> `buttonMouseEnteredCount` being non-0. I'm assuming since the listener is 
>> added earlier in the test, the count would be 1 instead since the Robot's 
>> mouse movement would enter the button area once, but then the test fails 
>> locally. I'll keep the addition of the button listener where it originally 
>> was to avoid having the complexity of solving this both locally and in CI.
>
> What if we move the listener and additionally we reset 
> `buttonMouseEnteredCount ` to 0 before we start the drag 
> `robot.mouseMove(pointToClick.x, pointToClick.y);`
> I guess that should not interfere with the test as it is checking for extra 
> mouseEnter event after completion of drag

Sure. This may be slightly odd to see a count reset mid-test instead of 
retaining the original position of adding the listener, but I think this is 
fine. I re-tested on CI to make sure this still passes, and it looks good on 
all OS's. Thanks for the suggestion.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27478#discussion_r2382916244

Reply via email to