RFR: 8351357: Add canary system test checking if Stage receives focus on show

Martin Fox mfox at openjdk.org
Tue Jun 17 14:48:36 UTC 2025


On Mon, 16 Jun 2025 17:39:35 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> tests/system/src/test/java/test/robot/javafx/stage/StageFocusTest.java line 113:
>> 
>>> 111:             robot.keyPress(KeyCode.A);
>>> 112:         });
>>> 113:         assertTrue(receivedEvent, "Expected key press has NOT been received! Stage did not have focus after showing. Some tests might fail because of this." +
>> 
>> Do you need to sleep before the assertion to ensure that the event has been delivered?
>
> Perhaps we ought to have a utility (latch?) to ensure the sequence?

A delay of some sort is necessary to give the event loop time to process the event.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1804#discussion_r2152468920


More information about the openjfx-dev mailing list