On Thu, 28 Nov 2024 01:19:31 GMT, Damon Nguyen <[email protected]> wrote:

>> Test intermittently fails with a few different Exceptions. Initial report 
>> shows `Choice can't be controlled by keyboard` when failing. An additional 
>> report of an intermittent failure shows `Button does not have focus`.
>> 
>> Added some stability fixes. Additional delays, removed extraneous window, 
>> and added an additional focus check.
>> 
>> Debugged using additional screenshots during different failure points. Looks 
>> like sometimes the focus is still on the button. So, the delay has been 
>> added afterwards. Test passes on 22.04 Ubuntu machine with 100 repeats in 
>> CI. Also passed testing on all OS's with 50 repeats in CI.
>
> Damon Nguyen has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - String comparison
>  - Review comments

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

> 53:     static Frame frame = new Frame("Accessible Choice Test Frame");
> 54:     static Choice choice = new Choice();
> 55:     static Button button = new Button("default owner");

should be moved inside EDT.

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

> 67:             if (frame != null) {
> 68:                 System.out.println("FOUR");
> 69:                 frame.dispose();

dispose on EDT.

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

> 108:             loc = button.getLocationOnScreen();
> 109:         });
> 110:         robot.mouseMove(loc.x + button.getWidth() / 2, loc.y

get button's width and height on EDT along with location.

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

> 114:         robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
> 115:         robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
> 116:         System.out.println("EIGHT");

Any reason to add these many print statements ? Is it for debugging purpose?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22333#discussion_r1862956781
PR Review Comment: https://git.openjdk.org/jdk/pull/22333#discussion_r1862957173
PR Review Comment: https://git.openjdk.org/jdk/pull/22333#discussion_r1862958350
PR Review Comment: https://git.openjdk.org/jdk/pull/22333#discussion_r1862959380

Reply via email to