RFR: 8332901: Choice/SelectCurrentItemTest/SelectCurrentItemTest.java doesn't open popup on macOS [v4]

Alexey Ivanov aivanov at openjdk.org
Tue Aug 20 14:55:52 UTC 2024


On Tue, 20 Aug 2024 14:47:23 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> I looked at `java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.java`, ran it and noticed that the test does not open the popup of the `Choice` component on macOS 14.x.
>> 
>> If the popup does not open, the test does not verify anything — it always passes.
>> 
>> I refactored the test and added a mouse listener to the `Choice` component. If mouse click isn't registered, the test fails.
>> 
>> The updated test fails for me locally on macOS Sonoma 14.5. This is likely the result of [JDK-8322653](https://bugs.openjdk.org/browse/JDK-8322653): _[macos14] : Mouse clicks are not received within 3 pixels of the window boundary_.
>> 
>> The updated test passes on CI.
>
> Alexey Ivanov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Amend the copyright year in SelectCurrentItemTest

While I worked on another backport, I found `SelectNewItemTest.java`. This test is basically the same: the only difference is that it selects *a new item* in the choice popup and expects `ItemEvent`.

I updated the other test too and refactored both of them to re-use common functionality.

I moved both tests — `test/jdk/java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.java` and `test/jdk/java/awt/Choice/SelectNewItemTest/SelectNewItemTest.java` — to `test/jdk/java/awt/Choice/SelectItem/` folder. The `SelectCurrentItemTest` is the main one as the oldest; and `SelectNewItemTest` now extends `SelectCurrentItemTest`.

Both updated tests pass in CI and locally on macOS 14.x. Non-resizable frame is used to workaround [JDK-8322653](https://bugs.openjdk.org/browse/JDK-8322653).

I will update JBS issue and the description of the PR accordingly.

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

PR Comment: https://git.openjdk.org/jdk/pull/20601#issuecomment-2299059110


More information about the client-libs-dev mailing list