On Fri, 18 Nov 2022 00:17:47 GMT, Damon Nguyen <[email protected]> wrote:

> This is an older test that failed intermittently but had a fix specifically 
> for mac systems by adding key presses on mac only. This test still 
> intermittently failed after this fix long ago and was problem listed. 
> 
> I ran this test 100 times on each OS after applying waitForIdle and delays 
> between all key presses to match the delays previously present in the test.
> 
> I also added a debug line and save and image of the failing window upon 
> failure to better debug if/when the test ever fails again. The debug line is 
> to check if the previous fix for mac is relevant in the failure. The image 
> shows the status of the window and what is focused at the time of failure.

Tested on Mac and Windows, test works well.
Minor suggestions added.

test/jdk/java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java line 99:

> 97:         }
> 98:         robot.waitForIdle();
> 99:         robot.delay(2000);

Is such a large delay required here since `autoDelay` and `waitForIdle` are 
also being called?

test/jdk/java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java line 150:

> 148:             // Save image to better debug the status of test when failing
> 149:             Rectangle screenRect = new Rectangle(100, 200,
> 150:                     win.getWidth(), win.getHeight() + 20);

Suggestion: You can capture the frame as well as window by using the following 
(it captures the entire testing screen).

GraphicsConfiguration ge = 
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
BufferedImage failImage = robot.createScreenCapture(ge.getBounds());

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

PR: https://git.openjdk.org/jdk/pull/11227

Reply via email to