RFR: 8341982: Simplify JButton/bug4323121.java [v4]
Alexey Ivanov
aivanov at openjdk.org
Fri Oct 18 16:52:09 UTC 2024
On Fri, 18 Oct 2024 16:36:59 GMT, Sergey Bylokhov <serb at openjdk.org> 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 <abhishek.cx.kumar at oracle.com>
>
> 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
More information about the client-libs-dev
mailing list