On Fri, 18 Oct 2024 16:36:59 GMT, Sergey Bylokhov <[email protected]> wrote:

>> Alexey Ivanov has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Remove space before comma
>>   
>>   Co-authored-by: Abhishek Kumar <[email protected]>
>
> test/jdk/javax/swing/JButton/bug4323121.java line 66:
> 
>> 64:             });
>> 65:             robot.waitForIdle();
>> 66:             robot.delay(1000);
> 
> The new code probably should follow the same pattern, flush all 
> events/commands to native by the waitForIdle. and then wait response from OS 
> for 1_or_less second.

I reversed the order because window may gain focus before all the events are 
processed.

To ensure all the events in the queue are handled, I added 
`robot.waitForIdle()`.

The next action in the test is to get location of the button, which can be done 
safely since the frame must be displaying on the screen because it has already 
received `windowGainedFocus` event.

For this reason, there's no need for `robot.delay(1000)`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21475#discussion_r1806774894

Reply via email to