JDK-8321042 : Test java/awt/event/KeyEvent/AcceleratorTest/AcceleratorTest.java fails on macOS
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 11,17,18,22
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2023-11-29
  • Updated: 2023-12-01
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
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
The test/jdk/java/awt/event/KeyEvent/AcceleratorTest/AcceleratorTest.java test fails on macOS, not all the actions can be performed.

The cases 2 and 5 do not work for me. I use a PC layout for Russian on Mac, period in this Russian layout is on "/?" key but pressing Ctrl+(/?) doesn't fire the event. Nor is the event fired when I press Alt+Ю (key with ".>").

Additionally, pressing Alt+Ж fires the event but the printed command is "«" instead of "ж".

The fix for JDK-8315701 has resolved the issue with Ctrl+N: it works with the fix but doesn't without it.

* It's a follow-up from JDK-8315701 code review: https://github.com/openjdk/jdk/pull/16664#pullrequestreview-1735155100
Comments
As I mentioned in the code review, I'd refactor the test further¹ but it's not necessary. However, logging all the keys pressed may help in debugging; the output should go both to console (for later analysis) as well as to the output window. When all the actions are fired, the test could go ahead and call PassFailJFrame.forcePass(). The test may even disable the Pass button in PassFailJFrame when this feature is available (JDK-8317111). Now that the test displays two windows, it will benefit from support for multiple windows added by JDK-8294156; yet it also requires JDK-8317116. ¹ https://github.com/openjdk/jdk/pull/16664#discussion_r1396161438
29-11-2023