RFR: 8316388: Opensource five Swing component related regression tests
Alexander Zuev
kizune at openjdk.org
Wed Mar 13 19:49:13 UTC 2024
On Wed, 13 Mar 2024 16:25:03 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> Cleaned up five more tests.
>>
>> Continuation of https://github.com/openjdk/jdk/pull/18184
>>
>> Unfortunately one of the commits rendered the whole PR invalid so i closed it and restarting it here.
>> All comments from the previous review are addressed.
>
> test/jdk/javax/swing/JDesktopPane/bug4773378.java line 107:
>
>> 105: robot.keyRelease(KeyEvent.VK_CONTROL);
>> 106:
>> 107: Thread.sleep(2000);
>
> Suggestion:
>
> robot.waitForIdle();
>
> Is it really necessary to wait for 2 seconds before shutting down the test.
>
> According to [JDK-4773378](https://bugs.openjdk.org/browse/JDK-4773378), `NullPointerException` was thrown when <kbd>Ctrl</kbd>+<kbd>F6</kbd> was pressed. The `waitForIdle` method doesn't return until the event queue is empty which implies the keyboard events are handled. It saves nearly 2 seconds.
Ok.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18259#discussion_r1523831409
More information about the client-libs-dev
mailing list