JDK-8176902 : Add waitForIdle support to FX Robot
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 9,10
  • Priority: P2
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2017-03-16
  • Updated: 2020-10-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Blocks :  
Duplicate :  
Description
We need to add a Robot::waitForIdle method similar to that in AWT Robot.

FX testing needs to be able to detect when certain operations are "complete".

Two operations that are known:

1) Something like 'XSync', where any pending window operations are known to be completed. For example:
 * for show(), that a window is  now visible
 * for resize(), that any pending wmgr operations are complete, and events reported.
This is particularly of interest for GTK/X11 which has potential delays for wmgr operations, and for Mac with its full screen animation.

2) rendering operations are complete. This includes 
  * layout is not dirty
  * no SG nodes are dirty.
  * no paint operations are pending
Clearly there are issues with any form of animation, as there would be a constant stream of changes, making any "complete" statement difficult to define, much less detect. Handling the case where there is not animation would be valuable in itself.

Given that there are a number of possible callbacks that must happen on the User Event thread - these calls cannot be blocking. Perhaps the best option would be for the caller to provide a runnable that could be called (on the UE thread ?) when the appropriate state is detected.

If we start with an assumption that we have two callbacks - then the test developer can use the combination needed for checking state, for example the first call might need to be:
   "notifyToolkitComplete", "notifyRenderComplete", 
but subsequent calls to the same window might only need "notifyRenderComplete"